My framerate goes down to 20 fps after my game’s world creation, so I need to optimize it. Any suggestions are appreciated. I will now give a description of what I did so you know what optimizations are appropriate. My game is a grid-based city building game. The world consists of 9 different biomes (but no height variation, the world is completely flat), and I need to be able to interact with them separately because these biomes affect building efficiency. Therefore, each grid spot is currently a separate tile. I did not use tilemaps because I do not know how I would be able to get this sort of functionality with them, so each tile is currently a separate GameObject with separate colliders (but no physics module). Currently, I have a 100 X 100 tile map, for 10,000 total GameObjects. I would like my maps to be at least 250 x 250 tiles, but that just freezes Unity altogether to the point where I have no choice but to use task manager to forcefully close it. And there will be more game object later, as this game is still very early in development. The tiles only have a basic collider and an attached material for now, but later I will need to add 3D models to make them look more like the biomes they are meant to represent.
I am open to suggestions that either optimize the game objects themselves, or that reduce the number of GameObjects (as long as it doesn’t decrease the quality of the world generation). If needed, I could use the two heightmaps generated by my world generation algorithm to create a 2 dimensional array representing the biome tiles before disposing of those hieghtmaps, rather than relying on the tiles themselves to determine the biome, if there is some way to turn the ground into a single GameObject after the random generation.