We're making a web-based game using Phaser and SocketIO for real-time player interaction and synchronization of in-game objects (such as items and enemies with synchronized dynamic movement).

Here's the file in our Github

My current ideology for updating the clients is periodically sending all the necessary server-side data in an update packet (I keep it at 60 times a second now) and having the clients parse that packet every time it is sent. Things that need to be synchronized, like enemy position (and movement calculations), player positions, and items are kept on the server. I only know very rudimentary networking, but this system seemed to be working fine for a while. However, as my code got more complex, the server started running much slower, even when hosted by an app hosting website like Glitch.

Can anyone help analyze this and detect where the major slowdowns would be? Or alternatively suggest a better system for setting up the server? Any and all tips are appreciated.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.