I'm trying my hand at creating a turn-based 4x game in Unity, with a galaxy map and 2D hexagon grid maps for each individual planet. The planet grid hexes would be gameobjects, with the overall grid being around 30x40 in size. The number of planets would be under 50.
What would be the best way to set this up? I'm looking for a solid approach regarding performance here, but one that also caters to easier design/programming would be a plus.
Some approaches I've come up with:
- Load all of the grids for the individual planets at the start into a single scene, with each being under a "planet gameobject", and then set those gameobjects to inactive. The galaxy map would be its own scene that is loaded additively when needed; clicking on a planet to view it would set its associated gameobject to active and then unload the galaxy map scene.
- Instantiate the gameobjects for planets as they're called up; the grid data for the planet is dynamically loaded as part of this. The planet gameobject is destroyed when no longer needed. Galaxy map would function the same as approach 1.
- Individual scenes for each planet, loaded/unloaded additively when needed. A separate, single scene would be used for loading procedurally generated planets.
- Seems to have serious challenges for managing units/resources across planets/scenes.
Approach 1 seems to be the most straightforward, as the core of the game would be managed in a single scene, but I am concerned about performance. I'm setting up some test projects to stress test the approaches, but it'd be great to get feedback from someone with more experience.
Any help is appreciated!