Skip to content

Create an enemy

Prefab Type Notes
Spider Melee Fast; weak to melee and shotgun
OrcBrute Melee Resists melee and pistol
SkeletonArquebusier Ranged Weak to shotgun and explosion
MageBoss Boss Summons minions; starts inactive
MageBossMinion Minion Crow summoned by the boss

Prefabs/Enemy/Variants holds AI variants that change only behavior and kit: OrcBrute_Brute (surrounds), SkeletonArquebusier_Gunner, _Heavy (charged attack) and _Skirmisher (retreats and shoots).

Warning

Keep the prefab hierarchy (EnemyRoot > Sprite > BulletSpawn/EnemyUI, Colliders > Body) and Animator state names. They are part of the contract.

Create the enemy

  1. Duplicate the closest prefab (melee: OrcBrute; ranged: SkeletonArquebusier).
  2. On EnemyEntity, set the name (Enemy table key), classification (Standard/Boss/Minion), health, resistances, Start Inactive (ambushes, bosses), sounds and loot.
  3. On EnemyBrain, set behaviour (Enemy AI), aggro range and attackOptions. Without attack options the enemy never attacks.
  4. Replace sprites and clips in <Enemy>.overrideController (Sprites and animation).
  5. Optionally add phases or summoning (Ambushes and bosses).
  6. Add the name to the Enemy localization table, place it (one per cell) and save the scene to generate its mapId.

Set up the attack kit

Each EnemyAttackOption has a profile (TurnWeaponProfile in Data/Enemy/TurnProfiles), animationState (empty = Attack), useChancePercent (on failure, the next option is tried), cooldownTurns, a cell range, and optional charging (isCharged, chargeTurns, cancelOnDamage).

An attack fires only when the player is on the same row or column and is the first actor in line. The hit lands at the profile's ImpactNormalized (0 = clip start, 1 = last frame).

Set weaknesses and resistances

In Combat Settings, map each DamageType to a multiplier: 0 = immune, <1 = resistant, 1 or missing = normal, >1 = weak. Current values:

Prefab Melee Pistol Rifle Shotgun Plasma Explosion
SkeletonArquebusier 1.25 0.75 0.75 1.5 1.5
OrcBrute 0.75 0.75 1.25 1.5
Spider 1.25 1.25 0.75
MageBoss 1.25 0.5 0.75
MageBossMinion 1.25 1.25 0.75

Health and damage also scale with difficulty by classification.

Adjust the visuals

  • EnemySpriteOffset pulls the sprite toward an adjacent player (offsetInCells, default 0.25) and lunges on melee (lungeInCells, default 0.15). Tall enemies need smaller values (OrcBrute, SkeletonArquebusier: 0.15).
  • Keep the EnemyUI canvas about 15 cm above the head at world scale 0.01. Put BulletSpawn at the weapon tip.

Scenes need GridMap, TurnManager, Player, a MainCamera, LevelCore/LevelWorldTracker (medals, checkpoints) and GameObjectPoolManager (blood).