Customizing engine - where to start
by baylor wetzel · in Torque Game Engine · 06/29/2009 (12:18 pm) · 0 replies
First, TGB and TGE share an engine so is there an engine forum i should post to instead (i hate crossposting)? The text below refers to TGB but i'm told the core engine stuff is the same, hence my posting here
So what are the first steps one should take to setup the engine
The obvious first step - compile. i've finally gotten TGB 1.7.4 to compile in VS2008 (ug). What's next?
i think the next (obvious) thing is to figure out where the compiled files are. i believe that's \MyGameEngine\tgb\gameData\T2DProject, file named TGBGame.exe
Third, figure out how to use the new engine with my game. Looks like i can just copy TGBGame.exe to the main directory of my TGB project (the actual game, not the engine). i didn't copy any other files over but it seems to run fine. i don't know how this will work with the TGB editor's build/deploy feature
Fourth, i probably want a new EXE name generated, which is harder than it seems it should be. First, i changed the name of the project (open the VS solution, selecting my project in the solution browser and rename the project), which sets $(ProjectName). Then in the project's Properties->Configuration Properties->Linker i find the output file (../../../tgb/gameData/T2DProject/TGBGame_DEBUG.exe) and change TGBGame to $(ProjectName) (still need to repeat step 3 after this)
So there's the obvious stuff. What else should i do?
There's the engine changes. i like using array strings, lists and hashtables (maps) (a fast hashtable is probably the most important), so finding and applying stl_fix.h (it's somewhere on TDN i think) is probably good, although there might be reasons not to do so (TGB already has a tSimpleHashTable, which i've never used but might be a good enough replacement for me and there's probably some disadvantage to turning off Torque's memory manager, which stl_fix does, although i don't know what the details are)
Another engine change i've heard of but haven't done (yet) is exposing the STL hashtable to TorqueScript (which would be soooo awesome, don't know why it's not there yet; i ended up writing my own TorqueScript implementation)
i'm told if i want to do an iPhone game i should strip out everything in TGB that the game doesn't use (in order to reduce the memory footprint, which is a problem i hear about all the time). i don't know much about this or even if it applies to the TGB engine (as opposed to the iTGB code)
i recently learned that any folder in a TGB game can be replaced with a zip file (i.e., all the pictures in ~/data/images/ can be placed in the zip file ~/data/images.zip). To keep people from reading that, the zip file can be given a password. The engine needs to be compiled to use that password. To do that, i *think* (haven't tested this) you change line 22 of zipArchive.h (#define DEFAULT_ZIP_PASSWORD "changeme"). i love this feature and wish i knew about it a couple of years ago
Is there anything else cool i should be considering?
So what are the first steps one should take to setup the engine
The obvious first step - compile. i've finally gotten TGB 1.7.4 to compile in VS2008 (ug). What's next?
i think the next (obvious) thing is to figure out where the compiled files are. i believe that's \MyGameEngine\tgb\gameData\T2DProject, file named TGBGame.exe
Third, figure out how to use the new engine with my game. Looks like i can just copy TGBGame.exe to the main directory of my TGB project (the actual game, not the engine). i didn't copy any other files over but it seems to run fine. i don't know how this will work with the TGB editor's build/deploy feature
Fourth, i probably want a new EXE name generated, which is harder than it seems it should be. First, i changed the name of the project (open the VS solution, selecting my project in the solution browser and rename the project), which sets $(ProjectName). Then in the project's Properties->Configuration Properties->Linker i find the output file (../../../tgb/gameData/T2DProject/TGBGame_DEBUG.exe) and change TGBGame to $(ProjectName) (still need to repeat step 3 after this)
So there's the obvious stuff. What else should i do?
There's the engine changes. i like using array strings, lists and hashtables (maps) (a fast hashtable is probably the most important), so finding and applying stl_fix.h (it's somewhere on TDN i think) is probably good, although there might be reasons not to do so (TGB already has a tSimpleHashTable, which i've never used but might be a good enough replacement for me and there's probably some disadvantage to turning off Torque's memory manager, which stl_fix does, although i don't know what the details are)
Another engine change i've heard of but haven't done (yet) is exposing the STL hashtable to TorqueScript (which would be soooo awesome, don't know why it's not there yet; i ended up writing my own TorqueScript implementation)
i'm told if i want to do an iPhone game i should strip out everything in TGB that the game doesn't use (in order to reduce the memory footprint, which is a problem i hear about all the time). i don't know much about this or even if it applies to the TGB engine (as opposed to the iTGB code)
i recently learned that any folder in a TGB game can be replaced with a zip file (i.e., all the pictures in ~/data/images/ can be placed in the zip file ~/data/images.zip). To keep people from reading that, the zip file can be given a password. The engine needs to be compiled to use that password. To do that, i *think* (haven't tested this) you change line 22 of zipArchive.h (#define DEFAULT_ZIP_PASSWORD "changeme"). i love this feature and wish i knew about it a couple of years ago
Is there anything else cool i should be considering?
About the author