Skip to main content

Enemy Quick Start

GCS ยท Quick Start

Author one enemy unit in Workbench Enemy mode, wire a predictable intent graph, and field it as a controlled test target.

For developers who already have a card or status working and now need an opponent that behaves the same way every run.

Cards and statuses are hard to debug against an opponent that acts randomly. This page builds the opposite: an enemy with a narrow HP range and one repeatable action. When a Play Mode run surprises you afterwards, the surprise is in your card, not in the enemy.

Open Enemy modeโ€‹

Open the Workbench and switch to the Enemy tab:

Tools/TinyGiants/GCS/Game Card Editor

The left column lists enemy units from the enemy databases registered on the scene GameCardManager. With the demo content active you should see 16 entries from PresetEnemyUnitDatabase. An empty list means no enemy unit database is active; fix that on the manager before continuing.


Create the enemyโ€‹

Create a new enemy, or duplicate a simple demo enemy and edit the copy. The inspector groups its fields into four foldouts:

FoldoutFieldWhat it controls
BasicNameShown in editor lists and battle UI.
BasicDescriptionA short role note. Useful in the editor even if your game never displays it.
BasicTierA grouping label such as Normal, Elite, or Boss. Start with Normal.
BasicTagsOptional class, biome, or faction labels for filtering.
VisualIconThe portrait sprite for UI and list rows.
VisualTemplateThe prefab spawned to represent the unit in battle. Reuse a demo enemy's until final art exists.
AttributesHP Min / HP MaxThe range the unit's max HP is rolled from at battle start.
BehaviorEdit FlowGraphThe enemy graph that decides intents and executes the enemy turn.

Each battle rolls the enemy's max HP once, anywhere between HP Min and HP Max with both ends included. Keep the range narrow for a test enemy (18 to 24 works well) so repeated runs stay comparable. The demo Strawman uses 14 to 18 for exactly this reason:

Workbench Enemy mode with the Strawman selected: Basic, Visual, Attributes, and Behavior foldouts in the inspector, the render and intent distribution in the preview

Once the fields are filled, you should see your enemy in the list with its tier chip and HP range, and the Preview column rendering its template.


Give it a predictable intentโ€‹

Press Edit FlowGraph in the Behavior foldout. The graph window opens with the enemy's name in its title, <Asset Name> / FlowGraph.

An enemy graph answers two questions every round: what the enemy telegraphs (the intent icon players see above the unit), and what actually happens when the enemy acts. GCS resolves the intent at the start of the round, shows it, then executes the same decision during the enemy phase.

For a first enemy, answer both questions with one fixed path:

  1. Start from the On Enemy Behavior Start entry.
  2. Add a Leaf Intent node. Its Intent dropdown already reads Attack, which is the icon players will see.
  3. Follow it with a Deal Damage action and set a small Amount, such as 4. Its Target dropdown defaults to Opponent, which on an enemy graph resolves to the player.

Back in the Workbench, the Behavior foldout should now read Patterns 0 ยท LeafIntents 1 ยท Actions 1 under the button, and the Preview's Intents panel should show a single Attack group.

The built-in Intent nodes cover the patterns you will want later:

NodeWhat it decides
Leaf IntentDeclares the intent the unit telegraphs, then runs its action chain.
Sequence PatternCycles through its steps in a fixed order across turns.
HP Threshold PatternSwitches branch once the unit's HP percentage drops below a threshold.
Weighted Random PatternRolls one branch per turn using weights.
Once Per BattleRuns its body branch the first time, never again.
Every N TurnsRuns its body every Nth turn.

Resist the random and threshold patterns until the flat version works in battle. When you want a reference for a bigger graph, open a demo enemy's Behavior; the Mire Reaper, the boss of the Hunter scene Mire of the Reaper, chains an HP Threshold Pattern into a Weighted Random Pattern before its Leaf Intents:

The Mire Reaper&#39;s Behavior graph in the FlowGraph window: an HP Threshold Pattern feeding a Weighted Random Pattern, which branches into several Leaf Intent action chains


Put the enemy in an encounterโ€‹

An enemy definition never enters battle on its own; an encounter has to reference it. Switch to Encounter mode, pick a test encounter or duplicate a small demo one (The Threshing Field fields exactly one enemy), and add your enemy to its Enemy Units list. One enemy is enough for the first run.

You should see your enemy in the Enemy Units foldout with its tier and HP range, and in the Preview's Lineup panel facing the player unit.


Test in battleโ€‹

Start the encounter in Play Mode and check:

  • The enemy spawns at the expected board position.
  • Its HP falls inside the configured range.
  • The intent icon appears (the encounter's Enemy Intent Display rule must not be Hidden).
  • Ending your turn makes the enemy act.
  • Player HP or armor changes by the amount your graph deals.
  • The enemy dies when its HP reaches zero.
tip

The Game Card Monitor (Tools/TinyGiants/GCS/Game Card Monitor) shows live HP and status stacks in its Unit tab while you play. Watching values there beats squinting at battle UI.


Common mistakesโ€‹

SymptomLikely cause
Enemy does not spawnThe encounter does not reference this enemy, or its enemy database is not active.
HP varies too much between runsHP Min and HP Max are far apart. Tighten the range while testing.
No intent iconThe graph never reaches a Leaf Intent node, or the encounter rule hides intents.
Enemy turn does nothingThere is no connected action path after the intent, so the enemy telegraphs but never acts.
Enemy art is missingTemplate or Icon is unassigned.