I'm currently planning to develop a real-time multiplayer online game, using the Google Maps API on Android. I thought about having survival-like game play, where you collect resources to build yourself up :)
The players should be able to build structures (houses, shelters, walls, etc.). There should also be random spawned objects, like trees or caverns. There will be many players in a multiplayer game, so there will be many of these objects. I thought about storing all of these objects in a server-based database. Every entity will get an ID and coordinates for their position.
Every player should be able to access and see those buildings, but I can't draw them all at once; I can't even calculate the distance for every structure or object - that just would make the game really slow. At some point, it would crash.
I need a way to manage, draw and calculate all of the structures and objects (which will be stored in my database), when the player is near their saved position. I googled a bit and asked some nice guys in the game development chat; they told me about some methods, like spatial mapping and quad trees. Those would be easy to implement, and the Google Maps API already supports quad trees with coordinates and latitude/longitude markers.
Is this the best way to achieve what I want, or is there a better way to manage, draw and calculate thousands of objects?