I opt to create a 2D map, grid like. Square tiles - think Terraria.
Generic tiled map.
Quite possibly, there will be millions of tiles on one map.
Here comes the question: would it be doable to treat each tile as another object? I.E. there’d be a class “BlockTypeA”, and for each block of Type A on the map, the game would be instantiating that class.
Then object pooling and so on. I’m afraid that existence of such massive amount of objects would cause performance issues.
Other way I could think of would be making a two-dimensional array (1000+ cells in each direction) and storing map information there, however certainly the instantiate-block-class is handier.
What’s your opinion? Have you already done something like that? What a tile should be?
If the mesh is simple enough I would go with simply instantiating everything and see if you get enough performance, because that’s a simple way of doing it. Another option would be to store the information in some kind of texture and print it on the mesh, something like that. So basically you just got a few objects and render the correct texture on it (maybe via an atlas?)
The new improvements of 5.6 might also come handy here (from their blog):