Map Generation

Okay, my curiosity has peeked and the internet has thus far not been able to provide me an answer. I had a random thought process this morning going about starting my day and wondered if I could generate a map in Unreal Engine similar to the tilemaps seen on most mobile games. Think Lords Mobile and other knock-offs like Lord of the Rings conquest and so forth.

Basically, the map is made of tiles, and each tile represents a type of terrain. Typically, it’s scattered with no real cohesion to the generation (I assume ideally to make resources easier to acquire). Some good examples in the PC game world would be Fallen Enchantress, The Civilization Series, Galactic Civilization Series, etc. The latter two use Hex tiles rather than square tiles. But hopefully, that helps show what I am curiously interested in attempting.

Right now, I just want to try and generate a map and mess around with methods of generating said map. Would anyone have any advice on how one might go about that or have reference material I could indulge myself in? Ideas? Could it be done without coding? I would prefer to avoid coding if I could. Still very very new territory for me.

My first go at this was to set up an array. I used a construction script in a blueprint class to generate a map based on a set of parameters and a mesh array. I can control the size of the map and spacing quite easily, but the map itself still leaves a lot to be desired. My first problem is that any time I move the map in the editor, the map re-generates. I have not gone about setting anything up to prevent this as of yet. It doesn’t feel like it’s as important as addressing the more concerning dilemma.

That is how the map generates. I don’t mind the randomness too much, but I would like the map to be better structured. Take my previous examples. Some of them, (I think Fallen Enchantress does it best) will generate some very nice, well-structured maps. Random maps. Not picked from a pre-generated list. That would be something I would like to replicate or attempt to replicate.

My thought process was to use a value system. Give each tile a value and some kind of condition where the next adjacent tile would have a % chance to generate one of the others or a duplicate tile based on the previous tile. For example, say I start the map generation with a mountain tile (or gray tile). The next tile would start with say a 60% chance to generate the same tile, or a 10% chance to generate one of four other tiles. Then, for each duplicate tile, it does generate, the chance to continue that duplication drops until it is no longer generated.

Probably a little more complicated than it needs to be per se, but that was my best guess. Have not managed to get anything to work like that though.