Files
RP412/tools/pages/README.md
T
CydandClaude Opus 5 6c3127a94d Every track, seen from above
docs/tracks.html joins the roster page: all 18 tracks with a plan view, what
the console calls them, which scenarios offer them, and how big they are.

There are no track maps in the game's files. The console had pictures of
them and those pictures did not survive - RPConfig.xml still points at
"images/red planet maps/Wiseguy's Wake.bmp" and the folder is gone. So the
plans are drawn from the tracks themselves. A map's instance stream places
its scenery: 76-byte records carrying a position at +48 and a unit
quaternion at +60, a few of them longer, so the reader resyncs on an
unexpected class id rather than trusting the stride. The quaternion doubles
as a checksum - a mis-read almost never yields a unit one - and 17 of the 18
decode every instance the header promises. Trough gives up 631 of 633 and
the card says so.

Seen this way the tracks have obvious shapes: Brewer's Bane turns two
corners, Tour De Mars is one 23,000-unit run, and both arenas are a regular
lattice of obstacles rather than a route at all.

The eras come from the resource-file archaeology rather than a guess: 9
tracks shipped in the 4.10 cabinets, headoff and headmf arrived with 4.11,
and 7 were built by the community afterwards. Scenario legality is read out
of the front end's own kMaps and kFootballMaps, so the page cannot claim a
track is offered when the menu does not offer it.

tools/pages carries the generators for both reference pages, with a README
covering the two formats they read and the id-alignment the listing is
needed for. They were scratch scripts until now, which made a committed
page harder to regenerate than to rebuild by hand.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 10:27:26 -05:00

46 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Regenerating the reference pages
`docs/vtv-presets.html` and `docs/tracks.html` are generated from
`assets/RP411/RPL4.RES`, the gauge config, and the console's `RPConfig.xml`.
Both are committed, so this is only needed when the resource file changes.
Both need a resource listing from the original tool, which is the authority
for resource ids — the directory can be walked in file order, but the ids
have holes (this file leaves 53 and 56 unassigned) so the walk has to be
aligned against the listing:
```powershell
Release\RPL4TOOL.exe -l assets\RP411\RPL4.RES > listing.txt # ends in _getch(); close it
python tools\pages\extract_presets.py vtv.json listing.txt
python tools\pages\build_page.py vtv.json docs\vtv-presets.html
python tools\pages\build_tracks.py listing.txt docs\tracks.html
```
`RPL4TOOL` finishes with `_getch()` (`RP_L4/RPL4TOOL.cpp`), so with stdout
redirected it writes the whole listing and then waits for a keypress —
close it once the file stops growing.
## What each reads
| script | reads | writes |
|---|---|---|
| `extract_presets.py` | RES, `L4GAUGE.CFG`, `tools/console-config/RPConfig.xml`, listing | `vtv.json` |
| `build_page.py` | `vtv.json`, `GAUGE/s*.pcc` silhouettes | `docs/vtv-presets.html` |
| `build_tracks.py` | RES, listing, `RPConfig.xml`, `RPL4FE.cpp` catalogs, `tracks.css/js/tpl` | `docs/tracks.html` |
`build_tracks.py` reads the front end's own `kMaps` / `kFootballMaps` arrays
so the page cannot claim a track is offered when the menu does not offer it.
## Two formats worth knowing
**Control mappings.** A vehicle's `ControlsMappings List` holds the resource
ids of its `L4` and `Thrustmaster` streams. Streams are named plainly, so
there is nothing in a stream saying whose it is — resolve by id, never by
which vehicle name sits nearest in the file. Records are 24 bytes and carry
their own mode mask; bits 38 are `ModePreset1..6`.
**Map instances.** 76-byte records: class id at +0, position at +48, unit
quaternion at +60. A few records are longer, so resync on an unexpected
class id rather than trusting the stride. The quaternion doubles as a
checksum — a mis-read almost never produces a unit one.