Skip to main content

Enemy Authoring

GCS ยท Authoring

Define an enemy's identity, HP range, and the behavior graph that picks intents and acts on them.

For developers building opponents in Workbench Enemy mode.

Enemies are reusable battle units. An enemy definition controls identity, HP range, tier, presentation, and the FlowGraph that chooses what the enemy plans to do and then does it. Author them in Workbench > Enemy; the demo's 16 enemies, from the lowly Strawman to the Mire Reaper, all come from this mode.

Workbench Enemy mode with the enemy list, the attributes inspector, and the unit preview


Authoring orderโ€‹

  1. Fill Name, Description, Tier, and Tags.
  2. Assign Icon and Template if presentation assets exist.
  3. Set HP Min and HP Max.
  4. Open Edit FlowGraph and build a predictable first behavior.
  5. Add the enemy to an encounter and test a full turn cycle.

Begin with predictable behavior. A deterministic enemy that always attacks for 6 is a better testing tool than a complex one whose behavior you cannot reproduce.


Basic fieldsโ€‹

FieldWhat it does
NameIn-game display name. When not empty, the Workbench also renames the asset to match; when empty, validation reports an error.
DescriptionFlavor or role text shown on the enemy display.
TierDifficulty grouping. Defaults to Normal; the dropdown offers Normal, Elite, and Boss plus any label already in use, and typing a new one creates it.
TagsFree-form labels for filtering and targeting.

Tier is a label, not behavior. A Boss enemy still needs the HP, intents, and graph that make it play like a boss. Custom tiers are cheap to invent when a grouping is real: the demo adds a Summon tier for units such as the Stitched Hound that only enter mid-battle.


Visual fieldsโ€‹

Icon is the portrait sprite used in UI and in the Workbench list rows. Template is the prefab spawned to represent the unit in battle. The preview column renders the assigned Template live, with rotate, pan, and zoom, so a missing or badly scaled prefab is visible long before Play Mode. If final art is not ready, borrow a demo prefab while you test mechanics; presentation should never block behavior work.


Attributesโ€‹

FieldWhat it does
HP MinLower bound of the starting-HP roll. The editor keeps it at 1 or above.
HP MaxUpper bound of the roll, inclusive. The editor keeps it at or above HP Min.

Starting HP is rolled once, when the unit spawns, inside this inclusive range; the demo Strawman, for example, enters battle with 14 to 18 HP. Keep the range narrow while testing. A wide roll makes it harder to tell whether card damage, status ticks, and death behavior are actually correct.

Workbench Enemy mode with Strawman selected: HP range 14 to 18, tier, tags, template, and the behavior summary in the inspector


Behavior graphโ€‹

Click Edit FlowGraph in the Behavior section. An enemy graph has two jobs:

JobPlayer-facing result
Choose intentThe battle UI shows what the enemy plans to do next turn.
Resolve actionThe enemy acts during the enemy phase.

The demo enemy Mire Reaper's behavior graph, with pattern nodes selecting intents that resolve into actions

Once the graph has content, the Behavior foldout shows a summary line such as the Strawman's Patterns 1 ยท LeafIntents 3 ยท Actions 4. Treat it as a quick sanity check, not a substitute for Play Mode: it tells you the graph has structure, not that the structure is right.

Strawman's intent graph in the FlowGraph Editor, the graph behind its Patterns 1 ยท LeafIntents 3 ยท Actions 4 summary

The preview column goes one step further. Its Intents foldout reads the graph and charts the intent mix, Attack 1 ยท Defend 1 ยท Special 1 for the Strawman, so you can see how the enemy's plans are distributed without entering Play Mode.

The preview's Intents foldout for the Strawman: a distribution bar over Attack 1, Defend 1, and Special 1, labeled 3 groups, 3 total

info

How much of the intent the player sees is not decided here. The encounter's battle rules set the intent display mode (Hidden, IconOnly, or Full), so the same enemy can telegraph everything in one encounter and nothing in another.


Encounter placementโ€‹

An enemy appears in battle only when an encounter references it. Open Workbench > Encounter, select an encounter, and add the enemy under Enemy Units. An encounter with no enemy units fails validation, so this link is hard to miss. Going the other way, the Used By panel in the enemy's preview column lists the encounters that field it, which is the quickest route to a scene where you can test it.

For first tests, field a single enemy. Add multi-enemy lineups only after one enemy can spawn, show its intent, act, and die cleanly.


Validationโ€‹

Enemy mode reports:

  • An empty Name as an error.
  • HP Min greater than HP Max as an error.
  • FlowGraph validator findings as warnings.

Validation proves the definition is structurally safe to test. Whether the enemy is fun is still your call to make in Play Mode.


Common mistakesโ€‹

SymptomLikely cause
Enemy never appearsNo active encounter references it, or the enemy database is inactive.
Enemy shows no intentThe graph never sets an intent, or the encounter's intent display mode is Hidden.
Enemy turn does nothingThe graph chooses an intent but has no action path that resolves it.
HP differs every runHP Min and HP Max define an inclusive random range. Narrow it for controlled tests.
Missing model or portraitTemplate or Icon is not assigned.