Decrease ping
ZynoXelek opened this issue · comments
Initial Goal : Reduce player ping to make the game fluider.
First Idea : Using a UDP Connection, the game should be fluider.
Yet, the UDP connection also brought a lot of instabilities because of the DDOS some clients may inflict on the server.
Main objective : reduce ping while not making the game feel laggy.
Two ideas :
- Reduce communications frequency, and keep last input from the player in memory to assume this input for around 3 to 5 movements. May reduce the feeling of fluidity for players tho.
- Only send inputs when the player actually changes inputs. To be sure the new input is correctly received, we could add :
- a 'fake TCP' to verify the new input has been taken into account.
- We can also send a rack of messages containing the new input to try to improve the chances that the message will be correctly received.
- We can additionnaly implement a 'safety sending' of the actual input every X loops to be sure it is correctly taken into account.
- Combining all this changes should allow the server to receive way less messages from clients. Impact on the feeling of fluidity yet to be determined.