Overview
On this page you'll find a short introduction into the concepts used in the examples to build the illusion of latency free realtime gaming and links to other resources.
Multiplayer Server and Client
You'll find these two examples in {EM}/exapmles/net/multiplayer/client and {EM}/exapmles/net/multiplayer/server. After you've compiled them, you may run them both locally on your machine, on two different machines in a LAN or even the Internet. They show the usage of the multiplayer framework and illustrate various problems and give sample solutions.
- Serverlist from masterserver: EM_SERVER_LOOKUP_SCENE implements the retrieval of a serverlist using a masterserver.
- LAN-broadcast server detection: If client and server are both located in the same LAN one can alternatively use LAN-broadcasts to detect servers.
- Interpolation/extrapolation: The decision to use UDP already solved a lot of issues concerning latency. But still games could be laggy if one has a bad connection. To avoid the concious perseption of lag we implemented an extrapolation technique based ond the lagrange polynomials.
- Client side only: The timenudge is the timeoffset between the server and the client. You can chose it from the interval of minus one second to plus one second in steps of milliseconds. The effect on the square is obvious: If it is too negative, the square will start to jump around due to misspredictions. If it is too far behind, the player always sees a world which is not accurate anymore. Normally you select a negative timenudge between 10 and 30 milisceonds for action games and a positive timenudge from 0 to 50 milisceonds for games where smooth gameplay is more important. However, this is not directly implemented in the framework! It's up to the programmer whether he implements a feature like that or not.
- Server side only: To estimate the effect of the net-fps value, which states how many times an update per second is sent, one can play around with this values and see how the intra- and extrapolation algorithms performs under various conditions.