Monday 2 May 2011

Doorplace search

This one is really giving me a constant headache. How to make sure that rooms are connected?


Rectangular rooms are quite ok, but round rooms are the worst. There is a small section, often one tile per facing, where the door can be made. If the corridor and doorplace don't cross it fails. Now, this is where I might try a routine that extends the corridors to find and clear the last couple of tiles. There might be couple of ways to do that, but I think starting from the first tile next to doorplace and then searching with a pathfinder. You can't possibly go wrong with that. Well, unless the room is completely surrounded by other rooms. That's when you need to crash through the room walls to another room.

No comments:

Post a Comment