Separating Game from Engine
by James Lupiani · in Torque Game Engine · 05/15/2002 (4:26 am) · 7 replies
Tim Newell and I were talking in chat this morning, and the topic of the way Torque is organized came up. Though personally I don't quite agree with the DLL approach being pushed lately, I do think the workspace could use a bit of cleaning up for clarity and reduced maintenance complications. The game project contains the engine lib files and the engine lib contains the game files. Until now I'd just let it go, since it didn't really seem to impact anything.
We gave it a shot, and both managed to get the game and library separated and compiling correctly with minimal effort. However, when we actually try and run the game, it appears to hang. Looking at the debugger, it appears to happen somewhere in DemoGame::main, right at the call to TelConsole->process() for me.
Here's a modified set of project files that should let everyone catch up without much trouble. Just stick them in your vs6 directory and open as usual.
We gave it a shot, and both managed to get the game and library separated and compiling correctly with minimal effort. However, when we actually try and run the game, it appears to hang. Looking at the debugger, it appears to happen somewhere in DemoGame::main, right at the call to TelConsole->process() for me.
Here's a modified set of project files that should let everyone catch up without much trouble. Just stick them in your vs6 directory and open as usual.
About the author
Programmer for Sickhead Games
#2
-Tim aka Spock
05/15/2002 (5:43 am)
yeah I see what you mean. says eval doesnt exist basically so the scripts dont get executed. I copied the console folder into the game workspace and it loaded up but crashes after loading the window.-Tim aka Spock
#3
adding the console files to this project had no effect for me, but hacking past this brought me to an error about having a null setData function, for this object:
GuiControlProfile regarding this field:
I dont know why the hashtable is busted ..
but I think this ties in with it.
05/15/2002 (6:36 am)
I found that:Namespace::Entry *Namespace::lookup(StringTableEntry name) {
...
while(mHashTable[index] && mHashTable[index]->mFunctionName != name)this code here has a broken mHashTable .. with some null entries, these null entries precede the one for eval therefore it dont make it to it. Im not sure why.adding the console files to this project had no effect for me, but hacking past this brought me to an error about having a null setData function, for this object:
GuiControlProfile regarding this field:
addField("soundButtonDown", TypeAudioProfilePtr, Offset(mSoundButtonDown, GuiControlProfile));I dont know why the hashtable is busted ..
but I think this ties in with it.
#6
05/15/2002 (7:01 am)
I've got bigger fish to fry for the time being. Besides, I think if I hear the phrase "Torque on top!" one more time I'm going to frag someone.
#7
05/15/2002 (2:54 pm)
WOOOT!
Torque Owner Badguy
it brought me to where you spoke of.
but the game is running fine you might be happy to hear:)
the problem im having with it is:
if(!ent) { warnf(ConsoleLogEntry::Script, "%s: Unknown command.", argv[0]); return ""; }heh I make it in there which is no good.if you'll be kind enuff to debug to line:
found on line 395 of main.cc
then step thru that youll see we never properly evaluated the eval command :)
therefore no objects get added to the engine.
there is nothing to do.