Suggestion:
I would like a fix to the light code, so that when I cast the spell/scroll/activation to 'Light Area', rooms in cave levels get lit. This would remove the tedium of running around all the walls to find potential exits from the room.
I presume that the original levels have a flag set for being a room, so lighting a room just makes a check for being in the same room or something like that?
There are some formations on the old levels that when you first enter you assume it is a room, but when trying to light it, it's not lit.
What about an algorithm like:
From @, put all 8 surrounding squares in a queue and let them follow this process:
- if it's already been in the queue, ignore it.
- if it's a wall, turn on the light.
- if it's a floor with 2 or more adjacent walls, turn on the light.
- if it's a floor with less than 2 adjacent wall tiles, it's lit, and all 8 adjacent tiles are added to the queue.
With this algorithm most rooms would be completely lit, but it would not light up corridors. It would light up corridors that are 3 tiles wide, but not corridors that are 2 tiles wide.
Another solution would be to add the same flag that is used on ordinary levels to the 'rooms' in cavern levels.
I would like a fix to the light code, so that when I cast the spell/scroll/activation to 'Light Area', rooms in cave levels get lit. This would remove the tedium of running around all the walls to find potential exits from the room.
I presume that the original levels have a flag set for being a room, so lighting a room just makes a check for being in the same room or something like that?
There are some formations on the old levels that when you first enter you assume it is a room, but when trying to light it, it's not lit.
What about an algorithm like:
From @, put all 8 surrounding squares in a queue and let them follow this process:
- if it's already been in the queue, ignore it.
- if it's a wall, turn on the light.
- if it's a floor with 2 or more adjacent walls, turn on the light.
- if it's a floor with less than 2 adjacent wall tiles, it's lit, and all 8 adjacent tiles are added to the queue.
With this algorithm most rooms would be completely lit, but it would not light up corridors. It would light up corridors that are 3 tiles wide, but not corridors that are 2 tiles wide.
Another solution would be to add the same flag that is used on ordinary levels to the 'rooms' in cavern levels.
Comment