# Theriapolis → Godot 4.6 Porting Guide A companion to `README.md`. This document maps the React/HTML prototype onto a Godot 4.6 project, file by file, with code sketches for the parts that are not obvious. It assumes you've read the existing README and have a working Godot 4.6 install. > **Scope.** This guide covers the character-creation wizard only — the same surface the prototype covers. It does not address how the resulting character is consumed by the rest of the game; that handoff is described under "The handoff contract" at the end. --- ## 0. The honest summary The port is **a UI rebuild, not a translation.** What carries over verbatim: - The four content JSON files in `data/`. - The `state` shape used as the character record. - All math (`abilityMod`, modifier summing, validation predicates). - Step-gating rules and the wizard flow. - Drag/drop *semantics* (pool→slot, slot→slot, slot→pool). What gets rebuilt in Godot's idiom: - All views (HTML/CSS → Control scenes + Theme). - The hover-popover system (`TraitName`) → a custom `PopupPanel` Control. - HTML5 drag-and-drop → Godot's `_get_drag_data` / `_can_drop_data` / `_drop_data`. - The Tweaks panel — almost certainly delete it; bake one theme. Plan on roughly: 1–2 days for scaffolding, ~1 day per step scene, 1–2 days for the popover and drag system, 2–3 days for theming the parchment look. Plus polish. --- ## 1. Suggested Godot project layout ``` res:// ├── project.godot ├── data/ # Copy unchanged from prototype/data/ │ ├── clades.json │ ├── species.json │ ├── classes.json │ └── backgrounds.json ├── fonts/ # Bundle these — do NOT rely on Google Fonts at runtime │ ├── CormorantGaramond-Medium.ttf │ ├── CormorantGaramond-MediumItalic.ttf │ ├── CrimsonPro-Regular.ttf │ ├── CrimsonPro-Italic.ttf │ ├── CrimsonPro-SemiBold.ttf │ └── JetBrainsMono-Regular.ttf ├── theme/ │ ├── parchment.tres # Main Theme resource │ ├── parchment_styles.gd # Programmatic StyleBox factory (optional) │ └── paper_grain.png # Baked grain background ├── autoload/ │ ├── content.gd # Loads the four JSON files; replaces data.jsx │ ├── character.gd # Resource defining the character record │ └── rules.gd # ABILITIES, SKILL_*, abilityMod(), validate() ├── scenes/ │ ├── wizard.tscn # Root; replaces app.jsx │ ├── wizard.gd │ ├── stepper.tscn # 7-tab header; replaces .stepper │ ├── aside.tscn # Right-rail summary; replaces