The May 10 commit (8a1db81) contained a much more mature, tested implementation
than the local Classic/Combat refactor done earlier today: Piece Identity System,
Dice/Purgatory mechanic, Dead Kings async pool, Dialogue System, Campaign System,
AI with Easy/Medium/Hard strategies, full chess rules (checkmate, stalemate, en
passant, castling, draw detection), and NUnit unit tests. The Classic/Combat
scaffold built today was a more primitive duplicate, created without awareness
of this prior work.
Per explicit user decision: restore the full May tree (code, tests, and the 9
design/gdd/* documents), and remove the Classic/Combat code along with the
GDD/ADR/control-manifest that documented it (now describing discarded code).
Reapplied on top of the restored May state (unrelated to the code decision):
- Fix CLAUDE.md / docs/CLAUDE.md engine-reference import (was still pointing at
docs/engine-reference/godot/VERSION.md)
- Remove unused docs/engine-reference/godot/ and unreal/ (project is Unity-only)
- Fill in technical-preferences.md naming conventions, specialist routing, and
testing framework (NUnit) entries that were left as [TO BE CONFIGURED]
- Add Version Awareness section to unity-specialist agent
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 KiB
🎮 Guía de Configuración Unity — Acción Inmediata
Ajedrez Purgatorio — Sprint 3 Setup
📋 Checklist Rápido
✅ Pre-requisitos (Sprint 1 & 2)
Antes de configurar el Purgatorio, verifica que esto esté hecho:
- 16 PieceIdentity assets creados en
Assets/Data/Identities/ - CampaignState.asset creado en
Assets/Data/ - AIPositionTables.asset creado en
Assets/Data/AI/ - PromotionUI configurado en escena Game.unity
- PieceTooltip configurado en escena Game.unity
- Escenas:
MainMenu.unity,Game.unity,Dialogue.unity,Purgatory.unity,DeadKing.unityen Build Settings
Si falta alguno, ver /production/sprints/sprint-01-foundation.md y sprint-02-chess-ai.md
🎯 Setup del Purgatorio (Sprint 3)
Paso 1: Abrir Escena de Juego
- Abrir Unity Editor
- File → Open Scene →
Assets/Scenes/Game.unity
Paso 2: Crear PurgatoryManager GameObject
2.1 Crear GameObject Principal
- En Hierarchy, clic derecho → Create Empty
- Renombrar a
PurgatoryManager - Position: (0, 0, 0) — no importa, será DontDestroyOnLoad
- Agregar componente
PurgatoryManager(script) - Agregar componente
DiceSystem(script) al mismo GameObject
2.2 Configurar DiceSystem en Inspector
Seleccionar PurgatoryManager → Buscar componente DiceSystem:
Balance:
├─ Piece Bonus Queen: 2
├─ Piece Bonus Major: 1
├─ Piece Bonus Pawn: 0
├─ Desperation Threshold: 4
├─ Desperation Bonus: 1
└─ Penalty Per Visit: 1
Estos valores son según el GDD — NO cambiar sin testeo.
Paso 3: Crear Canvas de Purgatorio UI
3.1 Crear Canvas Principal
-
Hierarchy → clic derecho → UI → Canvas
-
Renombrar a
PurgatoryCanvas -
En Inspector del Canvas:
Render Mode: Screen Space - Overlay Pixel Perfect: ✓ (checked) Sort Order: 10 (sobre cualquier otro UI) -
Agregar/Verificar componente
Canvas Scaler:UI Scale Mode: Scale With Screen Size Reference Resolution: 1920 x 1080 Screen Match Mode: Match Width Or Height Match: 0.5 -
Agregar/Verificar componente
Graphic Raycaster(debe estar por defecto)
3.2 Crear EventSystem (si no existe)
Si no hay EventSystem en la escena:
- Hierarchy → clic derecho → UI → Event System
Paso 4: Crear Offer Panel (Pantalla de Oferta)
4.1 Crear Panel Base
- Seleccionar
PurgatoryCanvas - Clic derecho → UI → Panel
- Renombrar a
OfferPanel - En Inspector del Panel (Image component):
Color: Negro semi-transparente (0, 0, 0, 200) - Rect Transform → Ancla a toda la pantalla:
Anchors: Stretch-Stretch (centro + extremos coinciden) Left: 0, Right: 0, Top: 0, Bottom: 0
4.2 Crear Contenido del Panel
Estructura a crear:
OfferPanel
├─ TitleText (TMP)
├─ PieceInfoPanel
│ ├─ PieceNameText (TMP)
│ ├─ RoleText (TMP)
│ └─ RelationshipText (TMP)
├─ FlavorText (TMP)
└─ ButtonsPanel
├─ AcceptButton
└─ DeclineButton
Crear cada elemento:
-
TitleText:
- Seleccionar
OfferPanel→ clic derecho → UI → Text - TextMeshPro - Renombrar:
TitleText - Text: "¿Desafiar a la Muerte?"
- Font Size: 72
- Alignment: Center + Middle
- Color: Amarillo (#FFD700)
- Posición: Centrado arriba (Y: 300)
- Seleccionar
-
PieceInfoPanel:
- Seleccionar
OfferPanel→ clic derecho → UI → Panel - Renombrar:
PieceInfoPanel - Width: 600, Height: 300
- Posición: Centro (Y: 0)
- Color: Negro más opaco (0, 0, 0, 230)
- Seleccionar
-
PieceNameText (dentro de PieceInfoPanel):
- Clic derecho en
PieceInfoPanel→ UI → Text - TextMeshPro - Renombrar:
PieceNameText - Text: "Nombre de Pieza"
- Font Size: 48
- Alignment: Center + Top
- Color: Blanco
- Posición: Y: 80
- Clic derecho en
-
RoleText (dentro de PieceInfoPanel):
- Similar a PieceNameText
- Renombrar:
RoleText - Text: "Rol"
- Font Size: 32
- Color: Gris claro (#CCCCCC)
- Posición: Y: 20
-
RelationshipText (dentro de PieceInfoPanel):
- Similar anterior
- Renombrar:
RelationshipText - Text: "Relación"
- Font Size: 28
- Color: Gris (#AAAAAA)
- Posición: Y: -30
-
FlavorText (fuera de PieceInfoPanel):
- Seleccionar
OfferPanel→ UI → Text - TextMeshPro - Renombrar:
FlavorText - Text: "Quote de la Muerte..."
- Font Size: 28
- Style: Italic
- Alignment: Center + Middle
- Color: Rojo oscuro (#AA0000)
- Posición: Y: -180
- Seleccionar
-
ButtonsPanel:
- Seleccionar
OfferPanel→ clic derecho → Create Empty - Renombrar:
ButtonsPanel - Add Component → Horizontal Layout Group
- Spacing: 40
- Child Alignment: Middle Center
- Posición: Y: -300
- Seleccionar
-
AcceptButton (dentro de ButtonsPanel):
- Seleccionar
ButtonsPanel→ UI → Button - TextMeshPro - Renombrar:
AcceptButton - Width: 200, Height: 80
- Color: Verde oscuro (#006400)
- Text en hijo: "Sí"
- Font Size: 36
- Color texto: Blanco
- Seleccionar
-
DeclineButton (dentro de ButtonsPanel):
- Similar a AcceptButton
- Renombrar:
DeclineButton - Color: Rojo oscuro (#8B0000)
- Text: "No"
4.3 Agregar Script PurgatoryOfferUI
- Seleccionar
OfferPanel - Add Component →
PurgatoryOfferUI(script) - Desactivar el Panel por defecto: Uncheck el checkbox arriba en Inspector
4.4 Asignar Referencias en Inspector
Seleccionar OfferPanel → Componente PurgatoryOfferUI:
Referencias UI:
├─ Offer Panel: OfferPanel (arrastrar desde Hierarchy)
├─ Title Text: TitleText (arrastrar)
├─ Piece Name Text: PieceNameText (arrastrar)
├─ Role Text: RoleText (arrastrar)
├─ Relationship Text: RelationshipText (arrastrar)
├─ Flavor Text: FlavorText (arrastrar)
├─ Accept Button: AcceptButton (arrastrar)
└─ Decline Button: DeclineButton (arrastrar)
Paso 5: Crear Dice Panel (Pantalla de Dados)
5.1 Crear Panel Base
- Seleccionar
PurgatoryCanvas - Clic derecho → UI → Panel
- Renombrar a
DicePanel - Color: Negro semi-transparente (0, 0, 0, 200)
- Ancla: Stretch-Stretch (pantalla completa)
5.2 Crear Contenido
Estructura:
DicePanel
├─ StatusText (TMP)
├─ PlayerSection
│ ├─ PlayerLabel (TMP)
│ ├─ PlayerRollText (TMP)
│ ├─ PlayerModifiersText (TMP)
│ └─ PlayerTotalText (TMP)
└─ DeathSection
├─ DeathLabel (TMP)
├─ DeathRollText (TMP)
└─ DeathTotalText (TMP)
Crear elementos:
-
StatusText:
- UI → Text - TextMeshPro
- Renombrar:
StatusText - Text: "Tirando dados..."
- Font Size: 48
- Alignment: Center + Top
- Color: Blanco
- Posición: Y: 350
-
PlayerSection:
- Create Empty →
PlayerSection - Posición: X: -300, Y: 0
- Width: 400, Height: 500
- Create Empty →
-
PlayerLabel (dentro de PlayerSection):
- Text - TextMeshPro
- Text: "TU TIRADA"
- Font Size: 36
- Color: Cyan (#00FFFF)
- Posición: Y: 200
-
PlayerRollText:
- Text - TextMeshPro
- Text: "?"
- Font Size: 120
- Font Style: Bold
- Alignment: Center
- Color: Blanco
- Posición: Y: 80
-
PlayerModifiersText:
- Text - TextMeshPro
- Text: "" (vacío)
- Font Size: 24
- Alignment: Center
- Color: Verde (#00FF00)
- Posición: Y: -30
- Width: 350, Height: 150
-
PlayerTotalText:
- Text - TextMeshPro
- Text: "?"
- Font Size: 48
- Font Style: Bold
- Color: Amarillo (#FFD700)
- Posición: Y: -150
-
DeathSection (similar a PlayerSection):
- Create Empty →
DeathSection - Posición: X: 300, Y: 0
- Repetir estructura pero con:
- DeathLabel: "LA MUERTE"
- Color: Rojo (#FF0000)
- Create Empty →
5.3 Agregar Script DiceRollUI
- Seleccionar
DicePanel - Add Component →
DiceRollUI(script) - Desactivar el Panel: Uncheck arriba en Inspector
5.4 Asignar Referencias
Seleccionar DicePanel → Componente DiceRollUI:
Referencias UI:
├─ Dice Panel: DicePanel
├─ Player Roll Text: PlayerRollText
├─ Player Modifiers Text: PlayerModifiersText
├─ Player Total Text: PlayerTotalText
├─ Death Roll Text: DeathRollText
├─ Death Total Text: DeathTotalText
└─ Status Text: StatusText
Animación:
├─ Roll Duration: 2
└─ Reveal Delay: 0.5
Paso 6: Crear Result Panel (Pantalla de Resultado)
6.1 Crear Panel Base
- Seleccionar
PurgatoryCanvas - UI → Panel
- Renombrar:
ResultPanel - Color: Negro semi-transparente (0, 0, 0, 220)
- Ancla: Stretch-Stretch
6.2 Crear Contenido
Estructura:
ResultPanel
├─ FlashOverlay (Image)
├─ OutcomeText (TMP)
├─ DeathQuoteText (TMP)
├─ DetailsText (TMP)
└─ ContinueButton (Button)
Crear elementos:
-
FlashOverlay:
- Seleccionar
ResultPanel→ UI → Image - Renombrar:
FlashOverlay - Ancla: Stretch-Stretch (pantalla completa)
- Color: Blanco (1, 1, 1, 0.5) — con alpha 0.5
- Desactivar este GameObject (será activado por script)
- Seleccionar
-
OutcomeText:
- Text - TextMeshPro
- Text: "¡VICTORIA!"
- Font Size: 96
- Font Style: Bold
- Alignment: Center + Middle
- Color: Amarillo (#FFD700)
- Posición: Y: 200
-
DeathQuoteText:
- Text - TextMeshPro
- Text: "Quote de la Muerte..."
- Font Size: 32
- Style: Italic
- Alignment: Center
- Color: Rojo (#FF4444)
- Posición: Y: 80
- Width: 1000
-
DetailsText:
- Text - TextMeshPro
- Text: "Tu tirada: X\nLa Muerte: Y"
- Font Size: 28
- Alignment: Center
- Color: Blanco
- Posición: Y: -50
- Width: 800, Height: 200
-
ContinueButton:
- UI → Button - TextMeshPro
- Width: 300, Height: 80
- Color: Azul oscuro (#000080)
- Text: "Continuar"
- Font Size: 36
- Posición: Y: -250
6.3 Agregar Script DiceResultUI
- Seleccionar
ResultPanel - Add Component →
DiceResultUI(script) - Desactivar el Panel: Uncheck
6.4 Asignar Referencias
Seleccionar ResultPanel → Componente DiceResultUI:
Referencias UI:
├─ Result Panel: ResultPanel
├─ Outcome Text: OutcomeText
├─ Death Quote Text: DeathQuoteText
├─ Details Text: DetailsText
├─ Continue Button: ContinueButton
└─ Flash Overlay: FlashOverlay
Colores:
├─ Victory Color: #FFD700 (amarillo dorado)
└─ Defeat Color: #8B0000 (rojo oscuro)
Paso 7: Conectar PurgatoryManager
7.1 Asignar Referencias al Manager
Seleccionar PurgatoryManager en Hierarchy → Componente PurgatoryManager:
Referencias:
├─ Dice System: DiceSystem (en mismo GameObject)
└─ Campaign State: Arrastrar CampaignState.asset desde Assets/Data/
UI:
├─ Offer UI: OfferPanel (componente PurgatoryOfferUI)
├─ Dice Roll UI: DicePanel (componente DiceRollUI)
└─ Result UI: ResultPanel (componente DiceResultUI)
Configuración:
└─ Max Visits Per Board: 3
CRÍTICO: Verificar que CampaignState.asset tenga:
- Array de
allIdentitiescon las 16 PieceIdentity assets - Array de
chapterDifficultiesconfigurado
Paso 8: Verificar GameManager
- Seleccionar GameObject
GameManageren Hierarchy - Verificar que tiene referencias a:
pieceTooltip(PieceTooltip component)promotionUI(PromotionUI component)
NO requiere referencia a PurgatoryManager — usa Singleton pattern.
Paso 9: Guardar y Testear
9.1 Guardar Todo
- File → Save Scene (Ctrl+S)
- File → Save Project (Ctrl+Shift+S)
9.2 Testing Básico
Test 1: Verificar que no haya errores
- Presionar Play
- Verificar Console — no debe haber errores rojos
- Si hay errores de referencias faltantes, revisar el Paso 7
Test 2: Capturar pieza blanca
- Play mode
- Mover pieza negra (IA) para capturar pieza blanca
- Debe aparecer OfferPanel con nombre de pieza
- Click "Sí"
- Debe aparecer DicePanel con animación de dados
- Debe aparecer ResultPanel con resultado
Test 3: Verificar modificadores
- Capturar diferentes tipos de piezas:
- Peón → +0 bonus
- Caballo/Alfil/Torre → +1 bonus
- Reina → +2 bonus
- Verificar que modificadores se muestren correctamente en DiceRollUI
Test 4: Verificar límite de visitas
- Capturar 3 piezas y aceptar Purgatorio las 3 veces
- Capturar 4ta pieza
- NO debe aparecer oferta — muerte directa
- Verificar Console: debe decir "cuota agotada"
⚠️ Troubleshooting Común
Error: "PurgatoryManager no encontrado"
- Causa: PurgatoryManager no está en escena o está desactivado
- Fix: Verificar que GameObject exista y esté activo
Error: "Referencias UI no asignadas"
- Causa: No asignaste las referencias en Inspector
- Fix: Revisar Paso 4.4, 5.4, 6.4, 7.1 — todas las referencias deben estar asignadas
Error: "Time.timeScale no se resetea"
- Causa: Excepción durante flujo de Purgatorio
- Fix: En Editor, pausar y ejecutar en Console:
Time.timeScale = 1
UI no se muestra
- Causa: Panels están activos por defecto o Canvas Sort Order bajo
- Fix:
- Verificar que OfferPanel, DicePanel, ResultPanel estén desactivados por defecto
- Verificar Canvas Sort Order = 10
Dados no animan
- Causa: Time.timeScale = 0 y coroutine usa WaitForSeconds
- Fix: Verificar que DiceRollUI use
WaitForSecondsRealtime(ya está en código)
✅ Checklist Final
Antes de marcar como completo:
- PurgatoryManager existe en Game.unity y está activo
- DiceSystem configurado con valores correctos
- 3 Panels creados (Offer, Dice, Result) y DESACTIVADOS por defecto
- 3 Scripts UI agregados y con referencias asignadas
- PurgatoryManager tiene referencias a 3 UI components
- CampaignState.asset asignado en PurgatoryManager
- Testing: Captura de pieza → Oferta aparece
- Testing: Dados ruedan y muestran modificadores
- Testing: Resultado muestra victoria/derrota correctamente
- Testing: Límite de 3 visitas funciona
- Console sin errores rojos
- Escena guardada
📚 Referencia Rápida
- Documentación completa:
/Assets/Game/Scripts/Mono/Purgatory/SETUP_INSTRUCTIONS.md - GDD del Sistema:
/design/gdd/dice-system.md - Sprint Plan:
/production/sprints/sprint-03-purgatorio.md - Estado del Proyecto:
/PROJECT_STATUS.md
Tiempo estimado total: 45-60 minutos
Dificultad: Media (requiere familiaridad con Unity UI)
¡Buena suerte con el setup! 🎲