Tile Based Procedural Generation?

I have been trying to make a tile based procedural generation system for a while now, but have been struggling with how to make it. I started by creating this diagram:


My idea is to create individual square tiles that each can can contain their own navmeshes, lighting, and other things. They each have anywhere from 1-4 entrance/exits, which are placed next to each other. I first started by following the UE4 created tutorial, but I faced problems with dead ends and was unsure how to implement a pathfinding algorithm or such. My most recent attempt consisted of blueprint tiles with arrows, which I spawned in with a manager. However, I struggled with looping through for each of the tiles and restricting the amount of rooms. I am completely lost on how to do this, so any help is appreciated. Thank you!

I have done this sort of thing with a self generating maze.

Although, you really have to come up with your own system, because you know what matters, what I would recommend, is not having a tile manager :slight_smile:

The problem with a central controller, is you have to fall back on the ‘old’ procedural way of programming, which means all the code in one place and lots of complication. What is much better ( IMHO ), is letting the tiles spawn other tiles as you approach them. This is much more ‘object orientated’ as easier to build and maintain.

You don’t have to worry about having too many tiles, because they can destroy themselves when the player reaches a certain distance etc.

Here’s a link to the demo vid of my game. Both the maze that you can see here, and the puzzle with stone tiles constructing ‘in the air’ use this ‘the tiles are in control’ method:

4 Likes

I did at one point create a system like that using level streaming, except that does not fit my needs. I am trying to create more of a building and less of an infinite maze. The idea is similar to a game of Carcassonne where certain tiles each have certain points in which they can connect, and at the end of generation, there is a full area that is filled with a certain amount of tiles that properly connect. Thank you for your comment though!

1 Like

Very cool concept “letting the tiles spawn other tiles as you approach them”

2 Likes