Hey Guys,
So new question. I have implemented a simple ZoneServer in C++ and I am curious as to how to go about handling my ONRPG player replication. So currently, what I do is this:
1) Create and bind a UDP socket to my desired port on the server
2) Wait for incoming data using recvfrom, and when it is received a new thread is created passing that information into it.
3) The thread determines the information within the packet, and if it is a request for a position update, determines the position and starts a new thread "replicate".
4) The replicate thread then replicates the new users position to all clients.
For those who are familiar with Unity, (which is what I am using for my client), I simply have a thread listening for packets and push them to a buffer, and in the main Update loop of my NetworkController I process ~4000 packets from the top of the queue at a time, and Lerp my remote players to their desired position.
The issue is, although there is no lag for the player, there becomes a lot of lag for the remote players on each client when over 3-4 people are connected on the server. Is there any way I can improve my server end?