

that divided outgoing messages from 25 to 2 or 3 messages when moving and 0! standing still. In the client I was sending 25 messages/ second to the server: I was sending data no mather if it was moving or if it was idle, but I thought that instead sending messages all the time I could only send data when a change was detected, for example: the client is idle, so the first time, it will send "/idle", but if it keeps standing still it wont keep sending "/idle", server will save the command until a new one arrives, so after a while I start to move forward, I send a "/acce" to the server first time, but again if I keep on moving forward it wont send again "/acce".When a clients exits the game it sends a "/quit" to the server, server will clean the players data and then it will send a "/kill" command to the clients so they will clean the exiting client.Īfter I made the server I saw two simple ways to improve performance: first one in the client second one in the server:
Rpg maker map x vs screenx update#
We will start moving around, when we move we will be sending "/acce", "/dece", "/righ" and "/left" to the server that will update our position in the map, if we don't move a "/idle" message will be sent, when the server updates our position it will mark if the client has changed state so it will send the command "/upda" with our updated x and y to the clients in a range (500px), so server wont send updates to clients that can't see our moves, that will limit too network traffic. So we have our server running, in our client we create a player and then connect to the server, then the client will wait until our server sends "/SUID" with the UID for our client, the UID wont change until we logoff, after receiving the UID our client will send our nick and image, that is how our "enemies" will see us, then we are ready to explore. /ping > Send a /ping request to calculate client latency./upda > Send non-player updates (X,Y,Nicknames.).

Rpg maker map x vs screenx code#
Most of the people (should) use serialization to send data, for example an item could be packed in an object / serialize it and send over the net, in the destination it would be deserialized and here we have our object/item again, but I have used another way to transfer messages that is hard to code but easier to understand: Plain-text messages. In the server we could haveĬomands to send the map, the clients data like player / npc position,etc. What we need is to create a way to communicate between server andĬlients will send commands to the server forĮxample: move forward, turn right, atack!.


Mmorpg, and just in the top of the network we have the messaging system.
