# Ideas for Fog of War (Shroud)

This topic is 4908 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm currently working on an iso game that requires a fog of war that's similar to Starcraft. I've tried making shroud tiles, but the edges of the fog didn't look very realistic. I then enabled hardware accelerated alpha-blending on the DirectDraw engine through Direct3D 7, but it didn't work out too well. After searching for several hours on Google, I decided to turn to this forum for help. I've pretty much ran out of ideas on how to pull off the effect. There were articles on multi-texture blending with alpha mask, but they were hard to implement with the way my code is right now. So basically what I'm asking is how can I do a simple fog of war effect that isn't so taxing on fps?

##### Share on other sites
First you need to draw/generate some transition tiles. These are going to probably be in greyscale, and just represent the transition between dark to light. If you don't know how to generate the tiles, just take the following pattern, and draw it as tiles in Photoshop/GIMP

        _____       /     \         |     |  ____/       \____ |                 ||                   |                  |____         ____|      \       /       |     |       \_____/

If all the shapes present in that shape are pre-drawn/generated, you will be able to come up with pretty much any shape you need.

For a completely obscured map, just neglect to render any invisible tiles, and then render transition tiles with alpha blending over top of transitioning tiles, so that it creates a nice border.

For a map that's partially obscured (for example, you can see terrain, but not enemies) it would probably be wise to create a second tileset of your tiles that is at 50% brightness, draw the non-visible parts of the map with that, and then blend your transitioning tiles at 50%. This will make the terrain that isn't visible by the player's units appear to be darker than the rest.

As for actually determining which transition tiles to draw, I'll leave that up to you to figure out an algorithm.

##### Share on other sites
First off, thanks for replying! Secondly, I think I'll try what you've suggested, but this might involve some hacking on my map's data structure and visibility algorithm. I've been trying to make diamond shaped shroud tiles, which is probably why I've been stuck. If all goes well, I'll post again with my results. In the meantime, I'd be glad to hear anymore ideas from anyone.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 11
• 15
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
634151
• Total Posts
3015825
×