In game map editor help

So I’m making a super simple 4x style game where there’s a map made of various terrain types and Castles around the map. Players build units at controlled castles then take over new castles. Anyways, I was originally using Tiled and Tiled2Unity for my maps but realized I have to do a lot of manual game object placing for various game objects around the map. So I figured, since my actual terrain doesn’t have to be stored in a complicated way, maybe I could come up with an in game editor for terrain and placing the more complex objects.

The problem I’m having comes from the fact that the maps have the potential to be large, and I don’t want to make a gameobject for each tile, because that will have terrible performance.

I was thinking about making a grid overtop of a single game object which is the size of my entire map, and then when a tile is set to it’s terrain type, it sets a value in a 2D array, and that value is used to paint that grid section a certain color on the large game object?

I guess a better way to say it, is that based on the current terrain type in the editor, I’ll dynamically change the texture of the game object at the grid positions that were clicked on? Is something like that even possible? I don’t know if my problem is making sense, but it basically boils down to me wanting to make an ingame editor for a large map without resorting to each tile being a an individual game object.

Any feedback or help would be hugely appreciated.

Yes, you’re quite right — you need to make a dynamic mesh. This will be a bit challenging if you’re new to Unity or programming, but there are some great assets in the asset store that make it easy.

Thanks! That’s about what I thought. Although, I am new to Unity (been learning it since the start of this year), I am actually a pretty seasoned C# programmer. If I were to try to attempt this myself what would be some good resources?

In that case, start here, and if you prefer a more tutorial format, try this one.