Archive vs. Raw Assets: Choosing the Right Deployment Strategy in Ren'Py
0 reputation · 05 Aug 2025, 04:37 UTC
0 reputation · 05 Aug 2025, 04:37 UTC
Ren'Py distributes game assets either as raw files in the game directory or bundled into .rpa archives. Raw files enable instant hot‑reloading during local development, while archives lock assets and improve load times for released builds.
Developers often test on Windows or macOS, whose file systems are case‑insensitive. When the same game is deployed on Linux, a file named Image.png may be referenced as image.png in the script, causing a File Not Found error because the archive or directory entry does not match the exact case.
Should a production release keep assets in the game directory to simplify patching, or bundle them into .rpa archives to protect the code and reduce load times, especially when the deployment target is a case‑sensitive file system?
game directory over duplicates in .rpa archives, and how does this affect asset overrides?35275 reputation · 05 Aug 2025, 15:38 UTC
Ship release builds with .rpa archives and keep the game/ directory as an override layer. Ren'Py resolves a path by looking in the raw game/ tree first and only then in the archives, so a loose file at the same relative path wins. That one rule answers both halves of the question: archives for code protection and tidier distribution, raw files for hot-reload and for patching a shipped build without repacking.
Duplicates between game/ and an archive are not an error — they are the supported override mechanism. The practical consequences cut both ways:
game/; the archive stays untouched.Which paths end up archived versus loose is decided by the build rules in the build section of options.rpy (the build.classify / build.archive pattern rules). If you want a path to stay patchable, make that decision there rather than by hand-editing archives.
Archives store entry names exactly as they appeared on disk at build time. On Linux and other case-sensitive file systems, a script reference to images/bg.png will not match an archive entry named images/BG.png. Windows and macOS hide this because their default file systems are case-insensitive, so the same build works locally and fails on a Linux target.
Two details make this harder to diagnose than it looks:
Marked for review: image tag lookups such as show eileen happy go through Ren'Py's image registry rather than the file loader, so case rules there may differ from file-path rules. I have not verified that distinction here.
game/images/bg.png.Avoid renaming an .rpa to .zip and editing it in place. That is not a supported workflow and risks corrupting the archive. Use the SDK's build/distribute flow, or a maintained third-party reader if you only need to inspect entries.
# 1. Read-only: list paths that differ only by case
find game -type f | tr 'A-Z' 'a-z' | sort | uniq -d
# 2. Confirm the exact case of a referenced file
ls -l game/images/bg.png
# 3. Static check of loadable references
/path/to/renpy.sh /path/to/project lint
Run the lint step on Linux or in a Linux container — that is where the mismatch reproduces. Then launch the build on Linux and confirm the patched asset appears without repacking.
If you only ever target Windows and macOS, the case issue largely disappears and the archive decision reduces to load behavior and code protection. If you need frequent per-asset patches, keep a dedicated loose directory and add build rules that keep it out of archives.
Version assumption: this describes Ren'Py 7.4+/8.x behavior. Exact CLI subcommand names vary slightly between releases, so confirm against your installed SDK's launcher.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.