Authoritative Server - MMO

Latency, Authoritative Server, Lag Compensation, Course Correction, Packet Drops and Client Side Prediction. These are things you would worry about when attempting to build a MMO game. For companies where the delay matters these logics are a must. This post is on setting up an Authoritative Server.

There are different ways of setting up the authoritative server. Some of them is mentioned here.

You have N clients and one client acts as the authoritative server:

Imagine N clients with different machine configurations. The server would need to decide the best possible machine and have the physics simulation run in that. We then have issues with client disconnecting in which case we need to swap the authoritative client to another machine. This means we have to maintain all the state the game was in and move it to the new authoritative client. In an online environment this is simple nothing but nonsense.

There is a dedicated server which simulates everything including physics and broadcasts the simulated data to N clients:

This is probably the most preferred and most accurate approach of all. However it demands a very robust and powerful server to run the simulation of several thousand clients in a MMO system. The clients send a key input data, the server does the simulation and returns the final simulated data to all. The client after sending the key input run a simulation of its own using some prediction until it receives data from the server upon which it course corrects as neccessary. Usually the server runs an instance of the game similar to the clients except that it is more powerful and capable of processing a lot of data.

There is a dedicated server with no physics. It simulates the data using simple or complex math and broadcasts the data to N clients:

This is the same as above with the only difference that there is no physics engine in the server. The server is just capable enough to simulate simple things. For example, the movement of a player on a spline, deciding when to stop or end the game, who the winner is etc. This is also a preferred system used by most MMO games today.

For games that cannot compensate on accuracy setup 2 would be ideal. You could have something similar to UnityPark3D that runs on the unity engine for example.  For games that need accuracy only on a certain mini-games setup 3 would do just fine. You could have such a setup using ElectroServer , SmartFoxServer or Photon.

Comments

Popular posts from this blog

Code dependencies