Has anyone else attempted to make one?
I have tried many times and read a shed load of forum posts. But never got anywhere...
..until now!
I found a nice simple method which seemed the easiest to pull off.
So after 3 evenings of banging my head against the wall, I got all the maths sorted and now have a JS concept ready to use in unity ^^
The hardest part by far was linking all of the rooms up and spent hours thinking of the most suitable way of getting the job done.
Here is the final product. http://playpen.project-blackwidow.com/gen.htm
Its not really in any condition to be used more than a concept and practice. Feel free to look at the source of the page and see how its done if you can understand the mess lol. Its not commented very well... well at all really, but it should be self explanatory if you understand the process.
Here is the article http://roguebasin.roguelikedevelopment. ... generation
Enjoy
Dungeon generator
Dungeon generator
New Site Coming Soon! Stay tuned
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Dungeon generator
Very nice! I really like it. In case they could be of more use, or if you wanted to make a solid, maze-like dungeon structure, there are algorithms used in CS that could be of some help: Labyrinth Algorithms. Good ones to check out would be Kruskel's, Prim's, Hunt and Kill, and Eller's.
The indelible lord of tl;dr
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Dungeon generator
you could attach some webGL to this and make it 3d.
Its very awesome though. I found one map I will save for my next D&D campaign.
Its very awesome though. I found one map I will save for my next D&D campaign.
Re: Dungeon generator
And here we have stage 1 in unity. The floors are being generated nicely, needs a tweak or two to keep rooms generating so close to each other.
Moving it from web JS to unity JS was trickier than i expected it to be, but im getting there
Moving it from web JS to unity JS was trickier than i expected it to be, but im getting there
New Site Coming Soon! Stay tuned
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Dungeon generator
End of evening 3 and the next step of this beauty is done
Now I just need to get the walls up with the doors in the right places :s lol.
When I have a proper dungeon being generated, I will upload a copy to the interwebs for people to see ^^
Now I just need to get the walls up with the doors in the right places :s lol.
When I have a proper dungeon being generated, I will upload a copy to the interwebs for people to see ^^
New Site Coming Soon! Stay tuned
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Dungeon generator
Are the connectors actually hallways, or teleporters (like where you walk from one room directly into the next)?
The indelible lord of tl;dr
Re: Dungeon generator
That looks nifty. So your able to make the connecting tunnels break through the walls of each room?
Re: Dungeon generator
@Jack
They are actual hallways which you will walk down to get to the next room. The same logic can be used to link rooms via teleporter as well in theory, rather than generating a mesh you can assign a point to teleport to and from. Which is actually a good idea
@ Callan
What you see there is only the floors. My intention is to record all of the points where the doors are and basically skip that point of mesh generation when I build the walls up.
Currently each room and each portion of the corridor is a separate game object (as you can see in the screenshots) I think it might be better to get it all into a single object eventually, but as I am only starting out and have only just started using unity properly, I am not overly worried about that just yet lol.
They are actual hallways which you will walk down to get to the next room. The same logic can be used to link rooms via teleporter as well in theory, rather than generating a mesh you can assign a point to teleport to and from. Which is actually a good idea
@ Callan
What you see there is only the floors. My intention is to record all of the points where the doors are and basically skip that point of mesh generation when I build the walls up.
Currently each room and each portion of the corridor is a separate game object (as you can see in the screenshots) I think it might be better to get it all into a single object eventually, but as I am only starting out and have only just started using unity properly, I am not overly worried about that just yet lol.
New Site Coming Soon! Stay tuned
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Dungeon generator
If you did have the hallways walkable, you probably would want to add to the algorithm to consider the space a hallway has and blow it up into a more content-fillable hallway, or else the dungeon will feel too much like "big room, walk down a tiny empty hallway, big room, walk down a tiny empty hallway".
The indelible lord of tl;dr