Intro: So, I just randomly decided the other day that I wanted to make a maze generator. After a few days and sleepless nights, I have completed it at least to a presentable phase. Now, I may decide to make an asset out of it, so I am posting it here to see if enough people are interested in HEMGen to spend the time to make it better. And without further ado, I will move on to the features.
Features (Currently completed):
- 1-Dimensional Maze Generation! Perfect for procedurally generating corridors! If you want to make a game like Final Corridor XIII, this is the perfect way to do it! (Note: I am not affliliated with Square Enix and whatever other legal stuff people usually say…)
- 2-Dimensional Maze Generation! Perfect for normal procedural mazes. The size of the mazes is only limited by processing power. Further down this page I will tell exactly how fast the program is able to run.
- 3-Dimensional Maze Generation! For intense puzzle games. Just try to generate a 6x6x6 maze and try not to get confused with all the backtracking you will have to do!
- Amazingly fast! It’s not call “Highly Efficient” for no reason.
- Use your own prefabs for corridors and rooms.
- Custom maze sizes! Just in case you didn’t divine this from the previous features.
- Custom material support. It’s just there. I don’t really see a use for it because of custom prefabs, but its there!
- Different start and end rooms. Want a boss fight in the final room? Well, make it different! Want the start room to be a safehouse? Why not?
And now for future additions! If I decide to further flesh out this asset, I will probably add these.
Features (WIP):
- Variable room sizes. For even more customization!
- Add loops to the maze. Right now, the maze is a “perfect” maze, which means no loops, no open areas, and no inaccessible places.
- Save mazes that you like for future use
- If I add saving, I should probably add loading…
- Custom end points (Start points aren’t supported by the current algorithm, so further algorithms will allow for custom start points)
- Add randomly generated special rooms. Safehouses, minibosses, etc.
- More maze algorithm types! Currently uses one type of algorithm. It will soon allow the user to choose between multiple.
- More efficiency. For the purpose of more efficienct, I will make it more efficient.
- 0-D Maze Generation! Add an empty GameObject to a screen using a procedural maze algorithm!
- Whatever else people want! I’m open to any suggestions as to how to improve this product.
And now for what most of you probably came here for, efficiency ratings!
Efficiency (I just clicked the run button and recorded the time with Time.realtimesincestartup or something like that. No multiple testings. I’m running it while I have Paint and Firefox open in the background about 4 hours since the laptop was first booted. Running with an Intel i7 with 16G of RAM and an NVidia GT650M):
By the way, this time includes both time taken to generate the maze as well as instantiate the meshes seen in the screenshots below. All the cubes and rectangles have box colliders added to them, which should theoretically increase the amount of time taken to run.
2D
- 1x1: .0239s
- 3x3: .0271s
- 5x5: .0298s
- 10x10: .0426s
- 20x20: .0783s
- 50x50: .3401s
- 100x100: 1.331s
- 250x250 (Without colliders): 4.592s
- 1000x1000 (Obviously without colliders): Crash due to out of memory error

250x250 gets too much logspam because the number of colliders is too large. Anyways, 100x100 is ten-thousand cells, so I have no idea why you would want it that high in the first place.
3D
- 1x1x1: .0309s
- 2x2x2: .0310s
- 3x3x3: .0313s
- 5x5x5: .0428s
- 8x8x8: .0940s
- 10x10x10: .1533s
- 15x15x15: .4566s
- 20x20x20: 1.059s
I’d hope nobody would ever have to use more than that for a 3D maze. 5x5x5 is challenging to solve and 8x8x8 is pretty much impossible. Anyways, I tried a 50x50x50 with colliders and had it take about 175s because of the logspam from having too many colliders on screen. I’d have to create a non-stacked algorithm for maze generation if I wanted one that crashed Unity.
As for a WebPlayer Demo, I don’t think I will add one for now, but you can at least get screenshots.
Screenshots:
I was lazy so I didn’t add any special effects or fancies. I also just used cubes for cells and rectangular prisms for connectors. Remember, don’t travel between the lines, travel on the lines.
3D
5x5x5
10x10x10
3x3x3
2D - Note, these are actually 3D objects, but I used an Orthographic camera to have it 2D so you can solve the maze if you want to.
10x10
20x10 (Non-Square Mazes)
Final Notes: If you are an expert advanced programmer, chances are you probably don’t need this package unless you REALLY care about the super-fast generation. If you have no idea how to program, however, this package is for you. Price as it is right now would be around $10. However, as I add more features, the price will grow rapidly, but if you buy it now, you get upgrades forever and ever.
N.B.: Pardon my English. I’m from Texas. ![]()




