4 ms·
Build a Multiplayer (.io) Web Game with Node.js
- Etheryte 7y agoVery straightforward implementation and a breeze to follow, nicely done. One question though, why does the server send only every second update? Wouldn't it make sense to simply lower the server tick rate?
- vzhou842 7y agoThanks! Keeping the server's update loop at 60 / second makes the game simulation more accurate. Too low of an update rate can lead to missed collisions - for example, a bullet moving fast enough could pass right through a player in the time between updates. Of course, that can be easily resolved, but it proves the point that more server updates = more accurate simulation. On the flip side, we want to limit the number of updates we send to clients to keep bandwidth usage reasonable, so the server only sends updates 30 times / second.