Skip to content

Enemy & AI Design

Source: Extracted and expanded from master_gdd.md §7.
Status: DRAFT — enemy stats are placeholder. Behavior scripts need prototyping.


Table of Contents

  1. AI Philosophy
  2. Behavior Archetypes
  3. Enemy Factions by Island
  4. Enemy Catalog
  5. Boss Designs
  6. Difficulty Scaling
  7. MVP Scope
  8. Open Questions

1. AI Philosophy

Enemies don't play to win. They play to create puzzles.

Every enemy's actions are:

  • Fully telegraphed — move, ability, target, damage, and timing all visible on the timeline
  • Deterministic — same game state always produces the same enemy decision
  • Scripted, not adaptive — enemies follow behavior archetypes, not a minimax AI

The question is never "what is the enemy doing?" — it's "how do I respond to what I know is coming?"

What Enemies DO Know

  • All unit positions on the grid
  • Their own behavior script
  • Their target's current HP and status

What Enemies DON'T Know

  • Player's future moves (they react to current state only)
  • Player's aspect synergies or relic effects
  • Optimized tactics — they follow scripts, not strategy

2. Behavior Archetypes

2.1 Brute

PropertyValue
Target selectionNearest enemy (shortest path distance)
Attack priorityHighest HP target (they're tanky, they fight tanky)
MovementDirect path toward nearest enemy
Disruption responseIf taunted: switch to taunter. If rooted: attack nearest reachable.
Threat levelMedium — predictable, tankable
CounterplayBody-block with tank. Kite (Brutes are slow). Push into hazards.

Behavior Script:

1. Find nearest enemy by path distance.
2. If adjacent to any enemy: Strike highest HP adjacent enemy.
3. Else: Move toward nearest enemy (max move range).
4. If enemy is 1 tile out of reach after moving: wait (don't end turn in threat range without attacking).

2.2 Flanker

PropertyValue
Target selectionFurthest enemy from the main group OR lowest DEF enemy
Attack priorityIsolated targets (no allies adjacent)
MovementCircuitous routes, avoids the "front line"
Disruption responseIf blocked: find alternate path. If taunted: may ignore taunt (50% chance).
Threat levelHigh — can delete backline if not controlled
CounterplayDon't isolate units. Body-block flank routes. Root/Slow.

Behavior Script:

1. Find enemy with fewest adjacent allies (target isolation).
2. If adjacent to isolated target: Strike.
3. Else: Move toward isolated target, preferring routes that avoid enemy front-line units.
4. If no safe route exists: attack nearest enemy instead (fallback to Brute behavior).

2.3 Artillery

PropertyValue
Target selectionLargest cluster of enemies (maximize AoE value)
Attack priorityTargets that JUST moved into cluster (punishes stacking)
MovementAway from nearest enemy. Maintains range.
Disruption responseIf enemy adjacent: move away (flee), then cast if possible. If can't flee: cast at adjacent enemy (desperation).
Threat levelHigh — AoE damage can swing battles. But cancelling their charge is prime counterplay.

Behavior Script:

1. Find largest cluster of enemy units (density = units in 2-tile radius).
2. If optimal AoE target found: Cast AoE spell at cluster center. Charge time applies.
3. Else: Cast single-target spell at nearest enemy.
4. Move away from nearest enemy (maintain ≥ 3 tile gap).
5. If enemy is within 2 tiles after moving: prioritize fleeing over optimal targeting.

2.4 Guardian

PropertyValue
Target selectionNearest enemy threatening their protected target
Attack priorityEnemies adjacent to protected target
MovementStay between protected target and nearest enemy
Disruption responseCannot be taunted (already protecting something). If displaced: move back to guard position.
Threat levelLow offensively, HIGH defensively — you must deal with the Guardian before the protected target.

Behavior Script:

1. Identify protected target (specific ally or objective).
2. If enemy adjacent to protected target: Strike that enemy (or Taunt them if ability available).
3. Else: Move to tile between protected target and nearest enemy.
4. If no enemies near protected target: Fortify / Body-block for protected target.
5. Never move more than 3 tiles from protected target.

2.5 Swarm

PropertyValue
Target selectionSame target as nearest other Swarm unit (focus fire)
Attack priorityAlready-damaged enemies (finish off wounded)
MovementSurround target — occupy all adjacent tiles
Disruption responseIf one Swarm dies: others don't change behavior (they're replaceable).
Threat levelLow individually, HIGH in numbers — surround → dead.

Behavior Script:

1. Find the same target as another Swarm unit (prefer already-damaged).
2. Move to adjacent tile that contributes to surround (prefer tile with no current occupant).
3. Strike.
4. If no surround target available: attack nearest enemy.

2.6 Trickster

PropertyValue
Target selectionRandom among top 3 "optimal" targets (appears unpredictable)
Attack priorityVaries. Some actions show (?) on timeline.
MovementErratic — sometimes toward, sometimes away
Disruption responseMay teleport when threatened
Threat levelVariable — unpredictable, forces adaptation
CounterplayKill them first. They're fragile. Don't try to predict — just remove.

Behavior Script:

1. Roll for action: 40% attack, 30% debuff/control, 30% reposition.
2. If attacking: choose random valid target from top 3 optimal.
3. If debuffing: target highest-stat enemy with most impactful debuff.
4. If repositioning: teleport to tile that is safe AND has LOS to future targets.
5. 25% chance any action shows (?) instead of specifics on timeline.

3. Enemy Factions by Island

Island 1: The Unwoven

UnitArchetypeHPATKMAGDEFSPDAbilities
Stone GolemBrute205083Slam (AoE 1, 4 dmg), Harden (+4 DEF, 1 tick)
Timber WolfFlanker1040210Bite (5 dmg), Pack Howl (+2 SPD to all wolves for 2 ticks)
SpriteArtillery81516Arcane Bolt (5 dmg, 1 tick charge), Teleport (2 tiles)
Vine HorrorGuardian183254Vine Whip (4 dmg, pull 1), Root (target Immobilize 2 ticks)
Thorn RatSwarm63017Bite (3 dmg), Scurry (+2 move when HP < 50%)

Island 2: The Ember Court

UnitArchetypeHPATKMAGDEFSPDAbilities
Fire ElementalArtillery122826Fireball (6 dmg, AoE 1, 1 tick), Immolate (melee attackers take 2 dmg)
Cultist PyromancerArtillery101715Flame Wave (5 dmg, line 3, 1 tick), Inferno (AoE 2, 2 ticks)
PyroclastBrute226064Magma Strike (7 dmg, leaves lava on tile), Eruption (3 dmg AoE 2)
SalamanderFlanker145239Fire Fang (5 dmg + Burning), Lava Swim (move through lava unharmed)
Ember WraithTrickster103528Smoke Veil (Invisible 1 tick), Fire Curse (target takes +50% fire dmg)
Obsidian GargoyleGuardian204084Stone Form (immobile, +6 DEF, taunt), Wing Buffet (push 2)

Island 3: The Timeless (v0.2 — deferred)

Full faction designed but deferred to post-MVP. Echo Knight, Paradox, Chronomancer, Phase Wraith, Void Spawn. Time manipulation and void mechanics. Boss: Time Warden.


4. Enemy Catalog (Detailed)

4.1 Stone Golem

BEHAVIOR: Brute
ISLAND: 1 (Plains)
TIER: Common (can appear as Elite with +10 HP, +2 ATK)

STATS: HP 20 | ATK 5 | MAG 0 | DEF 8 | SPD 3
MOVE: 2 tiles

ABILITIES:
  Slam [Tier 0]: 4 physical damage. 2×2 AoE centered on self. Charge: 0 ticks.
    Telegraph: "Slam" with 2×2 red overlay.
  Harden [Tier 0]: +4 DEF for 2 ticks. Charge: 0 ticks.
    Telegraph: Shield icon on golem.

ASPECT DROP: Common Defense (Shield, Stone Skin, or Parry)

TACTICAL NOTES:
  - Slowest enemy in the game. Easy to outmaneuver.
  - Slam AoE means don't cluster units around it.
  - Excellent target for Slow/Root — it already barely moves.
  - Harden makes it very tanky for 2 ticks. Either burst it before Harden or wait it out.

4.2 Timber Wolf

BEHAVIOR: Flanker
ISLAND: 1 (Plains)
TIER: Common

STATS: HP 10 | ATK 4 | MAG 0 | DEF 2 | SPD 10
MOVE: 3 tiles

ABILITIES:
  Bite [Tier 0]: 5 physical damage. Melee. Charge: 0 ticks.
  Pack Howl [Tier 0]: All Timber Wolves in battle gain +2 SPD for 2 ticks. Charge: 0 ticks.
    Telegraph: Howl icon on wolf + affected wolves highlighted.

ASPECT DROP: Common Movement (Sprint) or Common Function (Beastmaster)

TACTICAL NOTES:
  - Fast. Will reach your backline turn 1 if you're not careful.
  - Pack Howl makes ALL wolves on the map faster — kill them before they stack buffs.
  - Low HP means any Strike kills it in 2 hits.
  - Target priority: kill wolves before they surround a unit.

5. Boss Designs

5.1 Golem (Island 1 Boss)

PropertyValue
ThemeAncient stone guardian, awakened by the Unwoven
ArenaRuined temple. Central platform (+1), surrounding ground (0), broken pillars (cover)
HP60
ATK8
DEF6
SPD3

Phases:

PhaseHP ThresholdBehavior
1 (Stable)100% – 60%Ground Slam (telegraphed 1 tick): 6 dmg, AoE 2 around self. Boulder Throw (telegraphed 1 tick): 8 dmg, line of 3 tiles, knockback 1. Pattern: Slam → Throw → Wait → Repeat.
2 (Cracked)60% – 25%Adds Roll (telegraphed 2 ticks): 10 dmg in a 4-tile line. Golem repositions to edge of arena, then rolls across. Pattern: Throw → Roll → Slam → Repeat.
3 (Core Exposed)< 25%+2 SPD. All attacks charge 1 tick faster. Desperation Slam: AoE 3 instead of 2. Collapse: Every 3rd turn, a random arena pillar crumbles (1-tile AoE, 4 dmg).

Arena Hazards:

  • 4 pillars (HP 5, blocks LOS). Golem can destroy pillars with Roll.
  • If all 4 pillars destroyed: Golem gains +2 ATK (enraged).

Aspect Drop: Rare Key Aspect (random, weighted toward Knight/Shaman).


5.2 Wyrm (Island 2 Boss)

PropertyValue
ThemeAncient lava wyrm, lord of the caldera
ArenaVolcanic crater. Central lava pool (hazard), ring of solid ground (0), elevated ledges (+1,+2)
HP70
ATK9
DEF4
SPD6

Phases:

PhaseHP ThresholdBehavior
1 (Burrowed)100% – 70%Wyrm starts BURROWED (untargetable). Telegraphed eruption: marks 3×3 AoE 2 ticks in advance. Erupt (8 dmg in AoE). After erupting: emerges for 2 turns. Pattern: Burrow → Mark → Erupt → Emerge → Attack ×2 → Burrow.
2 (Enraged)70% – 30%Faster burrow cycle (burrow every 2 turns instead of 3). Adds Lava Breath (telegraphed 2 ticks): 5 dmg in cone (4 tiles), leaves lava tiles. Adds Tail Sweep (when emerged): 3 dmg to all adjacent, push 1.
3 (Molten)< 30%Entire arena: lava rises 1 tile around edges. Safe zone shrinks. Wyrm heals 3 HP/tick while in lava. Eruption AoE increases to 4×4.

Arena Hazards:

  • Central lava pool (damage/tick, expanding in Phase 3).
  • 3 basalt pillars (HP 5, explode on destruction: 3 dmg AoE 1).

Aspect Drop: Rare Function Aspect (random, weighted toward Warlock/Engineer).


6. Difficulty Scaling

Enemies at higher difficulty don't gain more HP. They gain behaviors and speed.

Difficulty Modifiers

ModifierNormalHardLethalBreach
Enemy HP multiplier1.0×1.0×1.1×1.2×
Enemy move rangeBase+1+1+1
Enemy charge speedBaseBase−1 tick−1 tick
New behaviorsNone1 per faction2 per faction3 per faction
Synergy pairsNoneNone1 per fight2 per fight
(?) telegraphsNoneNoneNone1 per fight
Enemy countBase+1 per fight+2 per fight+2 per fight

Example: Stone Golem Scaling

DifficultyChanges
NormalBase (see §4.1)
Hard+1 move (3 tiles). Harden also grants +2 ATK.
Lethal+1 move. Harden buffs all allies in 2-tile radius. Pairs with Timber Wolf (wolf flanks while golem tanks).
Breach+1 move. Harden AoE buff. Slam shows (?) for AoE size (could be 2×2 or 3×3). Golem + Sprite synergy pair.

7. MVP Scope

Included

  • [x] 2 factions (Unwoven, Ember Court) — 10 enemy types
  • [x] 6 behavior archetypes (all implemented)
  • [x] 3 difficulty levels: Normal, Hard, Lethal
  • [x] 2 boss fights: Golem + Wyrm
  • [x] Full telegraph system for all enemy actions

Deferred to Post-MVP

  • [ ] Island 3 faction (The Timeless) — 5 enemy types
  • [ ] Breach difficulty
  • [ ] Boss Phase 3 animations/VFX polish
  • [ ] Trickster (?) telegraph implementation (needs careful balance)
  • [ ] Additional synergy pairs for Lethal+ difficulties

8. Open Questions

  1. Enemy scripting language: Behavior scripts are described in pseudocode above. Should they be data-driven (ScriptableObject + enum flags) or fully scripted (Lua/Python-style embedded scripting)? Data-driven is simpler. Scripting is more flexible for complex bosses.
  2. Boss respawn on retry: If the player dies to a boss, do they retry the boss fight or restart the island? (Recommend: retry boss fight. Roguelike runs should end on death, not force island replay. But this contradicts permadeath philosophy — death IS the end of the run.)
  3. Elite enemy markers: How does the player know an enemy is Elite vs Common? Visual: larger model, crown icon, unique name color. What distinguishes them on the timeline?
  4. Faction mixing: Can enemies from different factions appear in the same fight? (Recommend: no. Factions are island-locked. Exception: boss fights may summon adds from any faction.)
  5. Enemy aspect drops: Every enemy drops an aspect. Does this flood the player? Common enemies drop Common aspects — which convert to 25 EXP if duplicate. Is this satisfying feedback or inventory busywork?
  6. AI for co-op: Does enemy behavior change with 6–8 player units on the field? (Recommend: same behavior scripts, but target selection pool is larger. Swarm units may split across both players' squads.)

Next: Tone & Narrative

Markdown is the canonical GDD source.