The dungeon builder 2 (link in sig) can create a random dungeon by piecing together 6x6 (grid) tiles (effectively 3x3 path tiles). The *only* thing the generator checks however is whether an open space is connected to an open space, dit for 'closed' space and ofcourse the edges, this to prevent having a pathway ending in a wall. This works nicely and renders nice looking dungeons, however there is no certainty that all 'rooms' are accessible and there is also no way to tell how to get from one end of the dungeon to the other end (nor whether there is a connection between those two ends at all).
My question: how can you determine
1. whether all open spaces can be accessed from each room
2. how to determine whether 2 ends of the dungeon are connected (this question is redundant though as soon as 1 is solved).
So how does it work?
The dungeon is first 'virtually' rendered simply in a list with rows and columns where each cell is a representation of a dungeon tile e.g a 2x2 tile dungeon would virtually look like:
Undecided dungeon:
tX00000XX, t0000XXX0
tXXX00000, t00XXX000
is turned into a 'random' dungeon:
t00000010, t00000000
t10100000, t0000100
Here is 0=Wall; 1=Path and X=Either wall or Path
So What does "t10100000" mean? Each (binary) number represents the edge of the tile so if we label those postions: t12345678
then you can read it as:
1=East edge
2=North East corner
3=North edge
4=North West corner
5=West edge
6=South West corner
7=South edge
8=South East corner.
Have a look at tile way bottom right of this picture, here you can see the positions
picture
Given this however you thus have a dungeon which looks like this:
Code: Select all
t00000010, t00000000
t10100000, t0000100
The above configuration looks like this:
Code: Select all
X=WALL ; O=PATH/OPEN ; ?=UNKNOWN (known when the actual tile is chosen, which is also random)
XXX XXX
X?X X?X
XOX XXX
XOX XXX
X?O O?X
XXX XXX
where
XXX
XXX
XXX
is one tile consisting out of 9 areas that can either be open or closed (path or wall)
Any comments, questions, suggestions?