Game Development Community

Can i run two or more game servers on one computer?

by zbh · in Torque Game Builder · 09/06/2006 (1:57 am) · 5 replies

I worked with tgb 1.0.0, and t2d 1.1.0

basicly, i want to start more than one game server instance on one computer(windows or linux), i think this is important for devolopment, debug, etc. i think tgb can use difference pref files to do this. but seems i was wrong.

in last few days, i read all about tgb's script files. (i made a note with mindmanager, if anyone else need it, i will post it.) i search and read some threads in gg.com, and there still are some problems:

1. it seems tgb's command line argument "-prefs" doesn't work. tgb do exec("pref") in common package onStart() function, but the function parseArgs() do earlyer than load prefs, so common package always override -pref option.

2. can i just run tgb with no gui on windows? i know $server::dedicated, and i can compile a DEDICATED release on linux(haven't test it). is there a way to do this with no gui calls?

3. for a new project in tgb, it's difficult to redefine parseArgs() for new command line arguments, i can't define some package to redefine parseArgs(), i must create new mod, and load it. if i was wrong, please point me.

4. what's the $pref::Server::port mean? i found function createServer() use $pref::net::port to bind and listen.

#1
09/08/2006 (12:21 am)
Does anyone know about running multiple game server with multiple tgb instance on one computer?
or tgb just can't do this?
#2
12/07/2006 (5:12 pm)
I'm not sure if this is possible but you probably would have to have two separate copies of your server directory to get this to work. You will need debug builds to be able to run two instances on one machine. I would change the server ports for one so they dont conflict when accepting client connections. Then for the client(s) you would need to change the port that it connects to on the server. I dont know if this is possible but this is the first thing I would try.
#3
12/10/2006 (5:51 pm)
I believe there is code in TGB to prevent two instances running. If you copy your exe (and other stuff) to a different directory and rename the exe, it "should" work.

I've done it a few times on my Mac, just as I've described.

Please do keep in mind that both instances will be competing for 100% of your processor. Thus, each one will be very sluggish (I think even in dedicated mode - it still wants all the timeslices).
#4
12/10/2006 (6:17 pm)
Its not possible to run two instances of the release exe but you can with a debug exe build.
#5
12/31/2006 (6:56 am)
To revive this thread... with TGE it is possible if you compile / run it as dedicated.. isn't this possible with TGB aswell if you complain the code bases and make changes? I have to try this after the exam wave because I am going to make a multiplayer project.