Download

[TUTORIAL] Random Maze Generator

Today I’ve finally finished my latest tutorial on how to create a random maze generator in UE4. I go over the recursive backtrack algorithm as well as other things such as Static Mesh Instances and Random Streams (seeds).

You can find it on my blog with the link below.

Random Maze Generator Tutorial

Great job. Love that it’s in bp. :slight_smile:

Really cool add ! Thanks for the gift ^^

thank you very much

Very nice tutorial. But why is it an image? It’s difficult to read and understand.

While trying to follow the tutorial on page 8, I can’t find the “Set Integer (by ref)” node after dragging from the “Counter” pin. How do I get the “Set Integer (by ref)” node?

@vinnyvicious Right click on the image and open in a new tab. It’ll open it up at it’s full size which is 1240 x 1754. Should make it easier for you to see it. :slight_smile:

@Jeffmorris Make sure that the “Counter” input pin has “Pass-by-Reference” checked. If it’s not you wont find the pass by reference node when pulling from it.

I can’t see the middle “screenshot” on page 9. How can I get the “ReturnNode”?

Thank you jeffmorris for pointing out what is actually an error on my part. I’m not entirely sure how I got is as it’s inside a function which only needs one when you have output variables. You should be able to ignore that little bit and the function should still work.

Will you write a new version of the tutorial and save it as PDF file?

Hey, I made a PDF version of your tutorial so it is easier to read. Hope you enjoy!
Here you go: UE4Tutorial_Maze.pdf - Google Drive

hello i’m trying your tutorial, so far i’m in the page 11, but seems to be not working in some part, i think i have missed something in the page number 9, the picture is too big and i have tried to zoom it in many ways but still don’t see.

you say the “PickNearByTile” function have a return node, but i don’t see any output parameter in the function definition, also in 4.7.4 without a parameter in the output node of the function the function not have a return node.

i’m not receiving any errors, just the path tiles are outside of the maze boarder, the tiles began in the first tile, some of the tiles are inside and the most of then are outside.

any clue can be very usefull, what function or macro i need to check to fix this ?

thank in advance for all your help.

Hey,

I tried to do it but it just doesnt work… I didnt understand the last paragraph on page 11… i tried everything but just the borders are shown. I even downloaded UE4.6.1. Would mind sharing your project with me? There too less tuts on how to do it…

You missed something. Don’t worry, I’ve done that tutorial FOUR times in 3 different engine versions. The fourth time was a success, running 4.14 on the video linked below. I skipped something the other three times. Now it runs like a charm, go figure. I was thinking it was something wrong with the tutorial, but as you can see…

https://www.youtube.com/watch?v=42aLqq_3cYo

Super cool stuff! Thanks!

Amazing. Thank you dude. :smiley:

Thanks alot ! really !

Hey I have an Idea you might appreciate
Why not take this further and make a greeble type city generator For quick test maps

Me and a friend of mine is working on something similar. We, however, chose to write it all in c++, and we use the “hunt and kill” algorithm to constantly generate more. This allows for infinite sized mazes, but we are currently using the RB algorithm. Amazing work tough, and keep up the hard work! :smiley:

Anyone can send me the blueprint? Im stuck with mine. It just crashes after i set CurrentSide? Boolean to True.