Four player udp game, experiences wanted :)

BlitzMax Forums/BlitzMax Programming/Four player udp game, experiences wanted :)


I do want to allow players with semi-poor connections/latency to play as well, but that's just a matter of upping the keyframe limit I suppose.



Sounds like you got the basic idea. the keyframe can directly correlate with the amount of lag you allow. Basically, each frame your computer counts. the network is updated, and any games too far behind are waited for. after a very small period of time they all synchronise and things speed up.

You can chose to wait for the lagging players frame to catch up, or kick them if they are "repeat offenders". it really depends on the type of game. This is just a technique I tested in a tech demo and I was amazed at how well things worked :)


basically:

Client 1 reaches frame 60, but Client 2 has reached only 57, and the "keyframes" is set to 3, then client 1 will wait for client two to get within 3 frames.

If you know the player has a high latency you can compensate by making increasing keyframe.