Sign in to follow this  
RuneSword2

synchronization

Recommended Posts

Now I'm trying to add network to my game. For now I've got a point to point UDP conection (The game is a Vs shooter). I've got this events: Move Forward, Move Backward, Left, Right, Shoot and Object Touch. And i've got 2 threads, the main thread computes the local data, the bullets trajectory and send the data every 50 ms. The second thread receive the data and computes the new position of the character add the bullets to the list or remove the objects when the opponent cath it. The problem with this model is when the ping is so long the local character is set to his position inmediatly but the remote has some idle time, In some cases the bullet hits the oponent on one side but not on the other. A posible solution is to update the local data only when you got the remote data but in this case i must compute first one event list (local or remote) and then the other, then the events could succed in different order that really made. Is there any other solution for this or should I change all the protocol?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this