Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old August 24, 2018, 10:41   #1
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
On dungeon generation

So I've been slowly hacking on my roguelike, and it was time to write a map generator. At first, I wanted to just copy something from Angband or Sil, but, upon closer examination, it occured to me that they use an overly complicated method.
They first place all rooms and then try to connect them with tunnels. The tunneling phase is difficult and it can fail. So people hacked in some matrixes that check connections, floodfill algorithms doing the same and what not. It still can fail and then Angband aborts the generation and tries again, starting from scratch.
I used a simpler way instead, as follows:

Code:
1. Place the frist room.

2. Choose a place for (another) room.
3. See if it can be connected with tunnel to one of previous rooms.
4. If it can, place the room and the tunnel (and if not, then don't)
5. If not enough rooms yet, goto 2.
Doing it like that (room-tunnel-room-tunnel...) is a whole lot easier than dumping all rooms and then trying to connect them (room-room-room... tunnel-tunnel-tunnel...) and guarantees a fully connected dungeon.
Then, of course, you can do some postprocessing, for example, building more tunnels (the algorithm has a tendency to create some far-flung rooms with only one tunnel leading to them). But that's an easy step.
So I figured maybe some of you would want to know that, in case you decide to write more dungeon profiles for Angband or something (hi wobbly ) Also, if someone has more thoughts about generating maps for roguelikes, let me know, while I'm at it

Last edited by t4nk; August 24, 2018 at 11:21.
t4nk is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pyrel dungeon generation fizzix Variants 50 December 7, 2012 00:32
Making dungeon generation more interesting Nomad v4 5 November 10, 2011 16:48
Disconnected dungeon generation Derakon Vanilla 41 January 5, 2011 23:25
Over-engineering dungeon generation RogerN Variants 39 July 19, 2010 04:21
Edit File For Dungeon Generation? Zero Vanilla 3 January 9, 2008 18:17


All times are GMT +1. The time now is 13:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.