Fog of War Docs
View packages

Visibility workflows

Competitive vision

Build deterministic gameplay visibility with teams, sensors, concealment, layered LOS, reveals, and server authority.

Fog of War 26.8.5Unity 6000.0+URP3D XZ worlds

Fog of War includes a deterministic gameplay visibility simulation in addition to the terrain-fog renderer. Single-player games can use it locally. Multiplayer games run the same simulation on an authoritative server and use its target decisions to control replication, presentation, targeting, and combat authorization.

Vision model

FogVisionArchetype is a reusable ScriptableObject made from one or more sensors and optional rule assets. A sensor can be circular or conical, planar or three-dimensional, restricted to gameplay layers, obstacle-aware or unobstructed, and assigned any combination of the 128 visibility and detection channels. Sensor rules are expandable without editing the solver: derive from FogVisionRuleAsset, modify FogVisionArchetypeBuilder, and place the rule asset on an archetype.

FogTargetArchetype defines an entity's faction, bounds, gameplay layer, targetability, proximity reveal, concealment, detection requirements, and last-known behavior. Sources and targets can use the authoring components or generation-safe programmatic handles. Stable archetype IDs are intended for save data, content catalogs, network configuration, and deterministic game-specific range tables.

The package includes recommended assets for standard sight, true sight, unobstructed sight, camouflage, stealth, obscured targets, nearsight, radius changes, and forced reveals. Tools > Kiwi Studios > Fog of War > Create Recommended Archetypes creates any missing assets idempotently and preserves assets that already exist.

Included rules

  • 128 faction, sight, detection, reveal, or project-defined channels through FogChannelMask;
  • 64 gameplay LOS layers through FogLayerMask;
  • personal vision, allied shared vision, spectator vision, and runtime team switching;
  • circular and conical sight with source-forward tracking;
  • exact Box, Sphere, and Capsule occluders plus conservative unsupported-collider bounds;
  • one-way brush, opaque, and detection-only volumes;
  • camouflage, stealth, required detection channels, true sight, and proximity reveal;
  • obscured or ghost presentation without targetability;
  • unobstructed vision that ignores terrain and concealment blockers when configured;
  • nearsight that limits range and suppresses shared allied vision;
  • source, observer, and forced-reveal modifiers with priority and duration;
  • hidden, last-known, obscured, and visible target presentation states;
  • targetability, detection, network relevance, reason flags, and action authorization;
  • timed or persistent last-known positions;
  • origin shifting and independent worlds;
  • layered multi-floor gameplay LOS, with optional three-dimensional distance checks;
  • allocation-free interest deltas after registration and warmup.

FogVisibilityDecision is the complete result for one observer and target. It exposes presentation, detection, targetability, network relevance, last-seen time and tick, last-known position, and reason flags. FogWorld.EvaluateAction applies FogActionRequirements.Combat, GroundTargeting, or a project-defined policy. The decision is suitable for authoritative gameplay only when the FogWorld is fed authoritative source, target, obstacle, volume, and modifier state.

Brushes and concealment

FogConcealmentVolume supports three modes. OneWayBrush blocks vision into the volume unless the contributing source is inside it or carries a brush-reveal channel. Opaque blocks sight through the volume. DetectionOnly requires the configured detection channels without acting as terrain. With no custom mask selected, detection-only volumes use the built-in Detection channel while brush and opaque volumes use Brush Reveal. These are declared volumes; the package never scans a scene for trigger volumes at runtime.

Targets choose None, Camouflaged, Stealthed, or Obscured. Camouflage and stealth require their configured detection channels unless proximity or a forced reveal applies. Obscured targets produce a non-targetable ghost state. Project-specific categories can reserve any unused mask bits.

Terrain fog and entity authority

Terrain presentation and entity authority intentionally use separate outputs. The URP pass projects the current terrain mask over rendered opaque geometry. Entity decisions use target bounds, layers, concealment, and all compiled sensors. A complex archetype should designate one sensor for terrain presentation; additional detection-only sensors can set ContributesToTerrain to false. The inspector warns when multiple sensors would compete for the terrain mask.

Layered LOS is a gameplay model, not a volumetric renderer. Obstacles, sources, targets, observers, and concealment volumes can occupy any of 64 layers, and sensors or observers can select visible layers. This supports deterministic floors, bridges, and interiors without accidental cross-floor sight. The visual fog remains one depth-aware camera projection per FogWorld; separate simultaneous floor masks require separate worlds or a project-specific renderer adapter.

Networking and anti-cheat

The core simulation does not move data across a transport. The optional NGO sample uses NetworkShow and NetworkHide; the optional Netcode for Entities sample maintains GhostRelevancy. Both are server-only and fail closed for connections that have not received an authenticated observer configuration. Hidden target coordinates are therefore withheld when those adapters are installed and configured correctly.

For another transport, run FogWorld on the server, register an authenticated FogObserverSettings per connection, and consume GetInterestDeltas or TryGetTargetVisibility to add or remove replicated entities. Never accept faction, owner, concealment, or reveal authority directly from an untrusted client. A client-side hidden renderer is presentation only and is not an anti-cheat boundary.

Project-specific data

The package supplies the mechanics but does not prescribe a particular game's content catalog. Champion, minion, turret, ward, pet, ability, or item ranges should be authored as project-owned archetype and modifier assets. Ability scripts decide when to add or remove a modifier or forced reveal. Combat code decides which FogActionRequirements apply to an action. These extension points keep the core reusable without weakening server authority.

The Competitive Vision sample demonstrates team switching, shared and personal vision, one-way brush, camouflage, stealth, true sight, obscured targets, unobstructed sight, cone sight, nearsight, last-known state, forced reveals, radius modifiers, and layered LOS. The simpler MOBA Vision sample focuses on binary current-team terrain fog and query-driven enemy presentation.

Still stuck?

Bring the world state with you.

Include the Fog of War version, Unity and URP versions, active profile and backend, relevant logs, diagnostics, and the smallest reproducible scene.

Email supportJoin Discord

Fog of War 26.8.5

Search documentation