Results 1 to 4 of 4

Thread: TBGL+3d-Engine

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Philippines
    Age
    47
    Posts
    1,218
    Blog Entries
    1
    Rep Power
    133

    TBGL+3d-Engine

    I was browsing for some good and easy to use 3d-Engine to combine with TBGL since the most of them don't have built-in Basic-language.

    I found some list at http://devmaster.net/devdb/engines which gives good overview and where is actually some sorting function to specify which features, OS and stuff the engine should meet that will spit out eventaully some engines then. But I don't know what to look for (except stable/active, windows & openGl) and how to get it running in TB later on...

    It's like I want to use the vacuum cleaner but seems I don't find the right model and I'm to stupid to plug it in, not even to talk about turning it on...

    So maybe one of you has some suggestion?

    EDIT:

    Petr and I chatted about TES-CS and I just give some overview here:

    A combination of this >>>link to large picture of it and thinBasic would be somehow the stuff of the Developing-Environment of my dreams.

    The Object-Window there holds basically a list of 3d objects (entity-templates, meshes), classified into stuff like Statics, Activators (which can be statics too but they can have a script and can be activated in game somehow), Bodyparts, Weapons etc.
    Armor, Clothing and NPCs get combined by Bodyparts there - onto some raw bone-animations... but that's already too much detail for now...

    The Window captioned "Gnisis -10, 11" shows currently an exterior-scene from above in 3d

    (there are two kinds of scenes: Exteriors in Game get combined of the current scene plus the 8 "surrounding" scenes to the actual scene.
    (scenes are called "Cell" there) and the "Exteriors" make basically an infinite world map (in the current worldspace) on a grid build around Cell 0,0 of that worldspace, so thats why it has -10,11 here, Gnisis is the name of a city in the game. So the window shows Cell "Gnisis" -10,11, - this is the older version there it does not have more than one worldspace
    Interior-Cells were used for Dungeons, in-House-Scenes, Caves, in ships, even large cities divided by walls,...all what you can think of...

    Into this 3d-Window the user can drag an object-ID from object-window-list into the scene (then can double-click the displayed model and define this references position, rotation etc)
    In the Cell-View-window below you have a list of scenes on the left and a list of objects-references ("Entities") which are inside the current displayed scene.

    On the top of the Main-Window itself you see a button-bar, as there were Load, Save, Editor-Properties, Undo, Redo, Snap to Grid, Snap to Angle, switch to terrain-edit, edit pathgrids, turn on/off lights and fog, edit NPC/Creatures dialogs and Journals, and very important: the yellow pen: Edit Scripts, click there will open some texteditor with an included pre-compiler for those scripts, plus the speaker to edit sound-resources (name them, set filename etc.)

    So almost anything (but Bodyparts, levelled stuff and statics) can get attached a script that fires in-game every frame if a reference of an object which wears the script is inside the current scene. So if i write in the script attached to some object

    Move X, unitsPerSecond

    this statement affects the object-reference in the current scene which wears the script. So this script is usable for similar items like rotating gears, lifts or whatever.
    if i would write

    ObjectID.Move X, 20

    I would move the one unique Object wearing "ObjectID" as an identifier.
    That means it has to be a global reference (here "Persistent" - that's why you can read Persi... somewhere in object window)
    Scriptcode is almost Basic-like but has just:
    begin "scriptname"
    if(test)
    elseif(test)
    else
    endif
    while(test)
    wend
    return (=breaks script execution for this frame)
    set var to (value)
    end "scriptname"
    startscript "scriptnameX"

    if (scriptRunning "scriptnameX")
    stopscript "scriptnameX"
    endif

    defining of local floats, longs, shorts (no strings) is possible, they are static to the reference but accessable "from outside" on persistent references like
    "set myObject.Var to 123", the older syntax for the same would be "set myObject->var to 123"
    there are methods for 3d-movement and positioning, to play sounds and a few more, of course a lot of the game-specific stuff like "HasItemEquipped" and "GetJournalIndex"
    There are also global scripts possible which can get started from the global running main-script or from a global object reference.
    Can even start an additional script from a non-persistent reference but it will stop if the scene changes. While-Wend loops don't work in pure global running scripts.

    If you read the tabs on the object window you saw the objects-types already, mostly it's game-specific here,
    Leveled-Items or Leveled-Creatures are lists consisting of other objects (to spawn enemies at player-level and so he doesn't find the best sword in the beginning, random enemy-equipment, random leveled loot etc.)

    Doors are special connections between scenes and have some additional pointer (doormarker) to a position inside any scene: If the player passes the door he gets positioned at the doormarker of that certain door. You see a few of them in the scene, the pinkish arrows (they're invisible in game)
    So one has to create always two doors and position 2 doormarkers to get the connection working...

    Books are items where player can read - so GUI changes in-game and displays text, but books have a world-model + inventory image too. Lights are objects that can have a model or not and all that get's just dragged and dropped into the current scene to edit. Spellmaking is some in-game magic-effects that you can combine to "Spells" which can be castet by creatures, npcs and activators (also from doors, containers and lights which are just special kind of activators), Enchantments are spells that can be applied to weapons, clothing, armor, books...

    If you would right-click on some listed object an object-class-specific dialog would open where you can set properties to all objects of that kind, attach a script or you can choose to create a new object, make a copie of the current etc.

    It lacks of supplying a simple Mesh-Editor (I wrote my own one though in those days) and you can't alter the terrain-mesh nor textures in a scene while the game runs.
    I always had fun using this - in the meantime 12 year-old-thing and always thought that Basic would evolute this object-oriented 3d-way and I was very disapointed that for example microsoft went the visual-.net-way instead of going for the visual 3d-way and I thought purebasic, which I bought in some store in 2005 would work this way but it did not- images on the package did show some running example-program but not the IDE so I felt ripped off. I felt even more ripped of when they refused me to update to the new version since the package promises life-long-right for updates...
    So the kind of Visual-fullyOO-3d-Basic I dream of doesn't exist yet, although thinBasic + TBGL-Scene & Entity-System might be a good point to start from.
    Last edited by ReneMiner; 20-02-2013 at 11:31.
    [TABLE="class: tblf1 tblf-fullwidth tblf-alternate"]
    [TR]
    [TD][COLOR=#b22222][B][SIZE=1]The limit is[/SIZE][/B][/COLOR][/TD]
    [TD="class: isRelinked"] [COLOR=#0000cd][B][SIZE=1]Imagination[/SIZE][/B][/COLOR][/TD]
    [/TR]
    [/TABLE]

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,790
    Blog Entries
    3
    Rep Power
    693
    Hi Rene,

    I am not sure how it is always possible to intermix 2 engines together, but here is general advice on how to make "some" technology work in ThinBASIC:
    • download the library in DLL form
      • the DLL should be 32bit, built for Windows x86
      • the DLL should not be DLL with C++ classes, it should contain procedural interface only
        • on the website your linked, the search criteria is made like "C/C++" -> but C and C++ are two soooo different beasts!

      • *in theory it could be COM DLL, but the work with COM is not so comfortable in ThinBASIC

    • make sure to download some kind of header file as well, with definitions of the functions hidden in the DLL
      • translate these header files to DECLARE syntax suitable for ThinBASIC
      • store the translation of header in form of tBasicI file, which can you include later with any script



    So far, I applied this approach to cutting edge technologies such as OpenGL, OpenCL or ODE, and it worked for me. General rule - if it runs from C, it will run from ThinBASIC too.


    Petr
    Last edited by Petr Schreiber; 19-02-2013 at 23:36.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  3. #3
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Philippines
    Age
    47
    Posts
    1,218
    Blog Entries
    1
    Rep Power
    133
    problem is: I have no idea about c,c++ nor c# and what the differences are. I know just there's "if, void, int" and a lot of curly braces and semicolons.

    While you answered I was editing my last post - used up some time - you posted before I was done editing, so that's the main reason why I post this reply.
    It's about TES-CS, some mechanics and a picture of it.

    Edit:
    Looked around this morning a bit ... still no decision made...continue search, best I've found are currently G3D and PixelLight - still alive and not outdated -, but I fear both (as most of them) have those evil classes

    Irrlicht seems to provide the headers (even offers language-bindings to basic which would not be that complicated to fit thinBasic!)

    -downloaded package and found the .dll-file in some subfolder already

    but I didn't find out if it has classes yet! And I got nothing but a hex-editor to open this .h(eader?)-files
    and just found out where to get the IDE -not exactly what I dreamt of...
    "Irre" is kind'a crazy in german and "Licht" is light so Irrlicht means 'crazy as speed of light' - now you know what IrrEdit means too.

    -damned- there are classes...

    back to TBGL then: I fear the return values of functions as for eample
    TBGL_EntityGetPos( SceneID, EntityID, X, Y, Z )
    
    is just single-float-preciceness in X,Y and Z then?
    Last edited by ReneMiner; 20-02-2013 at 16:56.
    [TABLE="class: tblf1 tblf-fullwidth tblf-alternate"]
    [TR]
    [TD][COLOR=#b22222][B][SIZE=1]The limit is[/SIZE][/B][/COLOR][/TD]
    [TD="class: isRelinked"] [COLOR=#0000cd][B][SIZE=1]Imagination[/SIZE][/B][/COLOR][/TD]
    [/TR]
    [/TABLE]

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,790
    Blog Entries
    3
    Rep Power
    693
    Hi Rene,

    if you like Irrlicht, you can find some wrappers here:
    http://www.thinbasic.com/community/f...p?290-Irrlicht

    I don't like this engine personaly, I am afraid the only game engine worth of study as of today is the Unity. It has ... all.

    Regarding your worries - don't worry, be happy, because TBGL uses DOUBLEs.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

Similar Threads

  1. 3Impact 3D Engine
    By zak in forum Software discussion
    Replies: 2
    Last Post: 17-04-2012, 14:32
  2. M15 Hovercraft with jet engine
    By Michael Hartlef in forum Resources
    Replies: 3
    Last Post: 19-04-2008, 01:11
  3. MS Excel as 3D engine :D
    By ErosOlmi in forum Development
    Replies: 3
    Last Post: 13-03-2008, 01:09
  4. ODE - Open Dynamics Engine
    By Petr Schreiber in forum ODE - Open Dynamics Engine
    Replies: 21
    Last Post: 28-04-2007, 08:29
  5. Retro DOS like graphics engine
    By Petr Schreiber in forum TBGL Scripts and Projects
    Replies: 0
    Last Post: 12-05-2006, 22:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •