5 ms·
Very nicely done, congrats! I connected to a geographically far away server (US West, from Europe) and there's a bit of a delay between keypresses and movement
by ggambetta 6y ago
Very nicely done, congrats!
I connected to a geographically far away server (US West, from Europe) and there's a bit of a delay between keypresses and movement, and the movement of other units is somewhat choppy, I imagine due to network latency.
Have you thought of implementing client-side prediction and entity interpolation? Your game seems uniquely well-suited for these techniques, and if you made them part of the core engine, you might find yourself with an extremely popular product, since it's a complex feature to implement that everyone wants.
I've written at length about the topic here: https://gabrielgambetta.com/client-server-game-architecture.html https://gabrielgambetta.com/client-server-game-architecture.... If you go for it and you have questions or get stuck, I'll be happy to help :)
- tjchear 6y agoHow do you replicate something like UDP for web based games though?
- seangrogg 6y agoWebRTC datagrams could be used for this purpose, however it would likely add a lot of annoying complexity to the back end (dealing with STUN/TURN).
- ggambetta 6y agoWhat transport to use and whether to use CSP are somewhat orthogonal problems. It's probably best to use both if you can, but either will improve things by themselves.
- XCSme 6y agoThanks for the article! I think we used some of your resources when implementing the networking for https://curvefever.pro https://curvefever.pro I think the end-result is really good, almost no client-side input delay.