Read legal actions, test future states, choose the next move.
The game engine enforces the rules while the AI compares actions. Game-specific behavior lives in a Strategy Profile and runs through one shared AI runtime.
The current focus is improving win paths, resource allocation, and search speed together. AI behavior and evaluation rules remain under active development.
Overall AI architecture
Ten components connect across three layers: inputs, reasoning, and execution and improvement.
Inputs
- Strategy profile
- Visible state
- Legal actions
- Action candidates
Reasoning
- Game plan
- Resource use
- Sequence search
- Opponent response
Execution & improvement
- Evaluate & execute
- Trace & improve
Decision principles
The engine guarantees legality
The AI compares only legal commands generated by the engine instead of duplicating the rules.
Only public information
The AI never reads the opponent's hidden hand. It estimates ranges from hand size and revealed cards.
Configuration defines game differences
Search limits and defense policies come from configuration, without game-ID branching in the shared runtime.
Decisions are reproducible
Candidates, rejection reasons, search performance, and outcomes are recorded in a decision trace.
Ten components
- 01
Strategy profile
Defines search limits, plan archetypes, resource and defense policies, and feature toggles by game.
- 02
Visible state
Converts the board, hand size, life, resources, status, turn, and phase into decision inputs.
- 03
Legal actions
The game engine generates commands that are valid in the current state.
- 04
Action candidates
Normalizes attacks, resource attachment, card play, defense, and no-response choices for comparison.
- 05
Game plan
Reconsiders primary, fallback, and emergency plans as the game changes.
- 06
Resource use
Compares board development and effective attacks as one action sequence.
- 07
Sequence search
Tests multiple actions in cloned states and keeps promising sequences.
- 08
Opponent response
Models strong opponent defenses including blockers and counters.
- 09
Evaluate & execute
Compares outcome, plan progress, pressure, and future value in priority order.
- 10
Trace & improve
Replays decision history to improve settings, search limits, and card-effect definitions.
Game-specific Strategy Profiles and one shared runtime
The same AI runtime can use different reasoning policies and search limits for each TCG. Profiles are validated and normalized before entering the shared runtime.
Profile
- Search limits
- Plan archetypes
- Resource and defense policies
- Feature toggles
Shared runtime
- Decision inputs
- Action search
- Defense policy
- Choice resolution
- LLM integration
- Decision trace
Visible state and legal actions
The AI receives visibility-filtered decision inputs and legal actions generated by the engine. It does not read arbitrary game state. Every cloned state regenerates its own legal actions during search.
- Effective BP
- Ready / used
- Blockers
- Counter estimate
- Next-turn resources
Plans and resource allocation
The AI does more than play the highest-cost card. It compares how board development and attacks advance the active plan.
Primary plan
Apply sustained pressure to the opponent's life
Fallback plan
Develop the board and maintain the resource curve
Emergency plan
Protect life and remove threats from the opponent's board
A 7 DON!! action sequence
One candidate plays a 5-cost character, then attaches the remaining 2 DON!! to turn a low-BP card into an effective attack.
- Add one character to the board
- Force one life or counter decision
- Preserve an attacker for the next turn
Multi-step search with cloned states
The AI clones the current state and tests attacks, resource attachment, card play, opponent responses, and follow-up actions. It avoids duplicate work and keeps promising sequences.
Strategy Profiles can change these limits. A shared queue schedules heavy simulations across concurrent matches.
- Depth
- 5
- States
- 48
- Branches
- 6
- Time
- 5 sec
Opponent response and worst-case evaluation
The AI assumes the opponent chooses the strongest available block or counter, then compares sequences that still hold. Estimates never become certain information.
- Hand size
- Counters used
- Revealed cards
- Trash
Qualitative evaluation and execution control
The AI does not collapse every decision into one fixed score. It compares sequences using priorities and independent dimensions, executes only the first action, then evaluates the resulting state again.
- 1Win now or avoid defeat
- 2Advance the active plan
- 3Pressure life, hand, and blockers
- 4Preserve board, hand, and next-turn value
- Board value
- Life pressure
- DON!! efficiency
- Next-turn value
- Removal risk
Decision traces and continuous improvement
A JSONL decision trace records candidates and rationale, actual state transitions, search time, and states explored. Match logs make decisions reproducible and support settings and regression-test improvements.
- 01
Decide
- 02
Execute
- 03
Measure
- 04
Improve
Decision traces never record hidden information.