Network implemetation

Discussion about the implementation of network multiplayer.

Useful Links

http://gafferongames.com/ This contains some very interesting articles on networked physics.

http://fabiensanglard.net/quake3/index.php

http://www.ra.is/unlagged/network.html#Q3NP

http://www.gameproducer.net/2006/12/16/planning-is-essential-in-writing-multiplayer-network-code/ The actual article appears to be using the 'client as dumb input/output terminal' approach, but it has a list of other articles that might be more useful.

http://sourceforge.net/projects/stun/ This project implements a simple STUN server and client on Windows, Linux, and Solaris. The STUN protocol (Simple Traversal of UDP through NATs) is described in the IETF RFC 3489, available at http://www.ietf.org/rfc/rfc3489.txt

Interpolation and rewinding

Due to the high latency that needs to be tolerated in WAN games (think of 100 msec) we have to interpolate the behaviour of karts and items in a race, otherwise the game will become too sluggish. This on the other hand means that we have to be able to roll back certain decisions. For example, locally you might have a collision between your kart and a remote kart (since the update that the remote kart has actually steered away hasn't arrived). But when you receive the update from the remote kart, you have to rewind the local simulation to a previous state, and re-simulate with the updated information that the remote kart is steering. This means to restore the state of bullet physics object saved from a previous time step.

[well, this is what I came up with so far, if someone can think of a better approach, please update the page]

Client/server vs. peer to peer

Gaffer's article on network physics contain a discussion of this (in the comment section). Short summary:

On the other hand it will reduce latency (two messages for client/server: client to server, then server to other clients).

Retrieved from "http://supertuxkart.sourceforge.net/Network_implemetation"

User Tools