Skip to content

Ambushes and bosses

Ambush enemies and bosses must have Start Inactive on (EnemyEntity, Activation). Inactive enemies don't act or take damage until an EnemyActivateTrigger, ambush wave, BossEncounterManager or EnemyEntity.ActivateEnemy() activates them.

Set up an ambush

Prefabs/Level/TriggerAmbush (EnemyAmbushTrigger) runs waves: when the player enters, music switches to ambushMusic (default volume 0.6; no clip = level music continues), each wave activates after waveDelayTurns and the portal animation, the next starts when all die, and at the end the level music returns and ambushEndClip plays.

Recipe from E1M2_Underground (room locks when you grab the key):

  1. Place the key in the room and an entrance door with startOpen on and triggerMode = None.
  2. Place the enemies with Start Inactive.
  3. Cover the 3×3 cells around the key with a TriggerAmbush and add the enemies to a wave (EnemyWave).
  4. Wire OnAmbushActivated → Door.CloseDoor and OnAllWavesCompleted → Door.OpenDoor.

Checkpoints

Only "ambush fired" is saved. On load, music, portals and events don't repeat; survivors of all waves activate in place. The current wave index is not saved.

Set up a boss fight

BossEncounterManager handles presentation (health bar, door, events), not AI.

  1. Place the boss (e.g. Prefabs/Enemy/MageBoss) with Start Inactive and classification Boss.
  2. Add BossEncounterManager to an object with a BoxCollider covering the whole arena.
  3. Assign bossEntity; optionally exitDoor, bossDisplayName (empty = enemy name), onBossEncounterStart and onBossEncounterEnd.

On entry, the boss activates (it takes no damage before, even from outside the arena), exitDoor closes and the boss bar appears. Only the boss's death ends the encounter, opening the door; leaving the arena doesn't, and it never restarts.

Add minions and phases

Both components work on any enemy:

  • EnemyMinionSummonAbility summons minions in free nearby cells (prefab, count, radius, cooldown in turns, max player distance). Needs a behavior with Action_Summon, like Behaviour_Boss.
  • EnemyPhaseController defines phases by health percentage, each with damage multipliers, regeneration, a replacement attack kit, entry animation and event. Phases only advance (e.g. 100 → 60 → 30).

See Enemy AI.