Explore chess-tactics AI direction and gameplay complexity boundaries #25
Labels
No labels
bug
campaign-editor-ui
dependencies
design
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
javascript
question
queue
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/chess-tactics#25
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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:
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:
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:
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:
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:
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:
A rough boundary:
Possible Development Process
A practical way to proceed may be to build AI-facing infrastructure early:
This would let new units and terrain be evaluated not just for gameplay fun, but for AI tractability.
Open Questions
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
core/rules.ts—legalMoves/applyMove/attackedSquaresare 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."enemyMoveviagame/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.chooseEnemyMove/forecastEnemyIntents) exists in core with tests but is not wired into the live game.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:
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.)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):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):
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