Previous Blog Next Blog
Prev/Next Blog
by date

Torque Game Engine Understanding Diary, part #2

Torque Game Engine Understanding Diary, part #2
Name:Vitla 
Date Posted:Oct 22, 2006
Rating:2.0 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Vitla

Blog post
15.

Where did we stopped? Ah, remembered - so after some C++ magik we had our machines to call actual DemoGame object's methods. Actually anything that we create of type GameInterface will be called by our machines.

Continue to study DemoGame::main() method - something with console... other libraries and initializations... Well, things are pretty understandable and clear - if I want to study particular library or module, I already know from where to start studying them. What is next? Several thing to choose from:

1) continue to read Manual

2) make dig into understanding of the tricky creation path that looked very important to understand. Remember scene, actor, camera ideas topics? Client, Server is another model of thinking - and this the place where this show begins - at line 313 - they even mixed them up somehow!:


   Sim::init();

ActionMap* globalMap = new ActionMap;
globalMap->registerObject("GlobalActionMap");
Sim::getActiveActionMapSet()->pushObject(globalMap);

MaterialPropertyMap *map = new MaterialPropertyMap;

map->registerObject("MaterialPropertyMap");
Sim::getRootGroup()->addObject(map);

gClientSceneGraph = new SceneGraph(true);
gClientSceneRoot = new SceneRoot;
gClientSceneGraph->addObjectToScene(gClientSceneRoot);
gServerSceneGraph = new SceneGraph(false);
gServerSceneRoot = new SceneRoot;
gServerSceneGraph->addObjectToScene(gServerSceneRoot);
gDecalManager = new DecalManager;
gClientContainer.addObject(gDecalManager);
gClientSceneGraph->addObjectToScene(gDecalManager);


It means that Sim, ActionMap, SceneGraph and all this - is another big topic - like another layer of understanding or abstraction.

3) Step back and study carefully those GameInit(), netInit(), showInit() and other init() guys after Sim - related creation madness.

4) Skip this initGame() function at all and continue to study DemoGame::main() method.

5) Go sleep

16.

I choose to sleep :)

17.

Continued to find something good to remember. Following variant 3 from step 15 I found that after initialization of all libraries, at the end of initGame() function (we are still in main.cc, checking what 's going on in DemoGame::main() method) we found runEntryScript() - the function resides in main.cc too - that is the point, when that main.cs script file is run.

18.

Back to libs in initGame() - DetailManager at 332 line is something still out of understanding, but the truth is that it resides in scene/detailManager.* files, so folder name tell me that this is something concerned that scene idea things. To study little bit later. Ok, PathManager = "Sim" (what is that?) things, ParticleEngine = fx thing. Good, so this is place where core things is slowly turning into more high-level unlearned things - Sim (Simulation? Then of what?), Scene, other game-specific structures, classes and models.

19.

Not diving into Sim and Scene still - back to DemoGame::main() - and, yes, at 439 - 460 lines we discover our main game loop. After quick check of code and TGE docs we truly discover that next step is to understand what Sim - "simulation" is here.

20.
And the next chapter "Platform layer" along with nice feeling of understanding what are they talking about :), brings us another diamond sutra:

"The game is driven by a stream of events from the platform library. By journaling the stream of events from the platform layer, the game portion of the simulation session can be deterministically replayed for debugging purposes. The events used by the platform layer are all subclasses of Event: general events (a list), input events (a list), networking (a list)."

(... driven by the stream of events... driven by the stream of events...) we spread a tear and get an enlightment, then move on studying TGE Docs, Engine Overview...

21.

Well, more or less is seems simple now - now everything that I find at resources and forums and docs seem to be making some sense to me. Concerning that starting things about RTSUnit - the answer is that studing next chapters about Console things i have found Bible Adam of the Engine - ConsoleObject class, from which a pretty bunch of various things derived - even Bible Eva - SimObject, from which much of that RTS Starter Kit things took their birth. More important - now I know where I can, where I should and where I want to go :)

So I can say I arrived to my goal. So this can be considered an end of this diary. Bye! :)

Vitla.

Recent Blog Posts
List:10/23/06 - Torque Game Engine Understanding Diary, part #3. Console
10/22/06 - Torque Game Engine Understanding Diary, part #2
10/22/06 - Torque Game Engine Understanding Diary, part #1

Submit ResourceSubmit your own resources!

You must be a member and be logged in to either append comments or rate this resource.