Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Movement, Terrain & Maps

17. Locomotor System

Locomotors define how actors interact with terrain for movement.

TraitPurpose
LocomotorBase locomotor (17KB) — terrain cost tables, movement class, crushes, speed modifiers per terrain type
SubterraneanLocomotorUnderground movement
SubterraneanActorLayerUnderground layer management
MobileActor-level movement using a locomotor
AircraftAir locomotor variant

Key Locomotor features:

  • Terrain cost tables — per-terrain-type movement cost
  • Movement classes — define pathfinding categories
  • Crush classes — what can be crushed
  • Share cells — whether units can share cells
  • Speed modifiers — per-terrain speed modification

18. Pathfinding System

TraitPurpose
PathFinderMain pathfinding implementation (14KB)
HierarchicalPathFinderOverlayHierarchical pathfinder debug visualization
PathFinderOverlayStandard pathfinder debug

19. AI / Bot System

Bot Framework

TraitPurpose
ModularBotModular bot framework (player trait)
DummyBotPlaceholder bot

Bot Modules (~12 modules)

ModulePurpose
BaseBuilderBotModuleBase construction AI
BuildingRepairBotModuleAuto-repair buildings
CaptureManagerBotModuleCapture neutral/enemy buildings
HarvesterBotModuleResource gathering AI
McvManagerBotModuleMCV deployment AI
McvExpansionManagerBotModuleBase expansion AI
PowerDownBotManagerPower management AI
ResourceMapBotModuleResource mapping
SquadManagerBotModuleMilitary squad management
SupportPowerBotModuleSuperweapon usage AI
UnitBuilderBotModuleUnit production AI

20. Infantry System

TraitPurpose
WithInfantryBodyInfantry sprite rendering with multiple sub-positions
ScaredyCatPanic flee behavior
TakeCoverProne/cover behavior
TerrainModifiesDamageTerrain affects damage received

21. Terrain System

World Terrain Traits

TraitPurpose
TerrainRendererRenders terrain tiles
ResourceLayerResource cell management
ResourceRendererResource sprite rendering
ResourceClaimLayerResource claim tracking for harvesters
EditorResourceLayerEditor resource placement
SmudgeLayerTerrain smudges (craters, scorch marks)
TerrainLightingPer-cell terrain lighting
TerrainGeometryOverlayDebug geometry
TerrainTunnelTerrain tunnel definition
TerrainTunnelLayerTunnel management
CliffBackImpassabilityLayerCliff impassability
DamagedByTerrainTerrain damage (tiberium, etc.)
ChangesTerrainActor modifies terrain
SeedsResourceCreates new resources

Terrain is never just tiles — evidence from mods: Analysis of four OpenRA community mods (see research/openra-mod-architecture-analysis.md and research/openra-ra2-mod-architecture.md) reveals that terrain is one of the deepest extension points:

  • RA2 radiation: World-level TintedCellsLayer — sparse Dictionary<CPos, TintedCell> with configurable decay (linear, logarithmic, half-life). Radiation isn’t a visual effect; it’s a persistent terrain overlay that damages units standing in it. IC needs a WorldLayer abstraction for similar persistent cell-level state.
  • OpenHV floods: LaysTerrain trait — actors can permanently transform terrain type at runtime (e.g., flooding a valley changes passability and visual tiles). This breaks the assumption that terrain is static after map load.
  • OpenSA plant growth: Living terrain that spreads autonomously. SpreadsCondition creates expanding zones that modify pathability and visual appearance over time.
  • OpenKrush oil patches: Entirely different resource terrain model — fixed oil positions (not harvestable ore fields), per-patch depletion, no regrowth.

IC’s terrain system must support runtime terrain modification, world-level cell layers (for radiation, weather effects, etc.), and game-module-defined resource models — not just the RA1 ore/gem model.

Tile Sets (RA mod example)

  • snow — Snow terrain
  • interior — Interior/building tiles
  • temperat — Temperate terrain
  • desert — Desert terrain

22. Map System

Map Traits

TraitPurpose
MapOptionsGame speed, tech level, starting cash, fog/shroud toggles, short game
MapStartingLocationsSpawn point placement
MapStartingUnitsStarting unit set per faction
MapBuildRadiusInitial build radius rules
MapCreepsEnable/disable ambient wildlife
MissionDataMission briefing, objectives
CreateMapPlayersInitial player creation
SpawnMapActorsSpawn pre-placed map actors
SpawnStartingUnitsSpawn starting units at locations

Map Generation

TraitPurpose
ClassicMapGeneratorProcedural map generation (38KB)
ClearMapGeneratorEmpty/clear map generation

Actor Spawn

TraitPurpose
ActorSpawnManagerManages ambient actor spawning
ActorSpawnerSpawn point for spawned actors

23. Map Editor System

Editor World Traits

TraitPurpose
EditorActionManagerUndo/redo action management
EditorActorLayerManages placed actors in editor (15KB)
EditorActorPreviewActor preview rendering in editor
EditorCursorLayerEditor cursor management
EditorResourceLayerResource painting
MarkerLayerOverlayMarker layer visualization
TilingPathToolPath/road tiling tool (14KB)

Editor Widgets

WidgetPurpose
EditorViewportControllerWidgetEditor viewport input handling

Editor Widget Logic (separate directory)

  • Editor/ subdirectory with editor-specific UI logic files