Imagine joining a room with 100 (moving) players and a lot of items and being assigned a random position in the room (read: agar.io).
At the moment I'm eager loading the other players and items and sending it to the player when he joined the room (and notifying other players about the new player) but I'm not sure if this is the best way to do this.
I was thinking about implementing lazy loading and only show players and items near the spawned player.
- How is such problem most commonly solved?
I was thinking about using a quadtree in order to find surrounding objects (or would a simple distance formula work)?