Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / DBP Simple Dungeon Maker

Author
Message
Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 18th Jun 2006 10:39
Messing around a little and thought I would post this code. It creates a simple "perfect maze" style dungeon. by changing mapwidth, mapheight you of course change the dimensions of the dungeon and by changing the density you get more corridors. You can fiddle with the number of rooms easily as well. A little slow because it draws the dungeon as it makes it but really quick if you shut that off.

Sergey K
20
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 19th Jun 2006 18:39
nice work dude!
i like it

now all what you have to do is just convert those 2d level creator into 3d and u can make huge level in 10 seconds and get 1$ for each level

MyNewSite:http://gogetax.com
Forums(About BLO and more):http://gogetax.com/forum
Cryptoman
20
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 19th Jun 2006 18:42
Pretty neat.


Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Aug 2006 00:42
Cool could you explain how this works exactly? In short.

Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 1st Aug 2006 01:06
Sure in short it makes a maze

Really though it is making what is called a perfect maze, meaning there are no loopbacks or unconnected pathways. It starts by choosing a random point and moving in a random direction (how often this direction changes can easily be modified). The "grid" for the map is broken into cells and when the corridor is being "dug" it make sure the cell has not been previously visited. it will then look for another unvisited cell next to it, if one exists it will dig a path to it, if no neighboring cells are unvisited it will pick a new point that was previously visited but has an unvisited neighbor and start a new path from there.

http://www.cafepress.com/blackarrowgames
Check out my great stuff here
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Aug 2006 03:40
Quote: "Sure in short it makes a maze "


lol. Thanks for not only writing that! I would have been annoyed if you did...

And Thanks for explaining that as well.

Wolf Dreamer
19
Years of Service
User Offline
Joined: 13th Sep 2005
Location: the land of chaotic dreams
Posted: 1st Aug 2006 12:45
Cool.

Good work.

I can visualize implementing this into a game quite easily.

The last sane human being in a world gone mad.
If you were a cockroach, what type of cockroach would you be?

Login to post a reply

Server time is: 2024-11-23 03:32:39
Your offset time is: 2024-11-23 03:32:39