View Full Version : Random dungeon generator
Deril
January 5th, 2006, 01:57 PM
Hi,
I am creating little algorithm for fun, I want to generate random map with coridors and rooms.
this is quick one evening work. so...
http://flashmx.puslapiai.lt/temp/rogueflash01.html
base idea is... make randome maze.. clear it... do some loops.. then add some rooms.
may be you will have some ideas or advices for this subject.
thanks.
SeiferTim
January 5th, 2006, 03:26 PM
Very impressive!! I think you should try to make it fill up Rooms, too, like every handful of steps it creates a random room between 2 - 5 units in height/width at a random angle from the hallway it's creating.
NiñoScript
January 5th, 2006, 07:44 PM
Pretty cool :D
i liked it with straightness at 90%
Smee
January 5th, 2006, 09:40 PM
That's fun to watch :D
Looks nice with straightness at 100%
EDIT: Straightiness* :O
Deril
January 6th, 2006, 01:33 PM
Hello,
ok.. I spent one more evening at this.. (full night would be more correct...)
I added loops.. rooms and doors..
http://flashmx.puslapiai.lt/temp/rogueflash02.html
it still needs a little clear up...
- check for dead rooms...
- add room - room doors..
- clear some doors.. (if too many)
- fix corridors cut off by room corners..
- also I would like to implement density factor, and separate corridors by 2..3 .. solid rock tiles instead of 1. I think it will produce better maze for room placement.
.. its sad that I coded this in a rush.. so I didn't produce classes. now code became difficult to maintain...
anyway.. this algorithm takes a lot of time and resurses to work. I need it to be faster.
well I didn't optimize it yet, but it does a lot of full scans.. and searches. so I think it will not perform well.
I will now try another approach.. instead of full area scans I will scan small area to check if it is available for my room.. and after this connect the room with the rest of the dungeon.
I am still looking for new ideas how to make dungeons using less resources..
Ideas are welcome.
Deril
Smee
January 6th, 2006, 05:58 PM
Looking good so far! One thing I noticed is that about every 1 out of 4 times (Yes, I'm very bored right now), it would leave a room with no door, and no way to get in.
Deril
January 6th, 2006, 10:29 PM
room with no door... you say... :-/
hm.. it must have secret doors then.. right? :)
nah.. my room wall scaner detects start of the wall and end of it..
I didn't concidered chance of them to blend ...
I will check it.. also.. I will rethink room placement logic..
...this does some nasty errors. not fatal.. but..
NiñoScript
January 7th, 2006, 09:28 AM
i like this :)
Gawain
January 9th, 2006, 01:15 PM
I just gotta say, impressive stuff. I'd never have though about solving it like this. I missed the "loops" from the 1st version, so glad you added that.
Flashh_n00b
January 27th, 2006, 11:57 PM
This is really kool. The only thing i could see to make it better would to be add in random battles and stuff like that...
hybrid101
January 28th, 2006, 04:25 AM
really awesome dude! that looks very cool:tb:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.