Ask HN: What is the best way to handle latency in a simple multiplayer game?
I'm making a multiplayer game. I'm just about done. I've got the mechanics worked out, I just need to handle latency in some way.
The game: tron lightcycles, but to turn, the user must solve a math problem.
What I've tried:
1. Update game state for every player every time either player changes direction. Why didn't it work? Not the best way to handle it (also got that math wrong somewhere, and the undraw function would leave gaps in player trails)
2. Update game state for every player every 100ms. Why didn't it work? Player 1 and player 2 are running different instances of the class that is supposed to update game state, and I can't share the instance between the two
Stack: Python/Django, PostgreSQL, javscript/jqueryI need help. Can anyone help? Here [1], Ricky "Infil" Pusch explains the two more used methods to workaround lag in fighting games.
I'm not sure if this will be useful in your case, but it's a great read anyway. I'm not a gamer but really enjoyed reading it. I would first find out source of your latency problem. Unless you can diagnose the problem first, you can't fix it.