Multiple players on one PC
by Jari · in Torque Game Engine · 11/25/2005 (7:17 am) · 10 replies
Hi, I have been thinking what it takes to enable multiplayer on one computer.
I think only one connection to server is needed but two viewports and of course controls for both players (talking about two player game now)
What do you think, would this be bossible without heavy engine code changes? And what am I missing?
Thanks.
I think only one connection to server is needed but two viewports and of course controls for both players (talking about two player game now)
What do you think, would this be bossible without heavy engine code changes? And what am I missing?
Thanks.
#2
11/25/2005 (6:17 pm)
Don't forget to google for this, it's been discussed many times before.
#3
From what I've read, I had the right idea... but I still have no idea on how to split the game to 2 clients and a server on the same computer... if there isn't a better way to do it.
GUI viewport resource...
As for the rest... well, I'm not quite certain how to go about it :/
11/25/2005 (7:29 pm)
Http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2261From what I've read, I had the right idea... but I still have no idea on how to split the game to 2 clients and a server on the same computer... if there isn't a better way to do it.
GUI viewport resource...
As for the rest... well, I'm not quite certain how to go about it :/
#4
I don't know why should I use the guiviewport instead of two GameTSCtrls though.
Well I'll try to google for the info.
11/25/2005 (11:50 pm)
Thanks for the feedback. I don't know why should I use the guiviewport instead of two GameTSCtrls though.
Well I'll try to google for the info.
#5
In this thread http://www.garagegames.com/mg/forums/result.thread.php?qt=25534 multible connections is the used solution but that seems to be perhaps a bit too much to implement.
11/26/2005 (12:27 am)
Well I got two viewports using the GameTSCtrl class but now I need two control objects...In this thread http://www.garagegames.com/mg/forums/result.thread.php?qt=25534 multible connections is the used solution but that seems to be perhaps a bit too much to implement.
#6
You could double up the number of console variables used for building a move, one set for each control object, and build separated moves for each control object.
Then get a GameTSCtrl for each control object.
11/26/2005 (5:41 am)
Maybe you could make a single connection have two (or more) control objects?You could double up the number of console variables used for building a move, one set for each control object, and build separated moves for each control object.
Then get a GameTSCtrl for each control object.
#7
If that's what it takes it's not that bad, I could do it. But i still don't know how the control objects should be set.
12/07/2005 (6:08 am)
Thanks for the reply Mangel. If that's what it takes it's not that bad, I could do it. But i still don't know how the control objects should be set.
#8
I'd test if the concept works, by declaring some sort of mControlObject2, adding a new console method to set it, and include it in the required places in gameConnection.cc and gameProcess.cc (more importantly, the places where it calls interpolateTick, writePacket and processTick, to make it update). Start passing it the same move object as the main control object, just to see if it's moving when you press keys.
If nothing explodes and no conflitcs arise by having two objects call the writePacket method, you could move into doind proper, clenaer code for supporting multiple control objects, and to generate different move objects for each one.
12/08/2005 (6:18 am)
Well, a way to start is go into game/gameConnection.cc (where the control object is handled), and game/gameProcess.cc (where the move is handled down to the control object) and look for all places where the connection's control object is used. I'd test if the concept works, by declaring some sort of mControlObject2, adding a new console method to set it, and include it in the required places in gameConnection.cc and gameProcess.cc (more importantly, the places where it calls interpolateTick, writePacket and processTick, to make it update). Start passing it the same move object as the main control object, just to see if it's moving when you press keys.
If nothing explodes and no conflitcs arise by having two objects call the writePacket method, you could move into doind proper, clenaer code for supporting multiple control objects, and to generate different move objects for each one.
#9
I will be VERY interested in any developments in this area. One of my goals is multiple players on one machine that can take part in a networked game. I am thinking of starting with two players on the machine. If you need debugging help, testing, etc. Let me know.
01/01/2006 (3:42 pm)
Manoel,I will be VERY interested in any developments in this area. One of my goals is multiple players on one machine that can take part in a networked game. I am thinking of starting with two players on the machine. If you need debugging help, testing, etc. Let me know.
#10
01/01/2006 (5:47 pm)
Have you guys tracked Phil Carlisle's recent thread on this topic?
Torque Owner Jonathan Rose
I'm saying this as a total amateur though :P