Today I noticed that I was only updating the network time when a packet is received, and I was not increasing it along with local delta time.
So I modified the class to increase time properly. In the picture you can see a good degree of synchronization between the clients.
I then noticed that while dragging windows around SDL freezes. I assume that only rendering and time calculations are affected, because when the game is resumed, it is clear that the game was still running underneath. The problem of this is that if the time is not incremented it is easy to end up with mathematical errors, and indeed the game was placing objects in a NaN position because of this. I added checks and now the game is robust against this problem.

Nessun commento:
Posta un commento