# Running, linting and building the game The Ren'Py project in `vn/` is generated by vnpipe (`../vnpipe`); never edit it by hand. All commands run from the repository root. Generic details (CLI, GUI template, SDK commands): `../vnpipe/docs/running.md`. ## 1. Ren'Py SDK The SDK is not committed (`tools/` is gitignored). Install **Ren'Py 8.5.3** (SDK archive from , `renpy-8.5.3-sdk.tar.bz2`) so that `tools/renpy-sdk/renpy.sh` exists: ```sh mkdir -p tools && tar -xjf renpy-8.5.3-sdk.tar.bz2 -C tools && mv tools/renpy-8.5.3-sdk tools/renpy-sdk ``` The SDK already contains the web runtime (`tools/renpy-sdk/web`) and the Linux, Windows and macOS distribution templates. Inside the sandbox set `HOME=$TMPDIR/renpy-home` for SDK commands, since Ren'Py writes to `~/.renpy`. ## 2. Regenerate the project ```sh uv run vnpipe renpy # from data/annotated.json uv run vnpipe renpy --from-parsed # trivial annotations built from parsed.json uv run vnpipe renpy --out some/dir # default output: vn ``` Generation is deterministic: running it twice gives identical files (no timestamps). It rewrites `game/{options,gui,screens,styles,menus,support,characters,images,menu_data,script}.rpy`, `game/gui/`, `game/fonts/`, `game/images/` and, when the work has an `audio/` directory, `game/audio/` (a copy of `audio/**/*.ogg`; it is gitignored in `vn/`). Music, credits, scene select and title-card subtitles are configured in `work.toml` and `audio/credits.toml` (see vnpipe's `docs/work-config.md`). Images come from `assets/assets.json` (statuses `processed`, `approved`, `placeholder`); anything missing or unusable is replaced by a generated placeholder so the game always runs. Art styles (manifest v2, `--style` on every `vnpipe assets` command, per-style status matrix and `assets check`) are documented in vnpipe's `docs/running.md` and `docs/art-bible.md`. ### GUI template and licences `renpy_templates/` in vnpipe holds the default Ren'Py GUI (`gui.rpy`, `screens.rpy`, `options.rpy` and `gui/*.png`). It was generated once with the SDK's own command and then edited minimally (dark palette, ivory text, accent `#c9a25b`, Roboto Slab font, NVL tweaks, `@@TOKEN@@` placeholders for title/build name/about text/menu background): ```sh tools/renpy-sdk/renpy.sh tools/renpy-sdk/launcher generate_gui OUT --width 1920 --height 1080 \ --accent '#c9a25b' --boring '#14110e' --template "$PWD/tools/renpy-sdk/gui" --start ``` These files are part of Ren'Py (MIT licence, Tom Rothamel and contributors). The font `game/fonts/RobotoSlab-*.ttf` is Roboto Slab (Apache 2.0), taken from the SDK documentation assets. ## 3. Lint ```sh HOME=$TMPDIR/renpy-home tools/renpy-sdk/renpy.sh vn lint ``` The expected result is a statistics block with no warnings above it. ## 3b. End-to-end playthrough test Lint does not catch runtime errors (missing GUI images, display bugs). `--with-test` also writes `game/e2e_test.rpy`, a Ren'Py `testcase` that clicks "Start", advances through the whole game up to the final card (`label the_end`) and back to the main menu (then opens and closes the Scenes and Credits screens), failing on any exception (`traceback.txt`). Use a throw-away output directory so the test file never ends up in `vn/` or in a build: ```sh uv run vnpipe renpy --with-test --out build/e2e HOME=$TMPDIR/renpy-home SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy RENPY_RENDERER=sw \ tools/renpy-sdk/renpy.sh build/e2e test ``` The headless run needs the software renderer (`RENPY_RENDERER=sw`, no GL under the dummy video driver); matrix tints are therefore not rendered but all game logic is exercised. `tests/test_faust_e2e.py` runs this when the SDK exists (`RENPY_SDK` or `tools/renpy-sdk`; slow: about a minute). On a desktop with a display, drop the three variables. ## 3c. Headless screenshots (visual QA) The same test runner takes screenshots (`screenshot "name.png"` inside a `testcase`, saved under `_test.screenshot_directory`; an existing file is *compared*, so delete it before re-taking). Copy `vn/` to a scratch directory, add a `game/qa_test.rpy` with the `e2e_ticker` screen of `e2e_test.rpy`, `run Start("scene_noche")` + `pause 9.0` + `screenshot ...`, and run `renpy.sh test` with the variables of section 3b. `Start(label)` only works from the main menu (one test run per scene); `ShowMenu("preferences")`, `"load"`, `"history"`, `"vn_credits"`, `"vn_scene_select"` work anywhere. Set `persistent.art_style` with `run SetField(persistent, "art_style", "anime")` (a bare `$` does not redraw). ## 4. Play ```sh tools/renpy-sdk/renpy.sh vn ``` ## 5. Builds (output under `build/`, gitignored) ```sh # Web (HTML5) tools/renpy-sdk/renpy.sh tools/renpy-sdk/launcher web_build vn --destination build/web python3 -m http.server -d build/web 8000 # then open http://localhost:8000 # Linux desktop tools/renpy-sdk/renpy.sh tools/renpy-sdk/launcher distribute vn --package linux --destination build/dist ``` `--package` also accepts `win` and `mac`; omit it to build every package. The web build also leaves a `build/web.zip` next to the folder. A web build writes `vn/progressive_download.txt`; delete it (it is not part of the generated project). ### Android APK One-time local setup: unpack `renpy-8.5.3-rapt.zip` into `tools/renpy-sdk/rapt`, use JDK 21 (`JAVA_HOME`), and install the Android SDK with RAPT's `android.py installsdk` (this accepts Google's Android SDK licence). The `[android]` table in `work.toml` makes `vnpipe renpy` write `vn/android.json`, the icons and the presplash. ```sh tools/renpy-sdk/renpy.sh tools/renpy-sdk/launcher android_build vn --destination build/dist ``` - Signing: copy the release keystore to `vn/android.keystore` and `vn/bundle.keystore` (alias `android`, password `android`; both are gitignored). Always sign with the **same** keystore: a different one cannot update an installed app. Keep a private backup; never commit it. - The project path must be ASCII (Gradle's `local.properties` is Latin-1): from a path with accents such as `DarĂ­o`, build from a copy of `vn/` in an ASCII directory. ## 6. Releases (CI) `.github/workflows/release.yml` builds Windows, Linux, macOS, web and the signed APK. - Push to `development` or a manual run: builds are kept as workflow artifacts (7 days). - Merge `development` into `main`: `version.yml` bumps the version, then `release.yml` publishes the GitHub release `vMAJOR.MINOR.PATCH` with all five files. - The APK needs the `ANDROID_KEYSTORE_B64` repository secret (`base64 -w0 android.keystore | gh secret set ANDROID_KEYSTORE_B64`); without it the Android build is skipped.