Classic TopDown Fog of War

I’m proud that I’m finally able to present** Classic TopDown Fog of War**!

Now available on the marketplace! Marketplace link

This Fog of War system combines the classic dark fog representing undiscovered area and a highly accurate bright fog representing currently hidden area. The full system is entirely implemented in Blueprints. Both types of fog are projected onto the ground using a PostProcess material. This system is designed to have the same performance on small as well as on very large maps. Static meshes cast fog even without any further adjustments. Additionally multiple implemented methods for edge detection allow you to maximize the quality of the bright fog.

This system is designed for a single pawn with additional sources of vision. Those sources can have either simple vision (without line of sight tests) e.g. for revealing key locations or they can have complex vision (with line of sight tests) e.g. for looking through keyholes or watching through cameras. Many aspects such like fog color, vision range and angle are editable.

Technical details:

  • 1 Actor calculating how both types of fog have to be drawn.

  • 1 PostProcess Material drawing both types of fog.

  • 1 Component controlling if an actor should hide in the fog, should cast fog and offering options to optimize the way it casts fog.

  • 2 Components controlling if and how additional sources should have vision. (multiple simple vision sources and one source with complex vision supported)

  • Height differences supported (as long as the world doesn’t overlap in the z-axis)

  • Tiles that indicate whether an area is discovered or not are only loaded in a declared area around the pawn.

  • Detailed tutorials guiding you how the systems works and how you can easily implement it into your game.

https://www…com/watch?v=zfMD6hN2kR8

Update: Classic TopDown Fog of War does now support Multiplayer!

https://www…com/watch?v=HaIQxpv59lI

5209d28f4442b3e6f5e1fb2e1c96ee5554d592d0.jpeg

4d54587c0931f6dc6cf803bc6b1dbf0b25ace38b.jpeg

Changelog

v1.1 (10-17-2016):

  • Multiplayer is now supported. This includes:

    • The player as well as each actor that wants to be hidden in the fog is now part of a team. Actors that are currently not visible will only be hidden in the fog when they are not in the players team.

    • BP_FOW_Component has been reworked. It will now call newly created functions of BP_FOW_Actor instead of changing arrays directly.

    • BP_FOW_Actor has been updated to only hide actors of other teams.

    • Various actors of the Overview map have been modified to support multiplayer.

  • Actors that want to be hidden in the fog or want to be ignored by visibility calculations of the fog weren’t handled correctly when spawned during runtime. This is now fixed.

Hey Pepeeee,

Very cool stuff! The dynamic alterations (rotation/scaling actors) was particularly interesting. Does this affect any static/dynamic actor or is it set to trigger on specific actors (for instance, actors with a specific object channel)?

Hey ,

theoretically you could simply spawn a static mesh in the world, rotate and scale it and it would cast fog depending on its rotation and scale but with a rather low accuracy. This is nice for level prototyping or meshes without outer edges (like inner walls, …) but for others you need to tell the algorithms how they can detect the edges of the mesh properly. This can be done by attaching a Component to it and choosing an edge detection mode.

It looks really interesting.

Awesome work, it looks good!

Hi this looks very good work. It’s possible for you to show how you have implemented the post process material for draw the fog?

Thanks you in advance

Hi EpicOdino,

figuring out a way that draws both types of fog nicely took me a good amount of time. So I hope you don’t mind that I don’t want to make the whole material available for free. But the general idea is a multiplication of the color output of a SceneTexture:PostProcessInput0 with a parameter for the fog color. That result is linear interpolated with purely the color output of the SceneTexture node. The alpha channel takes an input for the shape of the respective fog. That shape is dependent on an AbsoluteWorldPosition node.

I don’t know what you are particularly looking for but most of the magic is done outside of the material anyway.

Very nice work!

[=Pepeeee;593649]
Hi EpicOdino,

figuring out a way that draws both types of fog nicely took me a good amount of time. So I hope you don’t mind that I don’t want to make the whole material available for free. But the general idea is a multiplication of the color output of a SceneTexture:PostProcessInput0 with a parameter for the fog color. That result is linear interpolated with purely the color output of the SceneTexture node. The alpha channel takes an input for the shape of the respective fog. That shape is dependent on an AbsoluteWorldPosition node.

I don’t know what you are particularly looking for but most of the magic is done outside of the material anyway.
[/]

Ok thanks !

Good news!

Classic TopDown Fog of War is planned to be released on October 5th.

Just uploaded a new video. Beside a lot of general improvements there are 2 things that are visible in the video even though you probably missed them in the previous video.

  • Previously when standing close to a wall the bright fog wasn’t drawn correctly over the whole visible area. This is fixed.
  • A similar effect occured in specific situations at the corner of 2 adjacent static meshes. This was generally intended to be removed by the edge detection options this system offers. But now it will work even without that!

Just made some nice progress with the PostProcess Material! You can see the result in the updated video & images in the starting post.

Classic TopDown Fog of War is now on sale for 25% off!

In addition I updated the pack. It supports Multiplayer now!

Changelog

v1.1 (10-17-2016):

  • Multiplayer is now supported. This includes:

  • The player as well as each actor that wants to be hidden in the fog is now part of a team. Actors that are currently not visible will only be hidden in the fog when they are not in the players team.

  • *] BP_FOW_Component has been reworked. It will now call newly created functions of BP_FOW_Actor instead of changing arrays directly.

  • *] BP_FOW_Actor has been updated to only hide actors of other teams.

  • *] Various actors of the Overview map have been modified to support multiplayer.

  • Actors that want to be hidden in the fog or want to be ignored by visibility calculations of the fog weren’t handled correctly when spawned during runtime. This is now fixed.

https://.com/watch?v=HaIQxpv59lI

I’ve got repeatedly asked why the fog looks so grainy. This is caused by some noise I added to the material. I like how it looks but it can be removed within a minute:

In the material Mat_PP_FOW (or MAT_PP_FOW_HiddenOnly in case you use that) take a look at the commented block “Add some noise to make the fog …”. Skip the 3 (or 1 in MAT_PP_FOW_HiddenOnly) Add nodes this commented block is connected to. Plug the output of the previous Subtract nodes directly in the next Add nodes. The noise is now removed.

Once you’ve done this you may also want to play with the value of the variable TextureSize_Hidden. This variables defines the resolution of the fog that represents hidden area but because the smoothing of the fog is done per pixel this will also affect smoothing. Changing the value of TextureSize_Undiscovered won’t affect anything because that value is set on BeginPlay in the collapsed graph InitPPMaterials in BP_FOW_Actor. But you could multiply the value (after the truncate node) with an positive integer value before setting it.

Classic TopDown Fog of War is now on sale for 25% off!

Hey. I bought your Fog Of War recently and I’m quite happy with it. I have one question though and would really appreciate your help. I want to use cone as fov for my character although i would like for it to also have a small circle around him so that the cone would kind come out of this circle. I tried playing around a little bit but couldn’t find a way to do this so I’m hoping you could help me.

Hi , I sent an email with some questions, could you please take a look?