Thursday, November 28, 2019

architecture - In lockstep networking game, how to handle sudden lags and disconnection?


I am trying to implement a game similar to "Street Fighter" by using lockstep networking model so that two players can play remotely via Internet.


I have read a lot of articles about lockstep networking method and I can basically implement the turn/frame handling for each step.


My understanding is that if it's now turn 101 and if player A has not received turn 101 action (packet) from player B, player A has to wait.



When this situation happens, player B has to wait too because player A will not send out further actions to player B because he is waiting.


Should the game do anything for this situation? For example, I saw games like Starcraft, sometimes there is a dialog showing up to wait for other players and if the count down goes to 0, players can disconnect this hanging player.


In order to do so, I don't understand how to decide who is lagging and what the proper handling is. Both player A or player B would think the other party is lagging because he does not receive the packet for his current turn. What am I going to show to the user? And if the lagging continues, how to end the game earlier by giving a correct game result (the player who lags should be given a loss and the other player should be given a win)? Just similar to the countdown dialog in Starcraft.


And on the other hand, what if the situation is not lagging but is a disconnection from player B?




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...