Game Development Community

Main.cs and game.cs, how's it done right?

by Scott Johnson · in Torque Game Builder · 08/05/2006 (9:32 pm) · 1 replies

Regarding main.cs and game.cs

I would like to get some feedback from the community regarding some best/standard/common practices...
I am assuming this hypothetical game would be sufficently complex to require all the basic elements of a full featured game. i.e will exercise a significant portion of the available functions within the engine...

Up till recently I had been ok with using the default main.cs and game.cs as provided by the tutorials, and I've seen several TDN tutorials that have modified main.cs and game.cs to take more control over the startup process, each with slightly different methods... Combine this with the fact that the startup code is actually different than when the game is run via TGB v.s. a "built" version, and I start to get a bit lost...

And I know that a lot of this depends on the type of game being built, but I would think to some degree, that Scene, Window, Player, type of setups should be pretty common...

Just for starters, I know that some of my initial questions have been...

Why does the InitializeProject function call startLevel with $levelEditor::LastLevel[$currentProject] ??
doesn't this tie the game to the editor? I now use my own function to load up levels...

Why is the default sceneGraph unnamed, and should I be creating my own "gameScene"? I now create my own sceneGraph with my own function.

I'm starting to think that I'm going to be:

Creating my own sceneGraph, sceneWindow, Camera, and objects dynamically at game start (or on demand)... is this how some of you are proceeding?

Anyhow, sorry If I'm jumping around a bit, but I think this could be a useful discussion to help get newcomers just a little more help once they get past the tutorials, and start really digging into building full featured games.

Thanks in Advance.

#1
08/06/2006 (1:40 am)
Start level is called like that so your last loaded level will be in the editor. Rewrite that whenever you actually have enough of a game to do so.

Who knows why the default scenegraph stopped being named by default. Feel free to name it as you see fit.

Should you be creating your own gameScene? Who knows? "Should" is a funny question because the only answer is to do whatever is right for your project under those specific circumstances. So far I have been building my levels in the editor and not naming the scenegraphs, just because that makes sense for my current project.