Skip to content
TECHNICALLYARTIST
FAB

Getting Started

This walkthrough enables the two required project settings, then sets up a level from scratch: bake a floor, place the fog, add a viewer, and reveal enemies.

Fog of War leans on two engine features that are off by default. Enable all three of these before placing anything.

  1. Enable FogOfWar in Edit -> Plugins, and restart the editor if prompted.

  2. Enable Niagara / Niagara Fluids in Edit -> Plugins. Beacons rely on it; without it, beacon vision will not work.

    Enabling the Niagara Fluids plugin in the Plugins window

  3. Enable Custom Depth-Stencil Pass in Project Settings -> Rendering -> Postprocessing. Set it to Enabled with Stencil. Vision occluders use this pass to cast their shadows.

    Setting Custom Depth-Stencil Pass to Enabled with Stencil

The fog samples a baked black-and-white texture so light only appears on walkable ground (white) and never on out-of-bounds areas (black).

  1. Give your floor surfaces a mesh the baker can see. Stretched cube meshes laid over the ground work well.

  2. Tag every floor mesh actor with the FLOOR tag.

  3. Drop BP_MapBaker into the level, set its size and centering to cover the playable area, and press Bake.

The baker writes out a floor texture. You can leave the baker in the level to bake at runtime, or bake once and use the saved texture statically (recommended for performance). See The Map Baker for the details.

  1. Drag BP_FogManager into the level. You only need one per level.

  2. Set its key properties to match your map:

    | Property | What it does | | --- | --- | | Is Map Centered | Tick this if your map is centered on the world origin. | | Map Size | The size of the playable area, in world units (default 3000). | | Character Visibility Radius | How far the player sees, in world units (default 400). | | Floor Map Texture | The texture you baked in step 2. |

The Map Size and centering here must match what you used on the Map Baker, so the lit areas line up with the floor. See The Fog Manager for the full reference.

The Tracker is what reveals the area around the player and decides which enemies are visible.

  1. Add a BP_Tracker component to your player character.

  2. Register the actors that should be hidden by fog by calling Assign Enemy on the tracker (on the server). A common pattern is to tag enemies, gather them with Get All Actors With Tag, and call Assign Enemy for each.

  • Beacons grant extra vision. Add a BP_Beacon component to an ally, watchtower, or ward and call Assign Beacon on the player’s tracker to link it. See Tracker & Beacons.
  • Vision occluders block sight. Add a BP_Vision_Occluder component to walls or props so fog stays behind cover. Place them flat on the ground. See Vision Occluders.

Press Play. The map starts dark, a lit circle follows the player, beacons open up more of the map, and tracked enemies stay hidden until someone has line of sight to them.