Ways to generate tiled map/grid data?

Axebeard
Thu, 18 Jan 2018 18:55:21 +0000
Blueprint

I’m trying to generate a large procedural world based on chunks. I have my chunks loading and unloading successfully (finally) and now I’m trying to generate the world as a whole. Before UE4, I used GameMaker for a bit and managed to pull off what I wanted, but I’m having trouble converting something similar into Blueprints.

I want to procedurally generate a grid, and have each space represent a terrain piece (0 = city, 1 = road, 2 = forest, 3 = border).

As an example:
333333333
300101003
311111003
300102003
300102203
300102223
333333333

After I have the this little dummy map generated, I would go through and spawn the terrain pieces according to the XY coordinates of each tile.

Each terrain type would have it’s own algorithm of course (roads = drunken walk, forest = cellular automata), cities are just the default tile type, but what would be the most efficient/ easiest way to get this to work in UE4? In GameMaker I created a simple 2d array, filled it with my default 0 tile, then iterated through for each other terrain element, but it doesn’t seem like there’s an easy way to do that here, or am I missing something?

Any help is much appreciated!

10 posts - 5 participants