Hello, just some questions on how to handle updating data between players. More of a design and implementation question.
When it comes to keeping track of players near each other, In my game, I only want characters in a certain range to be shown, as such the server only sends data to other players in X range around the player.
Right now, the server stores who we've sent player data to so we don't keep sending the full player state constantly (after the full player state, I just send position updates). But I'm running into problems with people going out of range, having their states changed, then moving back into view and the out of view clients obviously don't know (since the player state changed out of view). I figured the solution might be to delete the reference to the known player from the other player, so when it goes out of view so it refreshes. However, if someone is just moving in and out of view I don't want it sending full states constantly. It's been suggested to use a timer, so that once it goes out of view it has say, 1 minute before you delete the fact the other players know about you. Which is a good idea, but I'm getting wary of the server handling things like this that seem like it belongs in the client operation? I am not sure how other games handle this interaction.
What is the best way to go about this? Should the server be keeping track of which player knows about your player data and handling timeouts and view distances? I've also read some people have the client request data from the server. Example: You get movement data from a character that doesn't exist, so the client asks the server for info on this player. However, that starts having problems of queuing the initial request, waiting for the server to get the state data and send it back, then playing all of the queued up commands meant for that player when we create it.. Of course I'm not sure if that's correct as well. I guess I just need guidance on proper setup when it comes to this.
Thanks.