Game Development Community

Multiple instances of game running

by Shaz · in Torque Game Builder · 09/19/2008 (7:07 pm) · 5 replies

Uh-oh! One of my testers just discovered that my game can be opened in multiple windows at the same time!

While cute, this is very bad, as one game could overwrite all the player progress, high scores, game options and level layouts that had been created in the other game.

Is there a way to tell (in script) if the game is already running, and just exit?

#1
09/19/2008 (7:46 pm)
I think allowing only one instance is the default behavior for a release build, although a debug build can have multiple instances. Was your tester running a debug build? Or this could have changed at some point...
#2
09/19/2008 (8:29 pm)
I did ask about the difference between a debug build and a release build, pointing out that I could call up the console, and the response I got was to disable the actionkey for the console. So there's about a 100% chance that they're running a debug build. ;)

If you can tell me how to make it do a "release" build, I'll give it a go. Again, I'm using Torsion and TGB editor, not delving into the C++ code. I don't see any option in either of those to distinguish between a type of build.
#3
09/19/2008 (10:04 pm)
Debug/Release refer to visual studio "build configuration" settings. But if you have never previously opened VS and done a debug build, then how could they be running one?? Unless TGB installs with both a release and debug exe these days I guess.
#4
09/19/2008 (11:12 pm)
Would it depend on whether I have the basic version, without source, or the pro version?
#5
09/20/2008 (12:24 am)
Without the source you would have nothing to open in VS nor anything to build as release/debug/anything-else.

Chances are if your exe does not have _DEBUG in the name then its not a debug exe. If you don't even have one of those, thats fine, it just means that TGB is allowing multiple instances to run in release these days. Unfortunately I don't know how to fix that.