Jump to content
  • Advertisement
Sign in to follow this  
Tangletail

Anyone Know how to achieve XCOM's style of Fog of War?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been working on this engine for some time, being designed for a Fallout 1 and 2 styled game with some wasteland elements. And I decided to go ahead and add a tile system. I'm not entirely sure if I want to make the terrain norm displacement mapped terrain, or tiled terrain. But I do intend on making the map able to support multiple levels. Things like buildings, that will have multiple floors without teleporting people off to another room unless necessary.

But I can't grasp my head around how Xcom Enemy Unkown and Xcom Enemy Within went about setting up the fog of war for buildings. I've wanted the engine to stream in tiles as it goes... and I have thought about loading in multiple textures per tile. something like a 16x16x256 texture which would be a 206kb texture for each tile. A bit high, but decent I guess. If I use two bits per standing layer, it'd give me a decent range per byte. 256*16, up to about 4096 wall heights. Probably less than that if I soon decide that I don't need that height.

Edited by Tangletail

Share this post


Link to post
Share on other sites
Advertisement

Got a video of the effect in action?  Maybe people will be able to help then.

Sorry to sound like a crank here, but the effect can be seen on literally any let's play video :P. I also don't personally own a copy of the game, so I don't have access to the modding toolkit to get a better idea. Though from what I can see, the maps are procedurally generated.

 

http://i.imgur.com/VYzZ8y4.jpg

http://i.imgur.com/snayuXH.jpg

Edited by Tangletail

Share this post


Link to post
Share on other sites

Wow... there's some hate going there, and I'm literally stating the obvious here :P as it's an effect used through the majority of the game.

Anyways, I've already figured it out. Or at least how to get close enough anyways.

Share this post


Link to post
Share on other sites
I think the point was that you should provide the link to the example in the first place, not have us dig around to try and find out what you're asking about.

Share this post


Link to post
Share on other sites

Just create a render target with fog of war, where 1 pixel represents one tile and it's value represents if it's visible or not. Update this render target when camera moves, by rendering a circle. This way new tiles around the current camera position will be marked as visible. Finally, render fog of war, by reading mentioned render target, filtering it (maybe using some higher order filter) and apply some kind of cool effect in pixels where fog of war is marked as visible.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!