Game Development Community

Running 2 TGE applications together

by Rizzen · in Torque Game Engine · 07/08/2005 (7:46 am) · 6 replies

Is there a way to run two TGE applications at the same time on the single PC, and one may or may not be a TGE application server?

I was told how to have each application have it's own DSO working root directory.

I am using Suse 9.3, which results in the following error when I want to run another application at the same time, that is a different product, not game module:

Couldn't lock file: /tmp/TorqueTest.lock, Resource temporarily unavailable
Lock owned by pid: 12477
Remove the file if lock is stale
% Exiting

Seeing that this is a lock, is it safe to give each application it's own named lock without causing the system to become unstable?

#1
07/08/2005 (10:11 am)
You could give each application its own lock, but they still might collide on the output directory, since on unix all torque apps store output dsos in ~/.garagegames/torqueDemo by default.

So if you change the lock name for one of the applications you should also change the default output directory. The path is defined in one of the header files, can't remember which one (maybe platformX86UNIX.h)

On linux, You can also run the executable with -nohomedir. it will then write its output files out to the executable working directory in the same way as windows.

You can also recompile with the NO_FILE_REDIRECT flag (see conf.UNIX.mk) to permanently turn off file redirection to the home directory.

If the lock stuff is really bothering you, you can comment out the call to platform::excludeOtherInstances, which happens when canvas is created I think.

Other than the files colliding, there shouldn't be any issues with two Torque apps running at same time. Your opengl driver might prevent you from having two application windows open. But if so, it sucks.
#2
07/08/2005 (11:31 am)
I commented out the content of platform::excludeOtherInstances in the ~/TGE/engine/platformX86UNIX/x86UNIXWindow.cc, yet still produce the lock file error when starting the 2nd application.

...
--------- Initializing Client ---------
Loading compiled script common/client/ui/customProfiles.cs.
Loading compiled script common/client/message.cs.
Loading compiled script common/client/mission.cs.
Loading compiled script common/client/missionDownload.cs.
Loading compiled script common/client/actionMap.cs.
Loading compiled script common/editor/editor.cs.
Loading compiled script common/editor/particleEditor.cs.
Loading compiled script common/client/scriptDoc.cs.
Couldn't lock file: /tmp/TorqueTest.lock, Resource temporarily unavailable
Lock owned by pid: 20730
Remove the file if lock is stale
% Exiting
#3
07/08/2005 (1:12 pm)
For debugging purposes I often run two instances of my TGE game on my computer. In visual studio I compile both the release and debug builds, run the debug within the ide, and run the release normally.

The only files that collide (in my experience) are the .DLL files, but the release and debug builds use their own versions. Aside from compiling both builds, I don't make any other changes.

Without being able to run two instances, I would have gone insane trying to debug client/server code ages ago. I'm not sure if this was the same problem you were having, though.
#4
07/08/2005 (9:58 pm)
This will work for the developer, who has the source code to be able to run 1 TGE application in debug mode of the C++ IDE and the other normally.

For the End-User needs to be able to have 2 or more TGE applications (not just clients of the same application, but two or more applications that make use of TGE) running together at once. Even though TGE is designed for gaming purposes it also does have other uses, particular for walk/fly around design models, etc.

The DSO working directories for the applications is already solved, just need to resolve the file lock issue. Still looking for this lock.
#5
07/08/2005 (10:47 pm)
Don't bother it's a waste, just make 2 seperate binaries, your using SuSE, so look at my post here
Create each binary with it's own output directory and name them seperately, this will give you the most flexibility and probably the most ease of use in debugging.
#6
07/09/2005 (8:53 am)
Yep, done that and it works well in allowing to have different clients for an application.

Only problem I having now is that I can't run 2 or more TGE applications at the same time, due to file locking error mentioned above.