Sign in to follow this  
jballaban

Client - Server Synchronization

Recommended Posts

jballaban    122
Okay so this is my first game so my game theory is still pretty amateur. I have built a client that currently: - instantiates a world with units/buildings as sprites with set frames - multiple objects can be selected and moved to a location - user can move their view through the world To this point the client is almost entirely living on its own (except for world instantiation, it gets objects/data from server). My next goal was to add in collision detection however this opened up the whole issue of synchronization. So I'm confused about this. For example, if Client C1 moves Unit U1 to position [X1,Y1]. Would the server then generate a path for the that unit to actually reach the destination? So for example, if there is a building in the way it may set a way point so the packet would actually be : C1:U1:[X2,Y2][X1,Y1] meaning that for Client C1, unit U1 would go to [X2,Y2] then when it reaches that change direction to [X1,Y1]. Now stop me here if I'm crazy but that's how I would see things working. However my problem is that if the client say adds a building in the path of [X2,Y2] - [X1,Y1] then the path is no longer valid. However since the collision detection is done on the server, it is possible (due to network latency) that the unit may actually traverse over the building before the client is notified that the pathof the unit has changed. This seems weird. Another weirdness is say C2 in this case thinks that U1 is going to [X2,Y2], but say half way C1 decides to move it to [X3,Y3]. Well C2 is still moving the unit along [X2,Y2] and when it gets it delta it will be out of position and all of a suddent the object will "dissapear" from the [X2,Y2] path and appear on the [X3,Y3] path. Seems jumpy to me also. I think the second situation may be unresolvable and just a part of network latency. However in an RTS (which I'm making) this behaviour could be very annoying to someone who is trying to strategize. Any suggestions / articles / yelling appreciated. Thanks

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