Advertisement

Multiplayer in real-time game

Started by June 18, 2004 01:18 PM
2 comments, last by FireNet 20 years, 7 months ago
This is my first post on this forum, so hello all ;] Recently I've thinked about a multiplayer in real-time games - I've writed a simple OX game over tcp/ip but well, it's played in turns so it wasn't hard to create. I've searched over this forum for something about MP in real-time games, but I didn't found too many informations, so I've some questions: 1. It's better to detect collision between players and other things connected with players on the server, or it should only send and receive data ? 2. I've thinked about a system of sending and receiving informations by all players and I've invented something like this: - before updateing position, taking actions etc. send data to server with actions you proceed - wait for reply from server to check if data has been sent to all players [if it takes too long, disconate player] - update state of game - loop Am I on the good way? 3. Let's say that we have situation like that: Player A want to move and he send information to server about it, but in the same time player B shoots at him. Player A receive information, that player B is shooting to him - and what to do now, should it proceed first shoot or move ? After proceeding this actions should for example player B send to player A information that he was shooted, or both of them should indivudal update state of game without sending any informations? I would be also grateful if someone could write how works MP in fast action games like FPP or give some links to material about it. And of course big thanks for answers ;]
I will try to answer some of your question (no need to take my word for it) and they might be my opinions.


1.If you want to do collision detection on the server it is the easiest.But if it is turn based then collision detection can be done by the client and it can send updates to the server.Your choice as there will be no sync problems in a turn based game where you have time unlike an FPS.

2.I did not understand what you ment by disconnect player?Which one?Yes the system looks good in theory.

3.In a first person shooter the collision detection might be done on the server so handle which message came first shoot or move.If the player has move before the no need to kill him :-)

Btw,how much do you know about socket programming
______________________________________________________________________________________________________
[AirBash.com]
Advertisement
Quote:
Original post by FireNet
Btw,how much do you know about socket programming

Socket programming is easy. Network programming is hard.
Quote:
Original post by doho
Socket programming is easy. Network programming is hard.


Well you got to know the former before the later.The guy asked for links so I was not sure what to give.

Links:
1>the best place to look for links
http://www.google.com

2>Winsock Tutorials
http://www.hal-pc.org/~johnnie2/winsock.html
http://www.vijaymukhi.com/vmis/wsock.htm

3>Beej's Guide to Network Programming
http://www.ecst.csuchico.edu/~beej/guide/net/

4>Multi-Client Servers
http://xlock.hostcubix.com/cgi-bin/lwton.cgi?page=tutCpp

5>Non-Blocking Server (gamedev)
http://www.gamedev.net/reference/programming/features/nonblockserv/TutorialCode.zip

Helps Larax
______________________________________________________________________________________________________
[AirBash.com]

This topic is closed to new replies.

Advertisement