Game Development Community

Running two Torque Demo in One PC

by Mak Andrew · in Torque Game Engine · 04/20/2005 (3:11 am) · 9 replies

Hi, for some good reasons, i need to run two torque demo on a single PC... however the second one refuse to run and terminate unexpectedly, other has any clue thanks in advance

#1
04/20/2005 (4:31 am)
I seeme to recall a previous thread on this. I think what tehy said is it uses a tonne of resources. So if your system cant handle the resourceload it will crash on you. However, to debug you need to run 2 copies of the enige... So I know it is possible.
#2
04/20/2005 (8:09 am)
The _DEBUG.exe will allow multiple instances of the game to run, not the release version
#3
04/20/2005 (8:15 am)
To run 2 releases, open game/main.cc and find:

#if !defined(TORQUE_DEBUG) && !defined(INTERNAL_RELEASE)
   if(!Platform::excludeOtherInstances("TorqueTest"))
      return false;
#endif

Either comment out the if and return statement, or #define INTERNAL_RELEASE and recompile. Now you can run 2 release builds on the same comp.
#4
04/20/2005 (2:28 pm)
I am darn glad to know that! There's another bug I won't be needing to try and figure anymore, thanks!
#5
04/20/2005 (6:18 pm)
I just commented the if/return false statement, and recompile again, however the "second" application still refuse to run and it still terminate unexpectedly,... so not too sure of what's going on... anyone ...? thank

( Or Maybe Mr Chris Labombard, can you paste the previous link that talk about this issue, can't seem to find it in the forum, thank )
#6
04/21/2005 (4:38 am)
Can you step through it with the debugger and see how it terminates? If your debugger has a "trace" option, enable that so you can see all the instructions that led to the exit point. Otherwise this part is a bit tedious as you either have to laboriously "walk" through the program or make repeated passes with breakpoints set in various places until you narrow down on the code that's causing the mystery exit.
#7
04/22/2005 (12:06 am)
I can't, when i'm running the application through MSVC, i'm able to run two separate application, however if i were to run two separated .exe(not through MSVC, just by clicking on it), then the second one will fail, kind of strange isn't it...
#8
04/22/2005 (1:02 am)
We all get frustrated from time to time. ;)

So you removed the exclude check?
#9
04/25/2005 (3:59 pm)
I've been doing this for a while for testing purposes (you'd be amazed at how many issues show up in a dedicated-client arrangement that don't show at all when you host your own server with the client). I've made quite a few little changes to facilitate this process, almost all of which are script-based and none of which should be necessary if you're using stock TGE.

First thing I'd recommend is to make sure that you're running your second instance of the engine out of a duplicate of your regular build directory. You'll have no end of problems trying to run two "copies" of your game from the same data. The way I manage this is just to have a batch file set up to copy the files from my build directory (in stock TGE, "example") to my debug server directory (non-existant in stock TGE, so you'll have to create one yourself -- possibly using a cunningly deceiving title like "debug_server").

Once the batch file finishes copying, execute the duplicate exe as a dedicated server. You can then run your original exe via your IDE/debugger with a commandline switch to get it to connect to the dedicated one. Alternatively, if you want to debug the server, simply run your original exe as a dedicated server and connect using the duplicate exe.

Note that you don't have to run the duplicate exe as a dedicated server. You can run it as a full version of the client, but only if it's a debug build (unless you want to make the engine changes people have listed previously).