Asset formats & disc streaming
Shift Engine parses retail Xbox 360 Forza Horizon containers and asset formats directly using clean-room binary readers under libs/fh1data, libs/data, libs/cars, and libs/setup. Vehicles stream directly from disc and stock XMA2 audio decodes in-process, reducing initial setup to a compact colorado.index (~500 MB local footprint).
Zero-Bake Disc Streaming & Colorado HEXY PVS / 4-Tier LOD: Asset Overlay Precedence (highest to lowest): 1. Enabled mods (mods.toml / mod.toml): live texture reload and in-memory gamedb.slt patches. 2. Title Update v4 & DLC STFS packages (CON/LIVE/PIRS in state/): Horizon Rally, 1000 Club, DLC cars. 3. Optional .shiftbake cache (carbake / soundbake — not required). 4. Retail disc (.iso GDFX parser or extracted media/): direct streaming of FH1 ZIP/LZX, .carbin (with damage deformation tail), .xds (Xenos detiled), and in-process XMA2 audio. Local index: colorado.index + serialized NativeCache BVH4 (~500 MB). Colorado HEXY PVS Hex Grid (Colorado_00.hex, magic "HEXY" v101): - Flat-top odd-q hex grid, radius R = 100.0 m, origin (-6700.0, -6495.1904), 91 x 60 grid, 1,434 zones, per-zone 6-bit neighbor connectivity mask. - HexGrid::lookup_zone(x, z) falls back to a 4-ring BFS minimizing squared distance; active_zone_ring() returns the primary zone + up to 6 connected neighbors (7-zone ring). - PVSZLookup_00.dat + FilenameMap_00.dat map zone_id to 11-section __R00ZNNNNN.pvsz files (.pgeo scenery, .fiz collision). - Per-placement 4-tier LOD distances use Xbox 360 D3D FLOAT16 (subnormals flushed to zero, no Inf/NaN, 0x7FFF = +131,008.0, 0xBC00 = -1.0 sentinel resolving to [20, 40, 60] m defaults).
Format parsers at a glance#
Disc, STFS & archive containers
Clean-room GDFX/XISO reader (4 MB streaming chunks on desktop, Android, and WebGPU OPFS), STFS (CON/LIVE/PIRS) extractor, concurrent FH1 ZIP/LZX (libmspack), and read-only SQLite gamedb.slt with in-memory TU v4 / DLC / mod patches.
Textures (.xds) & Xenos detiling
Decodes BC1/BC2/BC3, DXN/CTX1 normal maps, RGBA8/RGB565/L8/RGBA16F, and 16³ 3D LUTs with CPU worker or GPU compute (rhi/xenos_detile_gpu.h) macro/micro detiling and exact sRGB vs. linear handling.
Vehicles (.carbin) & damage tail
Streams LOD0–LOD5 hierarchies, suspension/wheel hardpoints, rotors/calipers, cockpit needles, lamps, paint/livery UVs, and per-vertex deformation offsets bound to drive::VoxelDamageGrid (mirroring Z from -Z to +Z forward on upload).
Colorado PVS & cached BVH4
Parses Colorado_00.hex ("HEXY" v101, 100 m radius, 1,434 zones), PVSZLookup_00.dat, and 11-section .pvsz files with Xbox 360 D3D FLOAT16 LOD distances; persists pre-built SIMD BVH4 collision blobs in NativeCache.
Validating parsers locally#
Unit tests run on synthetic bytes in CI; optional corpus tests validate every format parser against your own local disc (auto-skipping with exit code 77 when SHIFT_GAME_ROOT is unset):
ctest --test-dir build -LE corpus --output-on-failure
SHIFT_GAME_ROOT=/path/to/fh1/disc ctest --test-dir build -L corpus --output-on-failure