Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Andy0903 · Feb 13, 2018 at 06:14 PM · tilemapproceduralgenerationtilesdungeon

Procedural generation of dungeons with rooms made in the new tile map system?

Good evening!

I need to procedurally generate dungeons for a project of mine (think Zelda Link to the Past but with randomly generated dungeons only) now my approach to that is planned to be some form of grammar system to be able to generate "missions" in forms of keys needed for doors etc within the dungeon, but that itself should be of less matter to my question.

What I wonder is how I would go about to be able to merge rooms that I've made in the new tile map system together? As it is now I can easily paint a whole dungeon and play it through, but I thought that I should paint a room each and then somehow merge them together into one dungeon fittingly.

Due to the lack of resources on tile maps I am quite at a loss how this could be achieved, if it's even possible. I'd be really grateful for all forms of ideas and help on this as it's quite crucial for the project.

Worst case scenario is to abandon Unitys tile maps, but since they're pretty handy that would be a shame to have to do.

Comment
Add comment · Show 7
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 Harinezumi · Feb 13, 2018 at 08:15 PM 1
Share

Hello!
What a great idea for a project! However, it is not clear to me what your question is: what is it that you need from the Tile$$anonymous$$ap system, or what is the functionality you are missing?

If you are asking how should the algorithm work that connects the rooms, why not generate logical connections, and then create tiles that follow those connections? In general, that's how dungeons are generated: you create the rooms, then you connect the rooms.

avatar image Andy0903 Harinezumi · Feb 13, 2018 at 09:12 PM 0
Share

Hey! I'm sorry for being unclear about my question, thanks a lot for taking your time to invest yourself in my clumsy situation.

I have discovered that you can relatively easy make prefabs out of tilemaps and instantiate them as any other gameobject. The only trickery on that part seems to be to make sure that they all have compressed boundaries so origin etc makes sense with each other.

But to make my question more clear. How would one go about to know if there's an opening/entrance/door etc in the tilemap to know that this is a place where a new room is needed.

$$anonymous$$y initial thought was to make some form of empty game object to denote "doorway" or something and use that as spawn points, but it feels like there might be better solutions to it. It's not completely clear to me how to know what vector3 to give the room when getting spawned so that it ends up at a sensible place.

avatar image Harinezumi Andy0903 · Feb 14, 2018 at 01:44 PM 1
Share

You are welcome, it is an interesting topic! :)

So if I understand your question, you want to know how to deter$$anonymous$$e what part of the dungeon needs to be connected?
In this case, I still think that generating a model first, and then generating the actual dungeon that is an implementation of that model (I do the same with a 3D, room based environment, and it works quite well).
For example, you deter$$anonymous$$e how many rooms you want, and then start generating from there. The first room will always need to have at least one exit, and most of the rooms should have at least 2 exits (except if your dungeon is really small), but slowly decrease the number of branches as you approach the desired room number. You can even directly specify for each exit when generating them, which room it shall be connected to (in the end your dungeon will be a planar graph, which has restrictions on how many "corridors" it can have).
A good example to look at is The Binding of Isaac. You could also look into the maze generation algorithms, particularly I was thinking that Prim's algorithm is something similar. I hope this helps, and feel free to ask more questions!

P.S: this Unity tutorial might also be useful for you.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

80 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

2D Tilemap room prefabs for dungeon generation. 0 Answers

How would I change my procedurally generated map change cells if it detects cells are around it? 0 Answers

Procedural Random Walk Dungeon Generator? 2 Answers

Tile-based Generation Not Working? 1 Answer

Overlapping Tile 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