Reputation: 67
I've been pecking away creating a multiplayer game where I used python for the server (with Twisted Framework) and javascript for the frontend (web game).
I'm a bit stumped at how I can start players in tine with others. For example, the server sends the players a new map, which starts a countdown from 3, then they can race to the finish.
The issue is if someone has poor latency and another doesn't, the better connection would give them a head start, which is unfair.
I'm stumped as to how to at the very least limit this. What measures can I take or look into? I don't believe I can rely on ping time as that will fluctuate quite often.
Upvotes: 0
Views: 901
Reputation: 15871
Usually, when developing multiplayer features, the engine that run the game run both on clients and server.
When the server receive client data (along with their game clock) the state of the clients game prediction is reconciled with the server's one (the only source of truth).
You can find a very interesting introduction article about the topic here.
Notice also that some protocols, like UDP, are by far more suitable than other for multiplayer realtime data exchange.
Upvotes: 1