I have a platform type game, and i’ve been trying to get multiplayer working. I succeeded, BUT, the client doesnt update fast enough so everyone just teleports as they move, even on a LAN.
What i am doing is:
Client:
Thread 1:
- gathers players pos (thats all at the moment, i would hope to add more, but its too slow as it is)
- Stores values in Object array, serializes, and sends
Thread 2:
- handles game
Server:
Thread 1:
- Waits for players to connect
- Starts new Thread to handle client
Thread 2:
- reads players data, deserializes data, stores player(X’s) data into static array full of everyone elses data so it can be serialized and shipped off.
I was reading through the forums, and someone mentioned that sending objects is slow, so that might be the reason. But if i cant send objects how am i to send data for say 8 players to the client?