Best way to generate Darkest Dungeon style map

I’m not asking about umg or 2d. I want to know what’s the best way to generate randomization similar to this using blueprints (3up, 2left, 1 right etc)?

now as a disclaimer ive never played the game mentioned but i have created procedural dungeons.

just based on the image provided it should be a relatively simple task. to begin you would need to create and place the rooms. for this you could simply get a random point in range for each room and set the room to that point, simple. the next part is a little more tricky, creating the pathways. for this you are going to want to implement a spanning tree. this is basically a way to ensure that every room connects to at least one other room, you can also add in different criteria to affect how the paths are created. ok so at this point the rooms are created & placed, and the spanning tree will tell you to connect room a to b. to create the path you just need to know where to place the path tiles and we can do that with some simple math. lets say you have a room at 0x 0y and another at 1x 3y. lets make a arbitrary choice to begin with moving toward X. ok so for this example we need to move 1 space to the right and 3 spaces up. we just need to break that down into steps, this can be done with a for loop. we run the X loop once and we take room ones location and add 1 to x for each loop iteration and place a tile resulting in 1x 0y place a tile. next we run a loop for the Y value, we begin where w left off at 1x 0y and do the same looping but adding to Y. result would be run loop 3 times (1x 1y, place tile) (1x 2y place tile) (1x 3y place tile). the math there is actually a little off since you would need to remove the last tile since it overlaps the room.

thats the basics and some of the concepts are covered in the procedural generation stream on the unreal engine youtube channel.

heres a extremely hastily put together example of a simple dungeon generator.

as you can see the create rooms event gets random locations and spawns room actors. the create paths event takes each room, finds the closest room to it, then runs loops as described above to get locations and spawns path actors.

First of all, I really really appreciate this answer. It’s amazing and exactly what I wanted to know.

Only one problem though: I put 0 on Room blocks to tell them apart from Paths. Some paths spawn on top of the rooms.

thats one of the things i mentioned in the first post: “the math there is actually a little off since you would need to remove the last tile since it overlaps the room”. it should be as simple as adding in a check to see if its the last index, then the check would prevent the script from spawning the last tile. or you could decrement the number of loops before spawning any tiles. theres many ways to accomplish the same thing.