Files

89 lines
5.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Claude Code Game Studios — Ajedrez Purgatorio
Narrative chess game set in purgatory. Tactical gameplay with emotional piece identity,
dice risk/reward mechanics, and async Dead Kings social system.
## Technology Stack
- **Engine**: Unity 6.3 LTS (6000.3.13f1)
- **Language**: C#
- **Render Pipeline**: URP 2D (17.3.0)
- **UI**: UGUI + TextMeshPro
- **Version Control**: Git with trunk-based development
- **Target Platform**: PC (expandable to mobile)
## Project Structure
@.claude/docs/directory-structure.md
## Engine Version Reference
@docs/engine-reference/unity/VERSION.md
## Technical Preferences
@.claude/docs/technical-preferences.md
## Coordination Rules
@.claude/docs/coordination-rules.md
## Collaboration Protocol
**User-driven collaboration, not autonomous execution.**
Every task follows: **Question -> Options -> Decision -> Draft -> Approval**
- Agents MUST ask "May I write this to [filepath]?" before using Write/Edit tools
- Agents MUST show drafts or summaries before requesting approval
- Multi-file changes require explicit approval for the full changeset
- No commits without user instruction
See `docs/COLLABORATIVE-DESIGN-PRINCIPLE.md` for full protocol and examples.
> **First session?** If the project has no engine configured and no game concept,
> run `/start` to begin the guided onboarding flow.
## Coding Standards
@.claude/docs/coding-standards.md
## Context Management
@.claude/docs/context-management.md
## Current State (Aug 2026)
### Critical Bugs Fixed
- **StackOverflow** — `CheckDetector.IsInCheck` called `GetAvailableMoves()` on enemy King, which called `GameManager.IsInCheck()` → infinite recursion. Fixed: use `GetAttackSquares()`.
- **Empty board** — `BoardManager.SetupBoard` returned early when CampaignState had no identities. Fixed: fallback to `PlacePieces()`.
- **State stuck in Dialogue** — CampaignManager transitioned to Dialogue before `StartDialogue` returned true. Fixed: only transition on success.
- **DimBG blocking input** — Full-screen overlay with `m_RaycastTarget:1` blocked all clicks. Fixed: deactivated in `PromotionUI.Awake()`.
- **PauseMenuController** — Used non-existent "Pause" input button. Fixed: use `KeyCode.Escape` only.
- **SceneTransitionManager** — Used `Time.deltaTime` with `timeScale=0`. Fixed: `Time.unscaledDeltaTime` + `WaitForSecondsRealtime`.
- **DefeatUI callback race (Aug 25)** — Fade-out disabled the panel before the continue callback coroutine fired. Fixed: invoke callback synchronously in `OnContinueClick`.
- **Dialogues empty on first run (Aug 25)** — `DialogueUI` subscribed only if `DialogueSystem.Instance` existed during its OnEnable (lost Awake race), never retried. Fixed: `[DefaultExecutionOrder(-100)]` on DialogueSystem + resilient deferred subscription.
- **Memorial typing dead (Aug 25)** — Scene TMP_InputFields hollow (`m_TextViewport/m_TextComponent = 0`) AND `InputSystemUIInputModule` doesn't feed legacy `Input.inputString`. Fixed: deep wiring validation + runtime fallback panel + temporary StandaloneInputModule swap (restored in OnDestroy).
- **Pause menu dead (Aug 25)** — Duplicate controllers per scene (one inactive canvas), unusable scene panel, HUD `PauseButton` with empty onClick. Fixed: runtime-built pause panel (Continuar / Reiniciar capítulo / Opciones / Menú principal) + HUD button wired in code + orphan overlay cleanup.
- **Dialogue text over portrait (Aug 25)** — Text box overlapped speaker portrait geometry. Fixed: idempotent runtime relayout in `DialogueUI.OnEnable` (portrait left, text stretched right).
- **CampaignConfig log spam (Aug 25)** — `CreateInstance` fires OnEnable before `SetJsonSource()`. Fixed: OnEnable silent until a JSON source exists.
### Architecture
- **Purgatory mode** (`Mono/`) is main/production codebase
- **Classic mode** (`Mono/Classic/`) is separate simpler mode
- **Board tile size**: 10.24 units, Camera ortho size 45
- **Campaign flow**: MainMenu → CampaignManager.StartCampaign() → Chapter1 scene → SetupBoard → TransitionToChapterIntro → dialogue → TransitionToPlaying
- **Runtime UI fallback pattern**: scene UI panels are validated deeply in code; broken/hollow ones are hidden and rebuilt at runtime (DefeatUI, DeadKingInputUI, PauseMenuController). All runtime canvases: ScaleWithScreenSize reference 1920×1080.
- **Campaigns**: "Nueva Campaña" = Inspector config on scene CampaignManager (`default`, Línea I, 3 chapters); "Gambito de Sombras" = `Resources/Campaigns/gambito_campaign.json` (30 chapters, 4 acts). Same engine/scenes/rules.
### Git History
- `43f15eb` — chore: scene saves from playtesting session (Ch1-3 UI edits)
- `bcc590f` — feat: runtime pause menu + Mi Memorial in main menu
- `97677fb` — fix: defeat→Memorial chain, first-run dialogues, memorial typing, dialogue layout
- `dc45653` — fix: pick best-wired DeadKingInputUI + runtime fallback inscription panel
- `58fcf0f` — feat: draws trigger Purgatory Duel for the Queen + post-defeat restart menu
- `916acd3` — test: raise EditMode coverage to 98.16% global, all classes >=95%
- `351f9e1` — fix: StackOverflow in King.GetAvailableMoves → IsInCheck recursion
- `801de79` — fix: empty board + state stuck in Dialogue
(Older history: `c5915c2`, `0725372`, `bf3bec3`, `b539aa4` initial commit.)