Fog of war system for RTS

How should I go about creating a fog of war system for RTS? I really don’t know where to start!

For removing pawns and stuff from view when they are outside of range, I’d use some sort of visibility culling. A simple way would be setting the visibility flag when an object is hit by a raytrace with a collision sphere or sphere trace around your camera. It would effectively trigger the visibility of players within the viewing range. Obviously, you’d need to replicate this to the clients needed as well. As far as the darkening of the map goes, you could just have the entire map dark with a point light around the camera to simulate the “view area” within the fog. This is for an overhead view.

For a First Person view, exponential fog (or atmospheric) for the “fog” with visibility culling for things outside of player’s view range.

This is my very simple implementation : just copy & paste to your project and it works. If you want to see detail how it works you can read further down the blog and the code.

http://phungdinhthang.com/2016/12/12/unreal-engine-4-fog-of-war-tutorial/