๐Ÿ•ฐ๏ธ Historical snapshot

This page is preserved for project history and is not the current reference. Use Enemies, Waves and Bosses for current information.

Enemies, Waves & Bosses

A server-driven enemy FSM feeds arena wave loops and phased world bosses. Enemy stats are template-driven from the database.

Enemy library

TypeBehaviourCounter
GruntLow HP, melee rush โ€” pack threatCleave / AoE
ShieldedFront absorb blocks projectilesFlank or AoE
Caster EliteChannelled ranged attackSilence / Stagger
BerserkerHigh damage, 3s charge windowDodge timing
Tether AnchorRoots nearest player until destroyedBurst it
Healer DroneRegenerates nearby enemiesFocus priority
World BossShared HP, phase abilities, immunity windowsDoT loads during immunity

Creature models in the build

Distinct creature art with its own animation drivers (behaviour archetypes above map onto these):

CreatureNotes
Field GhoulFieldGoulAnimationDriver; ambient melee. Some ambient ghouls are deliberately damageable-but-not-networked (each client kills its own copy).
GundaA named melee creature in Darkwood (Fields of Gundab area). Now authored as an Enemy Forge enemy (forged_Gunda_Enemy.prefab) with Attack, Chase, Death, and Idle animation clips via EnemyForgeClips/.
Cyclops (incl. Torch Bearer)CyclopsAnimationDriver; large melee.
O'gar Brute (Ogre)OgreAnimationDriver; networked via BCE โ–ถ Setup โ–ถ 4o (Identity + NT + NetworkAnimator).
WispWispMob + WispCombat; small ranged/support mob.
WandererEnemyWanderAI + EnemyWanderAnimationDriver; open-world roaming mobs.

Enemy hover UI (EnemyHoverController, EnemyHoverTooltipUI, EnemyHealthBar) shows name/HP on mouse-over. When an enemy's hierarchy contains multiple nested Health components, EnemyHoverController selects the component whose ConfiguredEnemyDisplayName is set, falling back to the topmost matching Health if none have a configured name. Enemy movement/leashing keeps NavMeshAgent mobs near spawn.

Visual slope alignment: EnemySlopeVisualAligner is attached automatically to every enemy-like entity on the client at OnStartClient (via Health.cs). It tilts only the enemy's visual hierarchy to match the terrain normal beneath them โ€” the NavMesh root stays upright so navigation, colliders, and Mirror replication remain stable. The tilt is clamped to a configurable maximum angle (default 35ยฐ) and smoothed each LateUpdate.

Forge-authored enemies

Beyond the hand-built creatures above, enemies are increasingly authored as data through Enemy Forge (Editor/EnemyForge/) โ€” a definition drives model, animation clips, stats, and behaviour, and the suite builds a networked prefab. Forge output populating the zones includes Templar, Wizard, Chaos Weaver (Chain Lightning), Devastator, Pummeler, AW Instigator, and Gunda. These are enemies, not player classes.

โš ๏ธ Templar name collision

The Forge-built Templar enemy is a zone mob and unrelated to the player class at index 1, which was also renamed to Templar on 2026-07-31. They share a name but are distinct: one is an EnemyForge-authored zone creature; the other is a player-controlled hero.

Forge-built enemies carry an EnemySfxProfile component that stores per-enemy audio clips (aggro, attack 1โ€“4, attack impact, get-hit, death) with volume, pitch variation, and spatial audio distance settings. When a clip is assigned, it overrides the shared CombatAudio fallback for that event on that enemy. Clips are authored in the Enemy Forge SFX section and written to the prefab at build time.

โ„น๏ธ Every enemy is a quest kill-target automatically

EnemyController.OnStartServer calls QuestEnemyTarget.EnsureAttached, so any enemy can satisfy a KillEnemy quest objective on death without extra wiring. Matching is by normalized enemy identity. See Quests & Quest Forge.

Heavy abilities

Forge-authored enemies with a cast attack configured use EnemyHeavyAttack โ€” a cooldown-driven system that fires a named spell on a server-authoritative schedule, interrupting the normal attack loop. The available heavy ability types are:

TypeEffect
Void BurstAoE at target position; applies slow + DoT
Chain LightningChains to up to 3 players; applies Weakened
Ground SpikesCone toward target; applies slow
Hex BlastSingle-target, heavy damage; applies Weakened + DoT
Elemental LightningComposite lightning cast with hand and impact phases; applies Weakened (4 s) to the primary target

Elemental Lightning requires an ElementalLightningVFXProfile ScriptableObject (hand effect, spell projector, hit effect). Enemy Forge creates this asset automatically at Assets/Game/Resources/EnemyAbilities/ElementalLightning.asset if one is not assigned. Enemies built before this type was introduced have no profile, so those prefabs use the previous random pool โ€” which excludes Elemental Lightning โ€” until a profile is explicitly assigned.

Patrol system

Enemies and non-networked NPCs can follow scene-authored patrol routes via two components added in the 2026-07-27 Patrol Forge commit:

  • EnemyPatrolRoute (MonoBehaviour) โ€” a scene object holding a list of Transform waypoints, a patrol mode (Loop, PingPong, or OneWay), waypointWaitSeconds, and arrivalDistance. Multiple agents can share one route; patrolObjects lists the mobs assigned to it. On server start, EnemyPatrolRoute.Update ensures each listed mob has an EnemyPatrolAgent component.
  • EnemyPatrolAgent (MonoBehaviour) โ€” the per-enemy patrol state. It ticks only while EnemyController.state == Idle (and the enemy has no current target and is not returning home), so combat and leash-return navigation always take priority. When aggro starts, SuspendForCombat() resets destination tracking. When combat ends, EnemyController.ResumePatrolOrReturnHome() resumes patrol if a usable route is present, or falls back to ReturnToSpawnPoint(). Non-networked scene NPCs (quest givers, decorative mobs with no NetworkIdentity) run patrol on each client locally.

Group formation patrol: when groupFormationPatrol is enabled on the route and preserveFormation is set on an agent, that agent offsets its destination by formationOffset (sideways and forward, in route-relative space) to maintain its authored slot within the group. Formation advance is continuous โ€” the first member to reach its slot advances the shared leg immediately; other members retarget and catch up in motion. Each agent's NavMesh speed is scaled between 0.78ร— and 1.35ร— its base patrol speed based on how far it is from the group's average slot distance, keeping the formation tight without stopping. On combat exit, GetSharedResumeWaypoint() picks the waypoint nearest the group's average position so all members converge on the same target before resuming the route.

Leash origin: when an enemy with a patrol route is pulled into combat, its combat leash (_combatLeashOrigin) is anchored at the position where aggro occurred โ€” not at the spawn point. This allows patrolling enemies to be engaged away from their spawn without immediately de-leashing.

Authoring: use BCE โ–ถ Patrol Forge (PatrolForgeWindow) to create a route, click waypoints into the scene view, and assign enemies. See Editor Tooling.

Server components

  • EnemyController โ€” per-enemy FSM (Idle/Chase/Attack/Dead), [Server]-gated loop, NavMeshAgent movement, enemyTemplateId links to the DB template. On death, posts hit+kill to /api/combat/kill.
  • WaveSpawner โ€” the live, networked arena loop (waves, difficulty ramp, elite cadence, session tracking). Not WaveManager, which is orphaned legacy โ€” always edit WaveSpawner.
  • WorldBossController โ€” phased boss with SyncVars driving the HUD boss bar.
  • StatusEffectManager โ€” the debuff/buff layer that abilities read and write.
โ„น๏ธ Balance config

Balance is centralized in Resources/CombatBalanceConfig โ€” the asset must exist or fallback values apply. Mob leashing (leashRadius default 20u) keeps NavMesh agents near their spawn, which also matters for multi-zone NavMesh overlap โ€” see Zones, Scenes & Multi-Zone.

โš ๏ธ Enemy networking gaps

Base-enemy prefabs needed NetworkTransform (fixed via BCE โ–ถ Setup โ–ถ 4n). Some ambient NPCs (Field Ghouls) are deliberately damageable-but-not-networked โ€” each client kills its own copy, a Mirror-discipline violation tracked in Known Issues & Tech Debt. The O'gar Brute ogre was networked (BCE โ–ถ Setup โ–ถ 4o).


Related: Combat Core & Loop ยท Ability Atlas & Synergies ยท Loot, Inventory & Crafting