Files
pokemon_pinball_wiki/godot-and-radium-assets.md
2026-07-07 00:25:38 -05:00

160 lines
9.9 KiB
Markdown

# Godot and Radium Assets
## Summary
Static extraction produced a new workspace-local `assets/` directory. The source rootfs evidence files were not modified.
Generated outputs:
- `assets/godot_raw/`: all 2,350 entries from `/games/pokemon_pro/assets/godot/main.pck`, with RSCC/zstd-compressed entries decompressed where applicable.
- `assets/openable/images/imported/`: 1,050 WebP images carved from Godot `.ctex` texture resources.
- `assets/openable/videos/`: 10 MP4 files from the Godot pack.
- `assets/openable/text/`: 1,170 text metadata/config files from the Godot pack, written with `.txt` suffixes for easy opening.
- `assets/openable/loose/`: 430 openable files copied from loose files under `/games/pokemon_pro/assets`, including PNG, TTF, MP4, and MOV files with normal extensions.
- `assets/manifest.json`: PCK extraction manifest with source hash, offsets, sizes, MD5 values from the PCK table, decoded paths, and converted output paths.
- `assets/loose_manifest.json`: loose asset copy manifest with source paths, output paths, sizes, and SHA-256 values.
- `godot_editor_project/`: first-pass editor-openable reconstruction copied from `assets/godot_raw/` with a reconstructed `project.godot`.
- `project_basic_exported.zip`: first-pass zip of `godot_editor_project/` contents with `project.godot` at archive root.
- `godot_editor_project_reconstructed/`: improved editor-openable reconstruction with restored PNG source files and copied loose `lcd`/`nuk` assets.
- `project.zip` and `project_reconstructed.zip`: improved reconstruction archives; both currently have the same SHA-256.
- `analysis/media-audio-scan.tsv`: `ffprobe` scan of Godot MP4s and loose Radium `.asset` media containers.
Final openable count, excluding generated metadata files:
| Extension | Count |
| --- | ---: |
| `.txt` | 1,170 |
| `.webp` | 1,050 |
| `.mp4` | 258 |
| `.png` | 162 |
| `.mov` | 15 |
| `.ttf` | 5 |
| **Total** | **2,660** |
Commands used:
```sh
python3 rootfs-triage-wiki/scripts/extract_godot_pck_assets.py --pck games/pokemon_pro/assets/godot/main.pck --output assets
python3 rootfs-triage-wiki/scripts/harvest_loose_openable_assets.py --source games/pokemon_pro/assets --output assets/openable/loose --manifest assets/loose_manifest.json
mkdir godot_editor_project
cp -R assets/godot_raw/. godot_editor_project
(cd godot_editor_project && zip -r -q ../project.zip . -x '*.DS_Store' '__MACOSX/*')
python3 rootfs-triage-wiki/scripts/build_godot_editor_reconstruction.py
cp project.zip project_basic_exported.zip
cp project_reconstructed.zip project.zip
```
## Godot Editor Reconstruction
The first-pass `project.zip` wrapper was created as a Godot editor-openable reconstruction from the already extracted PCK contents, then preserved as `project_basic_exported.zip`.
The improved `project.zip` was then created by `rootfs-triage-wiki/scripts/build_godot_editor_reconstruction.py`. Confirmed static archive facts:
- `project.zip` size: `980,835,332` bytes.
- SHA-256: `ad44ee65ddbd7f0a44e0a4b7f15332460fa48185fc45b12dc74b10f9dece9334`.
- `project_reconstructed.zip` has the same SHA-256 and is kept under an explicit reconstruction name.
- `zipinfo -t project.zip` reported `3871 files`, `1162014868 bytes uncompressed`, and no archive errors.
- `project.godot` is at the archive root.
- `godot_editor_project_reconstructed/project.godot` SHA-256: `4be4399dcebce7d3f857dd76319061ef4284a65770fe3de3d742668c31ae8fbf`.
- The reconstruction restored `1050` source-like PNG files from `1050` Godot `.png.import` entries by carving WebP payloads from `.ctex` files and converting them to PNG with ImageMagick.
- The reconstruction copied loose `/games/pokemon_pro/assets/lcd` and `/games/pokemon_pro/assets/nuk` under `rootfs_loose_assets/` inside the Godot project for inspection. These are not native Godot resources.
First-pass archive facts:
- `project_basic_exported.zip` size: `255,346,627` bytes.
- SHA-256: `05d2606f23e694c369c855a232a787e03b8c838b346558df615598f01519cca1`.
- `zipinfo -t project_basic_exported.zip` reported `2466 files`, `256063801 bytes uncompressed`, and no archive errors before it was superseded.
- `godot_editor_project/project.godot` SHA-256: `833e470c341b0f96284398890b2eae31e5933477234185f8695781f0aa0ceba1`.
The reconstructed `project.godot` uses values recovered from `assets/godot_raw/project.binary`:
- Project name: `pokemon_battle_previs`.
- Main scene: `res://scenes/main/main.tscn`.
- Feature tags: `4.4` and `Forward Plus`.
- Viewport: `1920x1080`.
- Autoloads: `PokemonData`, `Spike`, `AsyncLoadUtilV2`, and `SpikeGameSoundIds0`.
Important limitation: this is not the original source project. The exported pack contains compiled `.gdc` bytecode, `.gd.remap` files, `.tscn.remap` files, exported binary `.scn` resources, and imported texture/font cache resources. The improved project should be more useful in the editor because PNG source paths exist again, but script source editing and scene editing will still be limited compared with the original development checkout.
## Audio and Sound Asset Status
Static evidence does not show a standalone Godot sound library in `/games/pokemon_pro/assets/godot/main.pck`:
- `find assets/godot_raw -type f` found no `.ogg`, `.wav`, `.mp3`, `.sample`, `.stream`, `.bnk`, or `.wem` files.
- PCK extraction produced `10` MP4 files, `1050` texture imports, `93` compiled scripts, and `22` exported scene resources.
- The exported Godot script `scripts/spike_game_sound_ids.gdc` exists, with a `.gd.remap`, but the original GDScript source is not present. A later static decoder recovered its compiled constant catalog: 760 `SE_*` sound names are listed in `analysis/godot-introspection/gdc_sound_refs.tsv`.
Static evidence also found no standalone audio files by extension under `/games/pokemon_pro`. A broader whole-target-root scan is documented in `audio-asset-search.md`; it found no target-root file with an `ffprobe`-confirmed audio stream.
`analysis/media-audio-scan.tsv` used `ffprobe` on `273` media candidates from `assets/godot_raw` and `/games/pokemon_pro/assets`:
- `273` files were probed successfully.
- `272` files were video-only containers.
- `1` file had an audio stream: `assets/godot_raw/scenes/shared_items/gfx/bknd/Arena_Neon/Tournament_Neon_01_22_26_h265.mp4`, with streams `0:video:hevc,1:audio:aac`.
The main game binary is linked against ALSA (`libasound.so.2`) and includes audio adjustment strings such as `AD_SOUND_MASTER_VOLUME_SETTING`, `AD_MUSIC_ATTENUATION`, and `AD_ENABLE_SPIKE3_BOOT_SOUND`. Inference: most gameplay sound content is probably not represented as standalone Godot audio resources in `main.pck`; it is likely handled by the native game/Radium asset path or another internal runtime format. Further confirmation requires deeper reverse engineering of the native asset/sound lookup path.
## Godot PCK Evidence
`/games/pokemon_pro/game` embeds Godot runtime strings and references the pack path:
- `./assets/godot/main.pck`
- `Godot Engine v4.4.1.stable.custom_build`
- `COMPRESSION_ZSTD`
- `RSCC`
`/games/pokemon_pro/assets/godot/main.pck` has SHA-256:
```text
04af0fd78866ec3ae60b10311dedb3df2f3877595d19ee7bb01665ab10512778
```
The PCK header starts with `GDPC`; the parsed header values are:
- PCK format: `2`
- Godot version tuple: `4.4.1`
- file table count: `2,350`
- payload base/file table end: `0x41870`
The PCK table layout used by `rootfs-triage-wiki/scripts/extract_godot_pck_assets.py` is:
- `uint32 path_length`
- NUL-terminated path bytes
- `uint64 payload_offset`, relative to payload base `0x41870`
- `uint64 payload_size`
- 16-byte MD5 stored by the PCK
- `uint32 flags`
Confirmed examples from the table:
- `.godot/imported/Stern_Aztech.ttf-3064810bd5908d7a5012fbe63bbbf40b.fontdata` starts at relative offset `0x0`.
- `fonts/Stern_Aztech.ttf.import` starts at relative offset `0x3c50`.
- `.godot/exported/133200997/export-2260fc5460b11a2a7043d0925ae7e8df-progress_bars.scn` starts at relative offset `0x464be10`.
Three `.fontdata` entries were preserved in `assets/godot_raw/`, but the static carve did not find directly embedded standalone sfnt/TTF payloads in those Godot FontFile resources. The loose asset harvest did recover 5 TTF files already present under `/games/pokemon_pro/assets`.
## Loose Asset Evidence
The rootfs also contains loose files under `/games/pokemon_pro/assets`. Static `file` triage showed many already-openable files and many Radium-specific files:
- 263 ISO media files.
- 162 PNG files.
- 5 TrueType font files.
- 27 generic `data` files, including Radium scene files.
The helper `rootfs-triage-wiki/scripts/harvest_loose_openable_assets.py` copied only files with clear PNG, sfnt/TTF, or ISO media headers. `.asset` files with `ftypqt ` were copied with `.mov`; other ISO media files were copied with `.mp4`.
## `image.bin` Status
`/games/pokemon_pro/image.bin` remains a separate large Radium/runtime image. Confirmed static facts:
- Size: `1,154,884,359` bytes.
- SHA-256 is recorded in `artifact-index.md`.
- The game binary includes strings `image.bin`, `Flash memory init mmap failed`, `Flash memory sidecar mmap threshold failed`, `radium`, `/lcd/demand_loaded`, and `/lcd/auto_loaded`.
- `binwalk games/pokemon_pro/image.bin` did not identify extractable standard media; it only reported copyright text and a likely false-positive `JBOOT STAG` signature at `0xD36E9D6`.
- Exact scans found no PNG, OGG, MP4 `ftyp`, WAV, or WebP signatures in `image.bin`.
Inference refined by Ghidra xrefs and the parser documented in `radium-image-format.md`: `image.bin` is a Radium mmap-oriented runtime image rather than a standard archive. Section 8 of `/games/pokemon_pro/image.bin` is confirmed as a `2491`-row table of headerless 16-bit PCM chunks. Reversing its command-stream/object-ID mapping remains a separate analysis task.
Follow-up export status: all `2491` section 8 chunks are now exported as WAV files under `analysis/radium-image/sounds/` and preview pages are generated from `sound-export.md`. Reconstructed openable assets under `assets/openable/` are previewed from `asset-previews.md`.