Before when working on how to speed up The Guest List, I worked on adding rooms to the pathfinding process. The aim was to search through the rooms first and the pathfind only the found rooms. This worked relatively well for a first concept, but had some issues, namely that the rooms we found with a left-handed algorithm that depending on the direction of the room and it's doorways, would lead to some very-oddly divided rooms.
This is a screenshot from the previous post about these. The colours aren't that different but you can probably tell the outside of the building is all one room, as is the staircase and landing. These leads to some issues as the quickest path by room won't necessarily match a real path.
The following are a couple of screenshots from the new system. It now only allows rectangles to be rooms, no L-shapes or donuts any more:
The first image shows that each simple area is broken into it's own separate room. It doesn't make too much difference if we have a factor of more rooms as it's still quick to pathfind through.
The second image shows a similar view to the old one. You can now see that the space behind the staircase is classed as a specific room. This is because the stairs break the shape of the room up, so the new room generator looks at them like they're two different areas. I may alter this later, but it's not a priority for now.
This is all possible due to the addition of two helpers, the pillar and the door. The pillar is employed in the upstairs room and tells the pathfinder that these dead tiles, although they are walls, are still part of the room they're contained in. Doors, on the other hand, tell the room creator to ignore those points for now as we'll add them back in later. This is to stop odd-shaped rooms being created if the door frame is the first point scanned in the room.