All
Roguelikes have some sort of Field of View algorithm. You want to hack and slash some monsters, you want to be able to see them first. And quite often you dont want to see through walls(kills the suspension of belief).
The original Rogue (yes, the one which started it all.) took a simplistic approach to FOV. In the room you are in, everything is visible. Nothing outside is visible. Once you are in a corridor, only the corridor tiles adjacent to you are visible, which was fine, since you cannot be attacked on the corridor. This approach still made the game enjoyable.
Modern roguelikes are more sophisticated. You can look into rooms though open doors and windows. You cannot look behind pillars. There are many cool
algorithms available. Some of them are really cool and sophisticated. And fast!
Given modern computers, roguelikes with their simple graphics and turn based systems probably dont put too much pressure on the CPU. Some games like
Dwarven Fortress use all that CPU for realistic world simulations. Well, what else can you use your free CPU for ?
I decided to try translucent FOV. The idea is that you are looking through smoke or fog, or some such. If you are standing always in the open or in the middle of a fog, its no big deal. You have a large visual radius in open space, and a small radius in fog. However, wont it be cool if you stand at the border of fog and clear air, and you can see a long way into the open, but only a small distance into the fog! You can stand at the edge of a forest, and look miles around in the plains behind you, but only a few feet in front of you in the gloomy forest you are about to enter!
How to do it seems straightforward. Each tile can transmit a certain amount of light, represented by a fraction, 0 to 1. Transparent ones like open ground will transmit all light, ie transmittance 1. Opaque ones will stop all light, ie transmittance 1. Fog will maybe allow 90% of the light, ie transmittance 0.9.
When you want to see if a tile is visible, you trace a line from the center to the tile. You start with a value of 1. At each tile on the way to the destnation, you do a
visibility*=transmittance. If the transmittance is 1, you achieve a normal FOV. If it is 0, all further ones are 0 and you get a shadow. If however, transmittance is in between, you achieve an exponential falloff.
So my first attempt was to create a Bresenham FOV. Trace a bresenham line from the center of FOV to every tile in the radius. Do the calculation for each tile on the step.
The results looked promising. :)

The left side of the image are transparent tiles. The right side is foggy. The brightness of the tile indicated amount of light reaching it. Notice the shadow on the upper right.
However, there a few problems with Bresenham FOV, namely:
Notice the missing walls that should be visible. I am sure this problem has been solved by the community, but I couldn't find any good pointers to the solution. So I had to dump Bresenham FOV.
Then I was hit by another idea: Use any FOV algorithm to calculate the lit tiles. Then start from the centre and go progressively outward. From every lit tile, decide which tile lies toward the center from this tile, and use that tiles visibility value to calculate this tiles visibility. If that tile is opaque, then light must be coming here from one of the other two that lies towards the center. Choose one of them, and use it.
..............
...........x3.
...........12.
.....x2.......
.....21.......
..............
..............
..............
..............
..............
.x1...........
.32..........@
From locations marked x, 1, 2 and 3 are respectively first, second and third preference areas from which to collect visibility values.
(UPDATE: I found this method produces strange angles. Now I take the brigtest tile of 1, 2 and 3 as the source of light tile)
Aaand the result is ......

Nice! The visibility is calculated by Precise Permissive, a great algorithm created by Jonathon Duerig. Only that.... notice the corners in the brightness bands? as if the LOS was based on square and not round.
Well let me go ahead and bump the visibility down a bit if it being transmitted diagonally. And you have ......

I am kind of happy :). I will still have to put it in a game to see how it looks and how effective it is. It seems OK fast.
I will try to check in my code in my
RLForJ project on sourceforge very soon. The code is in Java.