I have an online game server that works as follows:
- Once a player connects, he is in one of predefined sessions (consider them physical location, e.g. Island, Underground location, etc.).
- Then any action (movement, attack) is always broadcasted to all other players in the same session. Also when he enters a session, all items dropped in that session are sent to him, as well as players who are there.
This is simple and easy but in the client, the concept of splitting the game into locations is ruining the experience of "one world", if you know what I mean. I am trying to figure out a way how to always broadcast/receive data only about objects that are close enough but I realize that iterating through all players/items everytime and comparing the distance would be a nonsense.
Is there any standard approach that I could use?