Archived

This topic is now archived and is closed to further replies.

r3alityc0d3r

Fog of War

Recommended Posts

I can''t seem to find much on fog of war. I am making an RTS but I am kinda stumped on the fog of war aspect of the game. I thought i could add a hidden member to my CTile object class that would hold whether the tile is inside an objects view range, has ever been within an objects view range, or has never been in an objects view range. This seemed like it might work however this would make the viewable areas square. Usually a fog of war is nice and circular with a gradual fade to black. I''m stumped on how to do this efectivly. Any help would be greatly appreciated. r3alityc0d3r icq: 252463839 r3alityc0d3r@hotmail.com www.realitycoder.com "I am the Architect. I created the Matrix...Your life is the sum of a remainder of an unbalanced equation inherent to the programming of the Matrix. Which has led you, inexorably... here." Great Architect - Matrix Reloaded

Share this post


Link to post
Share on other sites
One way of managing this is to write your tile renderer so that you can specify lighting values for each vertex of a tile, to be blended across the face of the tile. For instance, if you are using 3D accelerated hardware and a 3D API (such as Direct3D or OpenGL), then you can specify vertex lighting colors for each corner of the quad, which are interpolated across the tile. Then, you calculate the lighting value of a corner by analyzing the seen/not-seen status of all the tiles adjacent to that corner. This smooths out the stair-stepping, though it is still somewhat noticeable. You can smooth it out even more by subdividing each tile into smaller sub-tiles.

Josh
vertexnormal AT linuxmail DOT org


Check out Golem: Lands of Shadow, an isometrically rendered hack-and-slash inspired equally by Nethack and Diablo.

Share this post


Link to post
Share on other sites