I'm making a MMO Bullet Hell game on Game Maker Studio 2 with a node.js server and I'm already able to receive and send information through UDP connections. I NEED to keep the server as fast as possible on the response to avoid lag to players since on this genre lag means death in most of the cases.
My main problem is: I need to get the ping/ms of the clients on the server and other informations (such as player data) from the client to the server. I'm currently dividing the two, so i send a "ping/pong" packet from the server to the client to get the ping/ms and every time something inside the player data is modified on the client it sends the information to the server on a JSON.
Now to the question: Should I put all the data on a big JSON and send to the server constantly or should i keep my current model and send a packet to get the ms and other packets to send and receive data? Keep in mind that when my player is moving it'll send a bunch of data packets to the server whilst the ping function is running.
player = { _x: 0, _y:0, stats: { hp: 100 } }
\$\endgroup\$