World Marker & Anchor for Minimap
RTS World Anchor System
The RTS World Anchor System provides a way to integrate non-agent objects (buildings, towers, objectives, waypoints) with the Enemy Masses RTS features like Fog of War and Minimap. It consists of two components that work together:
EnemyMassesRTSWorldAnchor – Marks individual objects that should appear on the minimap and/or reveal fog
EnemyMassesRTSWorldMarker – Defines the visibility and fog rules for a group of anchors
Why This System Exists
In RTS games, you typically have many objects beyond just units that need to interact with the fog of war and minimap systems:
Player Buildings
Reveal fog around them
Always visible
Enemy Buildings
Don't reveal fog
Only visible when not in fog
Neutral Objectives
May or may not reveal fog
Often always visible
Watchtowers
Reveal large fog radius
Always visible
Resource Nodes
Don't reveal fog
Visible based on discovery
Without this system, you'd need to write custom code for each object type. The World Anchor System provides a unified, configurable solution that:
Centralizes rules – Define visibility rules once on a parent object (World Marker), and all child anchors inherit them
Supports factions – Different behavior for friendly, enemy, and neutral objects
Integrates with Fog of War – Anchors can reveal fog and respect fog visibility for minimap display
Works with the Minimap – Anchors automatically register with the minimap system
When to Use This System
Use the World Anchor System when you have:
Static buildings that should reveal fog and appear on the minimap
Defensive structures (towers, turrets) that provide vision
Objectives or capture points that players need to see
Neutral structures that become visible when discovered
Any non-agent object that needs fog/minimap integration
This system is for static or semi-static world objects. For moving units controlled by Enemy Masses, the RTS controller handles fog and minimap integration automatically.
Architecture Overview
The World Marker acts as a rules provider for all World Anchors in its hierarchy. Anchors automatically find their parent marker and query it for visibility rules.
Setup Guide
Step 1: Add a World Marker (Rules Provider)
The World Marker defines the rules for how anchors behave based on their faction.
Create or select a parent GameObject that will contain your anchors (e.g., "PlayerBase" or "EnemyBase")
Add the EnemyMassesRTSWorldMarker component:
Add Component → Enemy Masses → RTS → World Marker
World Marker Settings
Minimap Visibility Rules
Friendly Visibility
When player-controlled anchors appear on minimap
Enemy Visibility
When enemy anchors appear on minimap
Neutral Visibility
When neutral anchors appear on minimap
Fog Reveal Rules
Reveal Fog For Friendly
Allow player anchors to reveal fog
Reveal Fog For Enemy
Allow enemy anchors to reveal fog (usually false)
Reveal Fog For Neutral
Allow neutral anchors to reveal fog
Fog Visibility
Fog Provider Override
Optional reference to your fog system
Fog Visibility Threshold
Alpha threshold for "visible" (lower = stricter)
Visibility Rule Options
Always
Anchor always appears on minimap regardless of fog
OnlyWhenVisible
Anchor only appears when not covered by fog
Never
Anchor never appears on minimap
Step 2: Add World Anchors to Objects
For each object that should participate in fog/minimap:
Select the GameObject (building, tower, etc.)
Add the EnemyMassesRTSWorldAnchor component:
Add Component → Enemy Masses → RTS → World Anchor
World Anchor Settings
Anchor
Anchor
Optional transform for position (defaults to this transform)
Faction
Faction
PlayerControlled, Enemy, or Neutral
Minimap
Minimap Color
Color of this anchor's icon on the minimap
Fog of War
Fog Reveal Radius
Radius in world units that this anchor reveals
Rules
Rules Provider
Optional explicit reference to a World Marker
Auto Find Rules Provider
Search parents for a World Marker automatically
Position Offset
Position Offset
Offset from anchor transform for fog/minimap position
Gizmos
Show Gizmos
Display fog reveal radius in Scene view
Example Configurations
Example 1: Player Base
A player-controlled base where all buildings reveal fog and appear on the minimap.
World Marker Settings:
Friendly Visibility:
AlwaysEnemy Visibility:
OnlyWhenVisibleNeutral Visibility:
AlwaysReveal Fog For Friendly:
✓Reveal Fog For Enemy:
✗Reveal Fog For Neutral:
✗
World Anchor Settings (per building):
Faction:
PlayerControlledFog Reveal Radius:
15(main building),8(barracks),25(watchtower)
Example 2: Enemy Base
An enemy base that doesn't reveal fog and only shows on minimap when discovered.
World Marker Settings:
Friendly Visibility:
AlwaysEnemy Visibility:
OnlyWhenVisibleNeutral Visibility:
AlwaysReveal Fog For Friendly:
✗Reveal Fog For Enemy:
✗Reveal Fog For Neutral:
✗
World Anchor Settings (per building):
Faction:
EnemyFog Reveal Radius:
0(no fog reveal)
Example 3: Neutral Capture Point
A neutral objective that's always visible but doesn't reveal fog until captured.
World Marker Settings:
Neutral Visibility:
AlwaysReveal Fog For Neutral:
✗
World Anchor Settings:
Faction:
NeutralFog Reveal Radius:
0
When captured, change the faction via script:
Scripting API
EnemyMassesRTSWorldAnchor
EnemyMassesRTSWorldMarker
Changing Faction at Runtime
Integration with Other Systems
Fog of War Integration
The World Anchor System integrates with fog of war through two interfaces:
IRTSFogRevealer – Allows anchors to reveal fog
IFogVisibility – Allows the marker to query fog state
Anchors automatically register with the RTSWorldUnitRegistry when enabled, and the fog system reads from this registry.
Minimap Integration
Anchors implement IRTSMinimapIcon and register with the RTSWorldUnitRegistry. The minimap controller queries this registry to display icons.
Best Practices
Use hierarchy-based rules: Place one World Marker on a parent object (like "PlayerBase") and all child anchors will automatically use its rules. This keeps configuration centralized.
Tune fog reveal radius carefully: Large radiuses reveal more of the map but may reduce strategic depth. Consider smaller radiuses for most buildings and larger ones for dedicated vision structures (watchtowers).
Don't forget to set factions correctly: An anchor with the wrong faction will use the wrong visibility rules. Double-check factions on enemy buildings especially.
Fog Visibility Threshold: Lower values (like 32) mean anchors hide more quickly as fog rolls back in. Higher values (like 128) keep anchors visible longer during refogging. Adjust based on your fog speed.
Troubleshooting
Anchor not appearing on minimap
Check that the anchor's faction matches the visibility rules
Verify the World Marker's visibility rule isn't set to
NeverIf using
OnlyWhenVisible, ensure the area is revealed by fog
Anchor not revealing fog
Check that
Fog Reveal Radiusis greater than 0Verify the World Marker has "Reveal Fog For [Faction]" enabled
Ensure a fog of war system is present in the scene
Anchor not finding its World Marker
Make sure
Auto Find Rules Provideris enabledEnsure the World Marker is on a parent or in the same hierarchy
Try manually assigning the Rules Provider reference
See Also
Fog of War System – How fog of war works
Minimap Controller – Minimap configuration
RTS Controller – Main RTS control system
Last updated

