Friday, 27 September 2013

Clarification on simulation engine for real time multiplayer network game

Clarification on simulation engine for real time multiplayer network game

I've been doing some reading about the various forms of multiplayer that
exist today. In a nut shell, I believe the industry standard way involves
the following:
Running the physics for each client on the client machine/device
Sending the input data of this physics to the server (could be another
client running a 'server' session along with their own client data)
Server processes this data to determine if the client is making legitimate
moves, and if not, forces the client to sync to it's instructions (Rubber
banding).
Server forwards historic data from other clients to each client for
simulation.
Effective result from each clients perspective, is playing themselves in
the present, while seeing the other clients in the past.
Hit detection is performed on the server by 'rewinding' the game state to
see if at the time stamp an event occurred, where the affected players
were at that point in time.
Presently, I use a pure dead-reckoning system. Inputs are collected from
each client and physics calculated on each client. This works, however
units quikcly get out of sync and rubber band because the dependency on a
players previous position/speed/orientation is not high enough. AKA: they
are free to change directions and speed quickly and often.
With that being said, how do I solve this?
Is my client simulator effectively supposed to collect several data points
for each player and interpolate the rendering between those nodes? (IE:
each client has multiple data points about all the other clients historic
positions).
As such, my client's simulator drawing player B, would have positions X0,
X1, X2, X3 in a queue at time 0. Between the transition of Time 0 -> Time
1, I know the starting relevant values (location, speed, orientation, etc)
and where he should be come Time 1.
Is the solution to interpolate these values between these known historic
times and data points?
Thanks!
Ryan

No comments:

Post a Comment