Skip to main content

Definitions and runtime instances

Guide

Distinguish reusable content definitions from live battle instances so runtime changes never become authoring-asset edits

Build battle state from authored definitions

The diagram above establishes the GCS data boundary. The Game Card Editor stores reusable content definitions. When an Encounter starts, runtime uses those definitions to create the units, cards, statuses, and piles for that battle. Live HP, costs, stack counts, and card locations belong only to their current instances and are not written back to authored assets

Unit definitions and unit state

ContentStored dataLifetime
GamePlayerUnitName, base HP, energy presentation, Starting Deck, Prefab, and artReusable project asset
GameEnemyUnitName, HP range, Tier, Prefab, Intent, and BehaviorReusable project asset
UnitStateCurrent and maximum HP, Armor, team, alive state, status stacks, and active HooksCurrent battle
EnemyUnitStateAll UnitState data plus the current Intent and Pattern progressCurrent battle

When an enemy enters battle, its starting HP is chosen from the definition's inclusive range. Editing the original GameEnemyUnit in the Inspector afterward does not update an existing EnemyUnitState

Card definitions and card instances

ContentStored dataUsed for
GameCardName, description, base cost, type, rarity, Target, art, and BehaviorContent authoring, database queries, and deck configuration
CardInstanceInstance ID, base-card reference, upgrade state, and instance cost changesHand, draw pile, discard pile, and exhaust pile
Active CardBase card or current upgraded variantCard-face display and actual resolution
Effective CostFinal result of base cost, Run modifiers, temporary rules, and cost HooksPlay validation and battle UI
tip

Two copies of Strike can share one GameCard while remaining separate CardInstance objects in the piles. Upgrading one or changing its temporary cost does not affect the other

Runtime operations should receive instances; content browsing, deck configuration, and database lookup use definitions. See card and pile lifecycle for complete pile rules

Status definitions and unit stacks

GameStatus stores the name, description, icon, stack rule, cap, decay rule, and Behavior. During battle, UnitState records only which statuses that unit currently holds, how many stacks it has, and the known applier. Changing GameStatus.MaxStacks affects later status resolution, but changing the stacks already held by one unit requires a runtime entry. See status lifecycle for application, decay, and expiration rules

GameDeck, Master Deck, and battle piles

These three data layers serve authored configuration, cross-battle progression, and the current battle respectively

LayerPurpose
GameDeckConfigure a player's Starting Deck or an Encounter's reward pool
Run Master DeckPersist cards, upgrade state, and cost changes across battles in the same Run
Battle pilesStore the current battle's CardInstance objects and their ordered locations

A new battle creates its piles from the Run Master Deck or the player's Starting Deck. Changing the Master Deck after battle start does not retroactively alter those piles

Choose the correct data layer

NeedObject to modify
Change the base cost of every Strike created laterGameCard definition
Change the cost of one Strike in the current battleSupported cost rules on that CardInstance
Change an enemy's authored HP rangeGameEnemyUnit definition
Change the current enemy's HPModify EnemyUnitState through GCSApi or Controller
Change status stacking or decay rulesGameStatus definition
Change a status count currently held by one unitUse the status API or a FlowGraph node
Change the deck used by future battles in the RunMaster Deck
Move a card in the current battleIts CardInstance in the battle piles

Inspect live Play Mode data in Game Card Monitor. The Inspector shows authored definitions, not battle instances that have already been created

Read and modify safely

Project code should prefer named GCSApi methods:

  • Read current state through methods such as Player(), AliveEnemies(), Hand(), and StatusesOn()

  • Submit changes through methods such as DealDamage(), GainArmor(), ApplyStatus(), and MoveCardToPile()

  • Modify state from custom nodes through ctx.Controller

tip

These entries run the corresponding Hooks, boundary checks, event notifications, and Monitor records. Directly editing fields or collections on live objects may produce a temporarily correct value while leaving other systems without a synchronization signal

See the API guide for complete code entry points and API reference for available members