I have high experience In Java and Networking. Our team have built a effective server that can create thread-pools managing many players. But we have hit a brick-wall. The way our server works is that our clients directly all just connect to the server. The client sends information to the server. For example, Client 004 pressed W. And the server calculates and responds. But here's the problem. What exactly do we send over the data stream? Do we send strings and decode them on the client/server side, or serialize objects? Sadly that question is very opinion based. So let me re-phrase it. What data do we send over the stream? For example, you can use W,A,S,D To move around. Im guessing it should look like this.
User Pressed W > Client sends string saying w to server > Server calculates movement > Server sends string saying player position to player > User updates players position.
But then we have to render other players. So we thought about this
User MPressed W > Client sends string saying W to server > Server calculates movement > Server checks if any others players are in the area > Server saves data of all players and yourself into a string and adds positions and sends to client.
Fair enough. But imagine if the server had to send over information, like the other players clothing, their health, mana, position, current animated frame.
The string might look like this:
"Bob, 12, 321, 391.34, 2914.2, Left, 0, False, null, null, sword, null, null"
Just for one player! To be sent over. The string concept is becoming long and tedious.
I have re-wrote this several times. And I still do find it confusing to understand the question myself.
But to shorten it down. How do I create a system where its a mmo really.
We've created the server, client art. We've payed for a large server with ddos protection. But we don't know what to send over the sockets.