   my new engine design...thoughts...
  HiyaDuring my nightly evaluation of my progress and writting down my ideas, I realized something that changed the entire way im going to make my game engine, this idea has been done with the Unreal engine but I never realized why exactly until last night.The unreal tournament engine is basically a 3d engine with a fiew generic game entity classes such as actor, weapon, terrainetc. The bulk of the game code is written in script, which means that to make a new game with the engine, you simple make a new collection of scripts (packages).With that said, my general design plan looks like this:engine.exe - windows code, input,sound,math lib, renderer (I may put the renderer in a dll), scene graph, entity classes, physics,script engine (lua), UI system (menus, hud etc), etc.The entity system, UI system, parts of the renderer and physicsengine, math etc will be interfaced with lua.As far as scripting, I think Ill do something like this:CSomeGun = CWeapon:New() //CWeapon is found in the engineCSomeGun.filename = "data/models/weapons/somegun.ms3d";...then when you want to add a new instance of the CSomeGun class,obj1 = CSomeGun;obj1.SetPos(...); //automaticly set when the designer places itin the world.etc.Im not sure if you can do things like that in lua, although I dont see why not.Im still a bit unsure about how to handle the scene graph, I think that the objects when loaded into the engine, ill have them all added to the scene list. (Im already using a linked listtree for objects now, so the addtoscene function will simplybe recrusive and add the children as well.Alrighty, well any comments, thoughts or ideas, feel free to share! ~JasonEdit: I would imagine that this is what is known as a data driven design, right?[edited by - no one on January 24, 2004 3:30:11 PM]
  That was a design that I had worked with before.  I had it working with Lua, and then changed to SpiderMonkey (Mozilla &#106avascript engine) for *somewhat* better OOP support.The biggest issue is speed.  Running EVERYTHING in scripts is a lot of extra overhead.  Here''s a couple tips that might help:1) Aim for a scripting language that supports some simple form of bytecode script compilation.  Lua and SpiderMonkey kind of have this, it speeds the scripts up a little2) Put as MANY functions you can into the engine to call from your scripts.  I wouldn''t define too many functions in the scripts.  I would make a massive library of useful functions in the engine, and just use the scripts for the logic and event handling for the games.3) If you would like to finish off the engine exe and hardly go back to it ever, (do most work in scripts), perhaps write a DLL plugin system for your engine that could define new methods and register them with your scripting engine.  That should keep your scripting libraries (DLL) and scripts separate from your engine frameworkHope that helps you out,~Graham   ----while (your_engine >= my_engine)   my_engine++; ;  Awsome gwihlidal. Do you have any screen shots of your engine?I will probably do what you said and write a ''massive lib of functions'' in the engine or dll, whatever, and call them fromthe script. The game will be a 3D rpg which a few of my friends will be making data for. We want to have a ton of charactors, weapons,powerups, etc so this method seems to be the best for our purposes.Anyway, what about game monkey, angel script, xml, ... can any of those output bit code? Are they faster then lua? hmm. This could be a topic for a new post Thanks again! ;  Check out the link in his profile; I might add that the concept art looks excellent. ; Hi ''no one'',  I''m interested in the same topic. What should be let to scripts and what should not.   This functions u said that will ve called from the script... are there methods? Can you share some thoughts on this?  And using Lua, how do you plan to send messages to specific instances of some classe?  Thanks!;  There was a game called Vampire:masqaurade that came out in 99 I believe that had a similar architecture.Thay made dlls with all their core code.  Then used JNI and &#106avascript to actually make the game.  Therefor, all their menus and game logic was done in &#106avascript and called upon the C++ code for the core items.  The game was pretty good, so your basic idea is not flawed.  I think Gamasutra had an article on it.   ; Thanks, Taulin, for the reference. The two links below talk about that game...http://www.gamasutra.com/features/20000802/huebner_02.htmhttp://www.gamasutra.com/features/19990611/java_06.htm But i''m still lost in thoughts... ;  Be warned that most scripting languages, notably Lua, don''t integrate especially well with any serious OO programming designs... ;  I''d check out Python before I decided on a perticular scripting language.  Its very OOP orentied, and can output in byte-code.  I''ll admit I haven''t used it very much, but most of my scripting needs could be meet with Lua.  I''d write out what the scripting engine will have to do, and how you think you will implement it before I picked a scripting languge. ;  Hmm, im not very familiar with scripting for games, but im having a big difficulty to imagine that writing everything except the engien in a scripting language would have any advantage over coding it, except that maybe you can have artists and other nonprogrammers write the game. But for real.. there must be some other advantage?As i see it you have two parts of a game:Engine -> Game LogicWhat point would there be to write the logic it in a scripting language? Im not flaming im just intressted. 