Maze generation
Hello, everyone.
Last two weeks we were busy developing main feature of our small game -- maze generation. Task was pretty simple: generate random mazes with several rules and full it with specific node types (security, core, vulnerability etc.) based on their position in maze.
We thought that unity could help us with this kind of generation and it was a mistake. Luckily, there're a lot of mathematicians in gamedev world. Thanks to https://www.redblobgames.com/grids/hexagons/ we found all needed info for hexagonal grid calculations. Based on this we create a model for hexes and simple class for nodes to make sure they will always attach to proper position on screen.
Next part was a bit of challenge. All maze algorithms based on square grids and we use hexagonal one. Spending day on researching all possibilities we chose Prim's algorithm, but this was only a first step. We still needs to place nodes based on some rules, for instance, core node (level objective) should always be placed in `maxSteps-2` maze node and security nodes should block some other nodes and so on. Here we use Breadth-first search algorithm, which allows us fill our maze with nodes within two bypasses, which was great and fast.
It was interesting and extremely productive sprint for us. And here're some screenshots of generation results.
Big thanks to my friend @inca (https://github.com/inca) for help with this task and tons of consultations.
Hope your weeks were great as well, guys.
See you in next post ^_^/
Get Entry point
Entry point
A story about hacker who was hired by his online-mate for a simple job.
Status | Released |
Author | Hamster's Cave |
Genre | Puzzle |
Tags | cyber, hackers, hex-puzzle, rogue-lite, story |
More posts
- AnalyticsFeb 19, 2020
- 3 month laterJan 27, 2020
- iOS release is hereOct 28, 2019
- Update 1.1.1Oct 27, 2019
- Blind Nullifier and version 1.0.15Oct 18, 2019
- FeedbackOct 16, 2019
- EffectsOct 09, 2019
- It's release time!Sep 29, 2019
- Windows buildSep 25, 2019
- Mac OS buildSep 24, 2019
Leave a comment
Log in with itch.io to leave a comment.