Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by etopsirhc · Jul 01, 2015 at 10:29 AM · generatorblocksmaze

2D or 3D non-"perfect" maze generator

summery:
I'm looking for any kind of documentation on how to make a 2d or 3d maze in a specific style. in particular i'm looking for paths that can be wider than 1 block, areas that can loop, and parts of a floor that are isolated from everything but the the layer above or below.

details:
i'm trying to auto generate a maze.

the maze setup is in a style where their is either a wall or an open space, both of witch take up the same amount of space.

the paths should be able to have loops.

their should be sections of the maze that are cut-off and must be accessed from another floor or teleporter.

the block maze should be able to have even number halls as well as odd.

pitfalls i've found in my searches:
block based generators build everything in odd numbers. seem to always start like this and just break out the single connecting wall between them.

alt text

They never seem to have loops in the path.

They never seem to have wide halls.

many only make a single path then fill the rest of the area with tiny dead ends that are too obvious.

this is about as close as i've found info on generating, but it's done in such a way that makes even hall lengths impossible while using that as a base of any kind.

alt text

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by AlwaysSunny · Jul 01, 2015 at 02:06 PM

Cool question. After weeks of tedious work, I'm jealous of the problem. I mustn't be so easily distracted as to really dig into it, but still. ;)

Because so many of your requirements are unique apart from the quintessential maze generator solution(s), I'd suggest taking several steps back instead of trying to bend this approach to fit. Your ultimate approach may be very similar to classic generators, but it's worth investigating a nontraditional method if only for ideas.

The biggest, scariest part of a made-to-order solution is the desired aesthetic. Decide this first, then imagine ways in which an algorithm could hand it to you. One thing that comes to mind involves a high degree of randomness, and a-star. You could build something that qualifies as a maze by carving into (walking through) an array of unwalkable cells in a heavily randomized but clever fashion. The clever part would be maintaining your desired aesthetic by examining both the surrounding cells near the walker/cursor and the overall path traversed on a macro scale, prior to making direction change decisions. The first ensures little or no rule-breaking e.g. loops, while the later focuses on area coverage and creating interesting shapes.

You could get wide halls by changing the shape of the walker cursor. (Multiple layers of these walkability maps could even be blended together, and/or you can "brush" shapes into the map to achieve certain aesthetic goals.) A-star will help ensure at least one valid path to the exit exists. Once you establish one respectably convoluted path to the exit, the rest of the generation process could be area-filling with useless distraction routes. You could a-star check after each space-filling edit, and if the shortest path to the exit is significantly shortened, reject the latest change to maintain a desired difficulty level.

Getting multiple floors that connect in multiple places is essentially a 3-dimensional array. So make your array and algorithm work in 3 dimensions. (4, aka teleporters, starts getting really weird, but could work on the same principles if you introduce teleportation routes as meta information on your cells.) The cursor should get some setting that strongly prefers X, Y travel over Z / teleportation travel.

Also worth mentioning, don't forget about user fun. Unless the game's selling point is all about solving infuriating mazes, it's worth considering just how frustrated you want your users to be. The difficulty can be dialed in using the same variables this suggested outline would use anyway, if you plan for that ahead of time.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dave-Carlile · Jul 01, 2015 at 02:32 PM 0
Share

You might also search through information about generating rogue-like dungeons. There is a lot of information about that topic and many techniques for generating good random dungeons that you can probably adapt to your needs.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Block world Generator 0 Answers

Generating blocks with bad distance of each other. 0 Answers

Starting a roguelike, maze generator problem. 1 Answer

Creating a key generator 1 Answer

Dynamic Stairs Generation 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges