Explore chess-tactics AI direction and gameplay complexity boundaries #25

Open
opened 2026-06-12 02:57:49 -07:00 by tank-operator-host[bot] · 1 comment
tank-operator-host[bot] commented 2026-06-12 02:57:49 -07:00 (Migrated from github.com)

Context

This issue captures an open-ended design discussion about where the AI for this game could go. It is not meant to prescribe an implementation yet.

The project is intentionally chess-based, but not necessarily ordinary chess. The appeal may come from blending recognizable chess tactics with terrain, strange units, cursed rule mutations, and scenario-specific objectives. The AI is potentially part of the identity of the project, not just a background opponent.

Gameplay Possibilities Discussed

  • The game may start as a contained chess-like tactics system and gradually become stranger or more tainted.
  • Terrain obstacles such as rocks already matter, and future terrain could block movement, block lines, provide cover, create hazards, mutate, or participate in tactics.
  • Pieces may diverge from normal chess pieces, for example a “tortured bishop” with unusual movement or effects.
  • The royal/vital target concept may be fluid:
    • sometimes one king
    • sometimes two kings
    • sometimes a queen acts as the king
    • sometimes a king has two lives
    • sometimes a king can kill its attacker next turn and only dies if attacked again
  • The game may lean into named tactical patterns: forks, pins, skewers, discovered attacks, deflections, overloads, traps, promotion races, smothered-mate-like enclosures, etc.

AI Directions Discussed

1. Stockfish-style lessons without Stockfish

Using Stockfish directly is probably not a fit once terrain and custom rules diverge from chess, but many chess-engine ideas still apply:

  • state representation
  • legal move generation
  • position evaluation
  • selective search
  • alpha-beta / negamax
  • quiescence-style handling of tactical volatility
  • transposition tables
  • time management
  • principal variation/debug output

The useful idea is not “reuse a chess engine,” but “reuse the shape of chess-engine thinking.”

2. Utility and influence-map AI

For messy terrain and changing unit types, the AI may need fuzzy evaluation:

  • material value
  • mobility
  • threatened pieces
  • protected pieces
  • controlled squares
  • objective pressure
  • terrain safety
  • chokepoints
  • promotion pressure
  • trapped or overloaded pieces

Influence maps could let the engine reason about board control without deeply searching every future.

3. Tactical motif recognition

A promising direction is to explicitly detect tactics, but at an abstract level rather than hard-coding chess board patterns.

Examples:

  • Fork: one action creates threats against multiple valuable targets.
  • Pin: moving one piece exposes a more valuable or vital target behind it.
  • Enclosed forced kill: a vital target is threatened, has no safe escape, cannot capture the attacker, and cannot block or neutralize the threat.
  • Deflection: force or tempt a defender away from a critical duty.
  • Overload: one defender must answer too many simultaneous threats.

This could support recognizable chess tactics while still allowing cursed pieces, terrain interactions, and nonstandard kings.

4. Hybrid engine / portfolio approach

A likely long-term shape:

  1. Strategic layer: decide whether the position is about killing, defending, promotion, objective pressure, terrain control, etc.
  2. Candidate generator: produce plausible actions rather than every absurd action.
  3. Tactical search: search deeper in forcing lines such as captures, checks, anchor threats, pins, forks, forced terrain traps.
  4. Abstract evaluator: score broad or hazy positions using material, mobility, influence, terrain, and objectives.
  5. Meta-controller: decide where to spend search time and when to rely on fuzzy judgment.

This could allow “look three moves ahead for a mate-like tactic” while falling back to abstract positional reasoning in strange terrain-heavy scenarios.

5. Into the Breach comparison

Into the Breach appears to get much of its strength from simple enemy intent generation, hidden scoring, readable threats, and puzzle pressure rather than deep adversarial search. That is useful as a contrast:

  • AI as opponent: needs competence, evaluation, tactical search.
  • AI as puzzle-pressure generator: needs readable threat creation and interesting constraints.

This project may want more of the first than Into the Breach, because the theme is explicitly chess tactics, but the comparison is still useful.

Complexity / Research Boundary

The core concern is identifying when the project crosses from “normal game AI” into “research project.”

Important complexity drivers:

  • branching factor: number of legal/plausible actions per decision
  • whether one unit acts or the whole squad acts each turn
  • whether action order matters
  • whether actions mutate terrain
  • whether actions couple multiple units
  • whether good play requires long-horizon planning
  • whether hidden information or randomness exists
  • whether the evaluator can describe good play with known features

A rough boundary:

  • One unit acts per decision: manageable for search plus scoring.
  • Whole squad acts in arbitrary order: combinatorial explosion.
  • Custom movement alone: usually manageable.
  • Mutable terrain, combos, reactions, and multi-unit dependencies: much harder.
  • Needing the AI to discover strategy without authored features: research territory.

Possible Development Process

A practical way to proceed may be to build AI-facing infrastructure early:

  • pure rules engine: legal actions, attacks, effects, board updates
  • semantic layer: vital targets, threats, escape squares, blockers, defenders, objectives
  • tactics detector layer: fork, pin, trap, overload, etc.
  • evaluator: material, mobility, influence, terrain, objectives
  • search harness: depth/time budget, nodes searched, chosen line
  • benchmark scenarios: measure branching, blunders, win rate, turn time

This would let new units and terrain be evaluated not just for gameplay fun, but for AI tractability.

Open Questions

  • Is the AI meant to be a strong adversarial opponent, a puzzle-pressure generator, or a hybrid?
  • What is the game’s equivalent of “check” or “mate” when royal targets mutate?
  • Should tactics be surfaced as named concepts to the player, or only used internally by the AI?
  • How much should the game constrain unit design to keep tactics legible?
  • Should scenarios be classified by AI complexity before being accepted into the game?
  • Should the first prototype focus on tactical motif detection before deeper search?
## Context This issue captures an open-ended design discussion about where the AI for this game could go. It is not meant to prescribe an implementation yet. The project is intentionally chess-based, but not necessarily ordinary chess. The appeal may come from blending recognizable chess tactics with terrain, strange units, cursed rule mutations, and scenario-specific objectives. The AI is potentially part of the identity of the project, not just a background opponent. ## Gameplay Possibilities Discussed - The game may start as a contained chess-like tactics system and gradually become stranger or more tainted. - Terrain obstacles such as rocks already matter, and future terrain could block movement, block lines, provide cover, create hazards, mutate, or participate in tactics. - Pieces may diverge from normal chess pieces, for example a “tortured bishop” with unusual movement or effects. - The royal/vital target concept may be fluid: - sometimes one king - sometimes two kings - sometimes a queen acts as the king - sometimes a king has two lives - sometimes a king can kill its attacker next turn and only dies if attacked again - The game may lean into named tactical patterns: forks, pins, skewers, discovered attacks, deflections, overloads, traps, promotion races, smothered-mate-like enclosures, etc. ## AI Directions Discussed ### 1. Stockfish-style lessons without Stockfish Using Stockfish directly is probably not a fit once terrain and custom rules diverge from chess, but many chess-engine ideas still apply: - state representation - legal move generation - position evaluation - selective search - alpha-beta / negamax - quiescence-style handling of tactical volatility - transposition tables - time management - principal variation/debug output The useful idea is not “reuse a chess engine,” but “reuse the shape of chess-engine thinking.” ### 2. Utility and influence-map AI For messy terrain and changing unit types, the AI may need fuzzy evaluation: - material value - mobility - threatened pieces - protected pieces - controlled squares - objective pressure - terrain safety - chokepoints - promotion pressure - trapped or overloaded pieces Influence maps could let the engine reason about board control without deeply searching every future. ### 3. Tactical motif recognition A promising direction is to explicitly detect tactics, but at an abstract level rather than hard-coding chess board patterns. Examples: - Fork: one action creates threats against multiple valuable targets. - Pin: moving one piece exposes a more valuable or vital target behind it. - Enclosed forced kill: a vital target is threatened, has no safe escape, cannot capture the attacker, and cannot block or neutralize the threat. - Deflection: force or tempt a defender away from a critical duty. - Overload: one defender must answer too many simultaneous threats. This could support recognizable chess tactics while still allowing cursed pieces, terrain interactions, and nonstandard kings. ### 4. Hybrid engine / portfolio approach A likely long-term shape: 1. Strategic layer: decide whether the position is about killing, defending, promotion, objective pressure, terrain control, etc. 2. Candidate generator: produce plausible actions rather than every absurd action. 3. Tactical search: search deeper in forcing lines such as captures, checks, anchor threats, pins, forks, forced terrain traps. 4. Abstract evaluator: score broad or hazy positions using material, mobility, influence, terrain, and objectives. 5. Meta-controller: decide where to spend search time and when to rely on fuzzy judgment. This could allow “look three moves ahead for a mate-like tactic” while falling back to abstract positional reasoning in strange terrain-heavy scenarios. ### 5. Into the Breach comparison Into the Breach appears to get much of its strength from simple enemy intent generation, hidden scoring, readable threats, and puzzle pressure rather than deep adversarial search. That is useful as a contrast: - AI as opponent: needs competence, evaluation, tactical search. - AI as puzzle-pressure generator: needs readable threat creation and interesting constraints. This project may want more of the first than Into the Breach, because the theme is explicitly chess tactics, but the comparison is still useful. ## Complexity / Research Boundary The core concern is identifying when the project crosses from “normal game AI” into “research project.” Important complexity drivers: - branching factor: number of legal/plausible actions per decision - whether one unit acts or the whole squad acts each turn - whether action order matters - whether actions mutate terrain - whether actions couple multiple units - whether good play requires long-horizon planning - whether hidden information or randomness exists - whether the evaluator can describe good play with known features A rough boundary: - One unit acts per decision: manageable for search plus scoring. - Whole squad acts in arbitrary order: combinatorial explosion. - Custom movement alone: usually manageable. - Mutable terrain, combos, reactions, and multi-unit dependencies: much harder. - Needing the AI to discover strategy without authored features: research territory. ## Possible Development Process A practical way to proceed may be to build AI-facing infrastructure early: - pure rules engine: legal actions, attacks, effects, board updates - semantic layer: vital targets, threats, escape squares, blockers, defenders, objectives - tactics detector layer: fork, pin, trap, overload, etc. - evaluator: material, mobility, influence, terrain, objectives - search harness: depth/time budget, nodes searched, chosen line - benchmark scenarios: measure branching, blunders, win rate, turn time This would let new units and terrain be evaluated not just for gameplay fun, but for AI tractability. ## Open Questions - Is the AI meant to be a strong adversarial opponent, a puzzle-pressure generator, or a hybrid? - What is the game’s equivalent of “check” or “mate” when royal targets mutate? - Should tactics be surfaced as named concepts to the player, or only used internally by the AI? - How much should the game constrain unit design to keep tactics legible? - Should scenarios be classified by AI complexity before being accepted into the game? - Should the first prototype focus on tactical motif detection before deeper search?
nelsong6 commented 2026-07-02 20:15:52 -07:00 (Migrated from github.com)

Design discussion conclusions (2026-07-02)

Long working session on AI direction. Pinning what was settled so future work starts here instead of re-deriving it.

Where the code actually stands

  • The pure rules engine is done and AI-ready: core/rules.ts — legalMoves/applyMove/attackedSquares are pure, deterministic, serializable. Piece capabilities are fully encoded (movement, capture, terrain blocking, HP, AP, en passant, promotion, win conditions). This checks off the first rung of this issue's "possible development process."
  • The live enemy is the seeded greedy (enemyMove via game/store.ts): take any capture, else random legal move. It ignores safety and is objective-blind — it plays survive/reach/capture-all/rival-kings identically.
  • The deterministic telegraph policy (chooseEnemyMove/forecastEnemyIntents) exists in core with tests but is not wired into the live game.
  • There is no ability layer and none is needed as a precondition for AI work.

The frame (settled)

This is normal game AI: the opponent's job is to make the player feel like they're playing against something — sometimes skilled, sometimes fast, sometimes a personality. Judged by feel, in play — not an optimization problem. Opponent personalities are a real feature but a later epic. The near-term bar: the computer plays in a way that shows it understands the objective.

Design context that shapes everything (from the owner's design spec): variety-first, blitz-paced, flow over mastery; novelty must speak the language of native chess; difficulty comes from board configuration, not engine depth; boards are small and retryable now, but scale is a design goal — expect boards up to ~20×20 with ~40 units/side, where neither the player nor the machine can calculate and both must run on intuition. That symmetry is intended: depth-limited search + a good value function is machine intuition.

Taxonomy: when does "normal chess brain" work? (settled)

Chess brain (captures, safety, threats) is never replaced; it gets re-pointed. Every unusual mechanic falls into one of three buckets:

  1. Re-aim — mechanics that change what matters (reach/survive/capture-all/last-man-standing, shifting precious piece). Handled by objective-aware evaluation terms. Players read "the AI understands" almost entirely from target selection, so this bucket is cheap and high-visibility.
  2. Re-map — mechanics that change what's safe or legal (rivers, fire tiles, boulders, shrinking boards, chokepoints). Handled by encoding the rule in move generation / the threat map. Once a rule is in legalMoves/applyMove, search understands and exploits it automatically — no AI-side work. (This is why "encode the mechanic first" is the real precondition, and doubly so for any learned method.)
  3. Re-shape — mechanics that change the shape of a turn (multi-move chess). Genuinely different problem; deferred. Bucket test doubles as a design gate for accepting new mechanics.

Note: the river rule ("sliders halt on water") is currently design intent, not code — water is plain passable in core/terrain.ts. First brick when implementation starts.

Measured search boundary (benchmarked on the real engine)

Alpha-beta + material eval + capture-first ordering, zero optimization, run on the actual core (frontend/aibench.ts, throwaway):

Board Branching Depth in ~0.5s budget
6 official campaign levels (12×8, 3v3) 26–40 5–7 plies
Synthetic 20×20 open, 40v40 80 (congested start; grows as board opens) 3 plies (depth 4 ≈ 2s)

Conclusions: today's boards are effectively solved by trivial search — near-perfect tactical play inside a blitz think budget. The 20×20 ambition caps around one exchange of lookahead; engine plumbing (incremental state, TT, ordering) buys +1–2 plies, not ten. Rule: search covers tactics that fit the depth budget; everything longer lives in the value function. The boundary is measurable per board — this issue's "classify scenarios by AI complexity before acceptance" idea is now concrete: stamp each board with branching + reachable depth at authoring time.

The value function question (settled)

Search does not discover strategic value beyond its horizon (horizon effect). A "really good square" gets seen one of three ways: its payoff cashes out within depth (free); it's derivable from board structure (chokepoints, zone distance, mobility terms); or it's authored — uniquely available here because every board is a designed artifact.

Where the numbers come from — the ladder, which is also the project's learning syllabus (each rung: more learned, more compute, less readable):

  1. Authored eval — hand-written values (Deep Blue era).
  2. Fitted weights — Texel tuning (regression of eval params against self-play outcomes) / SPSA (Stockfish fishtest's method). Machine learns the numbers, you own the features; output is a readable, overridable table. Standard chess values (1/3/3/5/9) are NOT assumed to transfer — piece values will shift per board class (e.g. sliders bleed value on river boards) and the fit finds how much. Boards freeze per level, and self-play is minutes of CPU at this scale ⇒ fit per board/board-class at authoring time.
  3. TD-learned eval — actual RL applied to the evaluator inside search (Samuel → TD-Gammon → KnightCap/TDLeaf lineage). Legitimate future rung and a good hands-on RL learning project.
  4. Learned eval net (NNUE) — if handwritten/fitted features ever cap out on giant boards. Trained once for the game, still inside search.
  5. Learned policy (AlphaZero/MuZero) — rejected at every scale for this game: per-level policy training is dominated — more compute, no reusable knowledge across boards, no knobs, same or worse strength than tuned-eval + search at our scales.

External validation of the recipe (July 2026): Stockfish (alpha-beta + NNUE) just took its 12th consecutive TCEC title; the runner-up (Reckless) is the same architecture; the AlphaZero-style engine (Leela) missed the superfinal for the first time in many seasons. The strongest known chess AI shape = search backbone + small learned judgment — i.e., the shape settled above.

Answers to this issue's open questions

  • Opponent, puzzle-pressure, or hybrid? → Felt presence first (normal game AI). Capable of winning, then detuned per board; many boards will be player-advantaged by design.
  • Tactics surfaced as named concepts? → Not near-term; motif detection deferred.
  • Constrain unit design for legibility? → Yes, via the bucket gate: re-aim/re-map mechanics are absorbed cheaply; re-shape mechanics are epics.
  • Classify scenarios by AI complexity before acceptance? → Yes — measurable (branching + depth-in-budget per board), seed script exists.
  • First prototype focus? → Read-forward search + objective-aware eval on the existing objectives; fitted values (Texel/SPSA) per board class when hand-seeded values feel wrong.
## Design discussion conclusions (2026-07-02) Long working session on AI direction. Pinning what was settled so future work starts here instead of re-deriving it. ### Where the code actually stands - The **pure rules engine is done and AI-ready**: `core/rules.ts` — `legalMoves`/`applyMove`/`attackedSquares` are pure, deterministic, serializable. Piece capabilities are fully encoded (movement, capture, terrain blocking, HP, AP, en passant, promotion, win conditions). This checks off the first rung of this issue's "possible development process." - The **live enemy is the seeded greedy** (`enemyMove` via `game/store.ts`): take any capture, else random legal move. It ignores safety and is objective-blind — it plays survive/reach/capture-all/rival-kings identically. - The deterministic telegraph policy (`chooseEnemyMove`/`forecastEnemyIntents`) exists in core with tests but is **not wired into the live game**. - There is **no ability layer** and none is needed as a precondition for AI work. ### The frame (settled) This is **normal game AI**: the opponent's job is to make the player feel like they're playing against *something* — sometimes skilled, sometimes fast, sometimes a personality. Judged by feel, in play — not an optimization problem. Opponent personalities are a real feature but a **later epic**. The near-term bar: the computer plays in a way that shows it understands the objective. Design context that shapes everything (from the owner's design spec): variety-first, blitz-paced, flow over mastery; novelty must speak the language of native chess; difficulty comes from **board configuration**, not engine depth; boards are small and retryable now, but scale is a design goal — expect boards up to ~20×20 with ~40 units/side, where *neither the player nor the machine can calculate* and both must run on intuition. That symmetry is intended: depth-limited search + a good value function *is* machine intuition. ### Taxonomy: when does "normal chess brain" work? (settled) Chess brain (captures, safety, threats) is never replaced; it gets re-pointed. Every unusual mechanic falls into one of three buckets: 1. **Re-aim** — mechanics that change *what matters* (reach/survive/capture-all/last-man-standing, shifting precious piece). Handled by objective-aware evaluation terms. Players read "the AI understands" almost entirely from target selection, so this bucket is cheap and high-visibility. 2. **Re-map** — mechanics that change *what's safe or legal* (rivers, fire tiles, boulders, shrinking boards, chokepoints). Handled by encoding the rule in move generation / the threat map. **Once a rule is in `legalMoves`/`applyMove`, search understands and exploits it automatically — no AI-side work.** (This is why "encode the mechanic first" is the real precondition, and doubly so for any learned method.) 3. **Re-shape** — mechanics that change *the shape of a turn* (multi-move chess). Genuinely different problem; deferred. Bucket test doubles as a design gate for accepting new mechanics. Note: the river rule ("sliders halt on water") is currently **design intent, not code** — water is plain passable in `core/terrain.ts`. First brick when implementation starts. ### Measured search boundary (benchmarked on the real engine) Alpha-beta + material eval + capture-first ordering, zero optimization, run on the actual core (`frontend/aibench.ts`, throwaway): | Board | Branching | Depth in ~0.5s budget | |---|---|---| | 6 official campaign levels (12×8, 3v3) | 26–40 | **5–7 plies** | | Synthetic 20×20 open, 40v40 | 80 (congested start; grows as board opens) | **3 plies** (depth 4 ≈ 2s) | Conclusions: today's boards are effectively solved by trivial search — near-perfect tactical play inside a blitz think budget. The 20×20 ambition caps around one exchange of lookahead; engine plumbing (incremental state, TT, ordering) buys +1–2 plies, not ten. **Rule: search covers tactics that fit the depth budget; everything longer lives in the value function.** The boundary is measurable per board — this issue's "classify scenarios by AI complexity before acceptance" idea is now concrete: stamp each board with branching + reachable depth at authoring time. ### The value function question (settled) Search does **not** discover strategic value beyond its horizon (horizon effect). A "really good square" gets seen one of three ways: its payoff cashes out within depth (free); it's derivable from board structure (chokepoints, zone distance, mobility terms); or it's **authored** — uniquely available here because every board is a designed artifact. Where the *numbers* come from — the ladder, which is also the project's learning syllabus (each rung: more learned, more compute, less readable): 1. **Authored eval** — hand-written values (Deep Blue era). 2. **Fitted weights** — **Texel tuning** (regression of eval params against self-play outcomes) / **SPSA** (Stockfish fishtest's method). Machine learns the numbers, you own the features; output is a readable, overridable table. Standard chess values (1/3/3/5/9) are NOT assumed to transfer — piece values will shift per board class (e.g. sliders bleed value on river boards) and the fit finds how much. Boards freeze per level, and self-play is minutes of CPU at this scale ⇒ **fit per board/board-class at authoring time**. 3. **TD-learned eval** — actual RL applied to the evaluator inside search (Samuel → TD-Gammon → KnightCap/TDLeaf lineage). Legitimate future rung and a good hands-on RL learning project. 4. **Learned eval net (NNUE)** — if handwritten/fitted features ever cap out on giant boards. Trained once for the game, still inside search. 5. **Learned policy (AlphaZero/MuZero)** — **rejected at every scale for this game**: per-level policy training is dominated — more compute, no reusable knowledge across boards, no knobs, same or worse strength than tuned-eval + search at our scales. External validation of the recipe (July 2026): Stockfish (alpha-beta + NNUE) just took its 12th consecutive TCEC title; the runner-up (Reckless) is the *same* architecture; the AlphaZero-style engine (Leela) missed the superfinal for the first time in many seasons. The strongest known chess AI shape = search backbone + small learned judgment — i.e., the shape settled above. ### Answers to this issue's open questions - *Opponent, puzzle-pressure, or hybrid?* → Felt presence first (normal game AI). Capable of winning, then detuned per board; many boards will be player-advantaged by design. - *Tactics surfaced as named concepts?* → Not near-term; motif detection deferred. - *Constrain unit design for legibility?* → Yes, via the bucket gate: re-aim/re-map mechanics are absorbed cheaply; re-shape mechanics are epics. - *Classify scenarios by AI complexity before acceptance?* → Yes — measurable (branching + depth-in-budget per board), seed script exists. - *First prototype focus?* → Read-forward search + objective-aware eval on the existing objectives; fitted values (Texel/SPSA) per board class when hand-seeded values feel wrong.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/chess-tactics#25
No description provided.