This chapter is a reference for FH2's own file formats: the archives the game mounts, the files that make up a world (placement, visibility, models, textures, materials, shaders, collision, AI lines, effects, crowds) and the files inside a car's zip. You need it if you write tools that build or change game data, or if you debug a file the game refuses. Each format says where it lives, what it holds, its byte layout as far as it is known, how the game reads it, what you can safely change, and how sure we are.
Addresses are for forza_durango_release_final.exe of 24 Nov 2015 (TimeDateStamp 0x565501ED, SizeOfImage
0x3A18000), image base 0x140000000. They are given as an RVA (game+0x114B0C0) and in full (0x14114B0C0). See
chapter 1 for the build and chapter 5 before hooking any of the readers named
here.
The game database (gamedbRC.slt, SQLite) and string-table use are covered in chapter 4; this
chapter only points there.
10.1 How to read this chapter
Status words. Every format and most fields carry one of these:
| Status | Meaning |
|---|---|
| Proven in game | A file written to this layout loaded and behaved as described in a real run |
| Offline only | Worked out from the exe with a disassembler, or by decoding every stock file and rebuilding it byte for byte. Likely right, but nobody has shipped a changed file to prove it |
| Unconfirmed | A reading that fits the bytes but was not traced in code or tested |
Most byte layouts below were worked out offline: by reading the exe's serialisers and by making a reader and writer that round-trips every stock file byte for byte. That is strong evidence for the layout, but it says nothing about which fields the game actually uses. Where a changed file was then loaded in game, the entry says so.
Conventions. Everything is little-endian unless marked (the .col file is mostly big-endian). u8/u16/u32/u64
are unsigned, i16/i32/i64 signed, f32 a float, half a 16-bit float. A "string" is a u32 length followed by
that many bytes, with no terminator, unless stated. Offsets in tables are from the start of the record or section.
Change rules that apply to every format:
- Never edit the game's own zips or
media\zipmanifest.xmlin place. Serve changed files through an override layer: the platform'sapi->set_file(...)(chapter 2), Extra Options' media folders (chapter 3), ormediaoverride. - The game trusts its data. Readers rarely check magic numbers, sizes or counts. A wrong count reads past the end of a buffer; a missing model or material makes a load wait for ever. Validate files offline before you ship them.
- Most files are read once at start-up or once per world load. Changes show on the next launch or world load.
10.2 Summary of formats
| Format | Where it lives | Magic / version | Status |
|---|---|---|---|
| Game zip | media\**\*.zip, track bin.zip, car zips | PKZIP + central extra field 0x1123 | Proven in game |
zipmanifest.xml | media\ | <ZipFiles version="3"> | Proven in game (new car zip lines) |
| GeoChunk archive | tracks\<T>\GeoChunk<n> (.minizip) | PGZP v100 / v101 | Proven in game |
ChunkMap<n>.dat, ChunkAssign.dat, PVSZLookup.dat | track folder | raw u32 tables | Proven in game (ChunkMap); offline only (others) |
AssetManifest.xml | track bin.zip | XML | Proven in game (consistency only) |
| Grub bundle | models, textures, materials, shaders, particles | burG 1.0 | Proven in game |
.pvs world root | tracks\<T>\ribbon_00\ | SVPF v60 | Offline only (layout); many fields proven in game |
| PVSZ visibility cell | GeoChunk key type 0x0C | PVSZ | Proven in game |
.hex cell grid | ribbon_00\<T>out_00.hex | HEXY v100 / v101 | Proven in game |
.modelbin | bin.zip, GeoChunks, car zips | burG with Modl 1.1, Mesh 1.7 | Proven in game |
.swatchbin texture | everywhere | burG with TXCB 2.0 | Offline only (tiling); written textures proven in game |
.materialbin, MatI | bin.zip, _library, inside models | MATL / MatI 1.0.2 + MTPR 2.0 | Proven in game |
.shaderbin + DXBC | bin.zip\Shaders\, _library | LSCE/DBLS 1.4.2 | Offline only; copying shaders proven in game |
.col track collision | ribbon_NN\<T>_track_NN.col | version 2, big-endian | Offline only |
.phys collision template | GeoChunk key type 0x01 | none | Proven in game (by a track-import mod) |
PhysicsDefinitions.bin | track folder | definitions v20 | Offline only; built smashables proven in game |
.pgeo procedural block | GeoChunk key type 0x00 | none (u32 version 5 inside) | Offline only |
.plib template library | ribbon_00\instancetemplates\ | version 11 | Partly decoded, offline only |
.nav road graph | ribbon_00\<T>_00.nav | WVAN 0x100 | Offline only; a built nav used in game |
.owt race line | OpenWorld\<T>\AITracks\Route<id>.owt | FTWO 3 | Proven in game |
.oww lane tile list | ribbon_00\<T>_00.oww | FWWO 0x102 | Proven in game |
| LBWO lane tile | GeoChunk key type 0x03 | LBWO 0x102 | Proven in game |
.nt route locators | tracks\<T>\trackroutes\ | XML | Proven in game |
triggers.tz, .tz | tracks\<T>\triggerzones\ | XML | Proven in game |
| Compiled trigger zone | GeoChunk key type 0x08 | version 1 | Offline only |
| AudioTile | GeoChunk key type 0x09 | XML | Offline only |
| FMOD bank entry | GeoChunk key type 0x0A | 32-byte header + bank | Offline only |
| TDAO settings and tiles | tdaosettings.bin, key type 0x0D | DDS with DX10 header | Proven in game |
ParticleInstances.particlebin | ribbon_NN\ | burG with BLCP 2.2 | Offline only (writer byte-exact) |
TriggerVolumes.xml | ribbon_NN\ | XML, Volume v4 | Offline only (does nothing in retail) |
Lights_*.lightdb | track folder | PVSL 2 | Offline only |
.crowd | ribbon_NN\<T>_track_NN.crowd | version 4 | Proven in game |
Granny .gr2, .gsf | cars, tracks, characters | Granny 2.9 | Offline only (partly) |
.carbin | car zip | v5, model v15 | Proven in game |
physicsdefinition.bin (car) | car zip | v20 | Offline only |
Lights.bin, LightPresets.bin | car zip | 0xDEADBEEF v1, LDFB v1 | Offline only |
ManufacturerColors.bin | car zip | burG with MNCL 1.0 | Offline only |
.fcx car recording | written by the game and mods | version 2 | Proven in game |
.str string table | StringTables\<LANG>.zip | LSB2 | Proven in game |
.vfont | media\ui\Fonts.zip | none | Offline only (partly) |
| Camera and cinematic XML | ribbon_NN\, Cinematics.zip | XML | Proven in game |
| Map profile XML | media\ui\MapProfile*.xml | XML | Proven in game |
Weather and time-of-day .fxb | media\weather\, timeofday\ | typed curves | Same-size edits proven in game |
| Bink video | media\ | KB2i (Bink 2), BIKi | Proven in game (both play) |
| Game database | media\Stripped\gamedbRC.slt | SQLite | See chapter 4 |
10.3 Common building blocks
Name hashes
Assets refer to each other by CRC-32 (the zlib polynomial) of a lower-case logical path, the path an asset asks for. Proven in game: added textures and materials were found by these hashes.
| What | Hashed string |
|---|---|
| Material | game:\media\ + manifest Source + bin |
| Shader | game:\media\<Source folder>\<name>\<name>.shaderbin |
Texture (_0xXXXXXXXX names, SourceHash) | game:\media\ + Source + bin |
Sound bank (GeoChunk 0x0A, _soundbank_lookup.xml) | lower-case bank file name, stored as a signed i32 |
Example: game:\media\tracks\_library\shaders\diffnormmaskgloss\diffnormmaskgloss.shaderbin hashes to 0x300596DA.
Shader parameter hashes are CRC-32 of the exact-case HLSL variable name, for example DiffuseATexture =
0x6DD98CD9, AOTexture = 0x0FEA383B, NormalATexture = 0x90D92494, GlossATexture = 0xC02E7A6E.
Packed resource keys
Streamed world resources live in GeoChunk archives and are named by a packed u32 key: type << 24 | id (a u24
id, a u8 type; the top bit of the type is a flag, so mask the type with 0x7F).
| Type | Contents | Id |
|---|---|---|
0x00 | .pgeo procedural instance blocks (props, vegetation, crowds) | pgeo id |
0x01 | .phys collision templates | template id |
0x03 | LBWO AI lane tiles | index in the .oww list |
0x04 | models (.modelbin) | model file number |
0x05 | texture pieces (.swatchbin) | texture index x 16 + (streaming level - 1); piece 0 = small mips |
0x07 | Granny skeleton .gr2 of a model | manifest model index |
0x08 | compiled trigger zones (ambience, reverb, rain, car meets) | zone id |
0x09 | AudioTile XML | PVSZ cell id |
0x0A | FMOD Studio bank entries | bank id |
0x0B | PVSL blocks (96 bytes: a 4x4 identity matrix and two index pairs) | |
0x0C | PVSZ visibility cells | cell index |
0x0D | TDAO tiles (top-down ambient occlusion) | tile id |
Texture keys are built at game+0x1340F9D (0x141340F9D): 0x05000000 + (texture index << 4) + (level - 1).
Grub bundles (burG)
Models, textures, materials, shaders, colour lists and particle files all share one container. The tag Grub is
stored reversed, as burG; every section tag is stored reversed the same way (Modl is stored as ldoM). The reader
game+0x13E6A60 (0x1413E6A60) does not check the magic or version.
| Offset | Type | Meaning |
|---|---|---|
| 0x00 | char[4] | burG |
| 0x04 | u8, u8 | major 1, minor 0 (another Forza game uses 1.1 with a 4-byte longer header; FH2 needs 1.0) |
| 0x06 | u16 | section count |
| 0x08 | u32 | header size (where section data starts) |
| 0x0C | u32 | total size |
| 0x10 | 24 bytes x n | section entries |
Section entry (24 bytes): char[4] tag reversed (ldoM, hseM, BCXT, ...), u8 major, u8 minor, u16
metadata count, u32 metadata offset, u32 data offset, u32 data size, u32 unpacked size (offsets from the
bundle start; the unpacked size equals the data size in every stock file).
Metadata is a run of 8-byte headers {u32 tag (reversed), u16 size << 4 | flags, u16 offset from this header to its payload}, then the payloads back to back, padded to 4 bytes. Tags seen:
| Tag (stored) | Meaning | Payload |
|---|---|---|
emaN (Name) | section name | raw characters |
dI (Id) | section id | i32 |
xoBB (BBox) | bounding box | 6 f32: min xyz, max xyz |
feRT (TRef) | textures used | u32 n + n texture hashes |
TSTA (ATST) | alpha test | 1 byte |
A section whose data starts with burG is a nested bundle. Rebuilding the metadata of all 20,994 stock track models
byte for byte works, so the layout is solid.
10.4 Archives and mounting
Game zips
Where: media\*.zip (UI, string tables, cinematics, sky, ...), every car's media\cars\<MediaName>.zip, every
track's bin.zip.
Layout. Standard PKZIP with FH2's own habits:
- Members raw-deflated (method 8), "version needed" 10, entries in upper-case name order.
- Local headers have no extra field.
- Every central-directory entry has an extra field with tag
0x1123, size 4, holding the absolute offset of the entry's compressed data (local header offset + 30 + name length). - No zip comment: the reader expects the end record at exactly file size - 22.
- At most 65,535 entries.
How the game reads it. The end record is read at file size - 22 by game+0x11F2230 (0x1411F2230). The entry
reader game+0x11E4F70..game+0x11E4FD8 (0x1411E4F70..0x1411E4FD8) takes the larger of the 0x1123 value and
the local header offset. Zips are opened with CreateFile2 at game+0x11F683E (0x1411F683E), and track zips are
opened lazily, at world load, by CCompressedVolume::Open game+0x11F6780 (0x1411F6780).
Safe to change. Write new zips with the layout above; generic zip libraries do not write the 0x1123 field. Zips
without it have loaded in one test, but that is unconfirmed, so write it. Status: offline only for the reader;
zips written this way are proven in game (car clones, car packs, track archives).
zipmanifest.xml
Where: media\zipmanifest.xml. UTF-8 with a BOM, CRLF line ends, about 609 lines, one per zip:
<ZipFiles version="3">
<Zip version="1" path="game:\media\cars\for_mustanggt_15.zip" priority="80" dirstart="19831020" dirsize="67706" direntries="548" />
</ZipFiles>
path is the zip's logical path; priority is 80 plus a bias (default 50, at settings+0x24A4); dirstart is the
central directory's offset, dirsize the bytes from there to the end of the file (end record included) and
direntries the entry count.
How the game reads it. Once, at start-up, by game+0xFD1600 (0x140FD1600), before the database is read. Only
zips listed here are mounted.
- A line for a missing zip crashes (null pointer at
game+0xFD1927,0x140FD1927). - An element that is not
Ziphangs start-up. - The three directory numbers are compared at
game+0x11F691A(0x1411F691A); if they don't match the zip, the zip's own end record is read instead. So a new zip's line works with any numbers, and correct numbers skip a scan. (This is the offline reading; older notes say the game trusts the numbers. Either way, never change a stock zip in place.) - The folder-scan gate at
game+0xFD165A/game+0xFD1666(0x140FD165A/0x140FD1666) reads two settings flags (findzipsat settings+0x24A1,mediaoverridesat settings+0x2B50). One mod patches it to mount zips found by scanning; such a patch must land before loading starts, or the game crashes about 3 seconds into loading.
Safe to change. Don't hand-edit the manifest. The FH2 Mod Platform (2.9.0 and later) writes a merged manifest into its own layer for car packs, and Extra Options 0.3 and later mounts add-on zips directly (chapter 3). Status: offline only for the reader; new car zip lines proven in game.
Mount priorities and loose files
Stock zips mount at 80 + bias. Override layers sit far above: the platform 2.9.0's own layer at 0x7FFFFFFE, its
car packs from 0x7FFFFFF0 down and mediaoverride / mediapc at 0x7FFFFF00 / 0x7FFFFEFF; Extra Options 0.3+
puts mediaoverride, mediapc and its carbin cache at 0x7FFFFFFE .. 0x7FFFFFFC and add-on zips from
0x70000001 up.
- A loose override
mediaoverride\X\path\filereplacespath\fileinsidemedia\X.zip. - Loose files are found only if the start-up scan saw them:
CFileVolume::Existsgame+0x11F9D30(0x1411F9D30) answers from the volume's hash list. ..in agame:\path stops the game, and host paths (C:\...) are never found: the game only sees Azimuth's drives (game:\= the Mount folder,T:\= Azimuth's persistent temp folder).
The file-system object (CFileSys, vtable game+0x2E6ED18, 0x142E6ED18) and its mount and resolve slots are
described in chapter 11.
GeoChunk archives (PGZP, .minizip)
Where: tracks\<T>\GeoChunk0 .. GeoChunk3 (each a .minizip), beside ChunkMap<n>.dat. They hold every
streamed world resource (keys in 10.3). Status: proven in game (rebuilt and appended chunks load; all 2,551
entries of the Autoshow studio world homespace02 decode).
| Offset | Type | Meaning |
|---|---|---|
| 0x00 | u32 | PGZP (0x505A4750) |
| 0x04 | u32 | version: 100 = zlib streams, 101 = raw deflate |
| 0x08 | u32 | directory offset (32) |
| 0x0C | u32 | entry count |
| 0x10 | u32 | folder (group) count |
| 0x14 | u32 | entries per segment (512) |
| 0x18 | u32 | segment count = ceil(entries / 512) |
| 0x1C | u32 | 1 (reserved) |
| 0x20 | u32[folders + 1] | cumulative first entry of each folder (0 ... count), zero padded to 8 |
Then per segment:
u64 segment data start (absolute)
n x { u32 offset from segment start, u32 uncompressed size, u16 flags, u16 folder number }
end sentinel { u32 end offset relative to the last segment, 0, 0, 0 }
- Flags (v100): low 14 bits = method (8 deflate, 0 stored); top 2 bits = trailing padding to 4 bytes. v101 uses a 12-bit method field.
- Data: v100 entries are zlib streams with header
48 C7(deflate, 4 KB window, Adler-32). FH2 inflates them with windowBits 12 atgame+0x11F6ABF(0x1411F6ABF); larger windows are rejected. - Pad the file with zeros to a multiple of 4,096 bytes. The game reads entries 4 KB-aligned, and a file padded only to 512 bytes failed with a read past the end. Proven in game.
- The game reads the directory as
round_up(size, 4096)bytes from offset 0.
A folder (group) is streamed as one block, so the group bits must match the entry's position. Entries appended in
the middle of a group, or with wrong group bits, crash inside zlib's bit reader (game+0x37DB, 0x1400037DB,
called from the entry reader game+0x11FC9E0, 0x1411FC9E0). Appended entries, such as new texture pieces or lane
tiles, load only when each sits in a group of its own. Write chunks whole. Proven in game.
ChunkMap, ChunkAssign and PVSZLookup
| File | Layout | Status |
|---|---|---|
ChunkMap<n>.dat | one u32 packed key per entry of GeoChunk<n>, in archive order | Proven in game |
ChunkAssign.dat | u32 100, u32 n cells, n u32 chunk numbers (one per cell), u32 m, m x {u32 cell, u32 cell, u32 chunk} crossing bundles | Offline only |
PVSZLookup.dat | one u32 per cell: its id in the streaming object-id space | Offline only |
Chunks hold overlapping cell sets: a cell's chunk also holds the blocks of its neighbours' cells (the studio world: 203 cells, 379 copies across 4 chunks; the mainland 2,835 cells and 1,160 crossing bundles).
The file cache
Streamed groups are kept in a 210 MiB I/O cache whose capacity is the value at [game+0x36614A8]
([0x1436614A8]). The allocator game+0x11E6490 (0x1411E6490) rounds each group up to 4 KiB and refuses when the
cache is full, which the log reports as Failed to load FileChunk. A world whose GeoChunks are much larger than stock
needs a bigger capacity: one write of a larger value (1,536 MiB was tested) before the world loads fixes it. Proven in
game. As a rule of thumb, a GeoChunk read whole costs its file size x 1.035 + 9 MiB.
10.5 What a track folder holds
A world (tracks\<T>\) is a set of files the exe asks for by name. The format strings are in the exe; the main ones:
| File | Loaded by | Section |
|---|---|---|
bin.zip | lazily at world load | 10.5 |
GeoChunk%d + ChunkMap%d.dat, ChunkAssign.dat, PVSZLookup.dat | world load and streaming | 10.4 |
Ribbon_%02d\%sout_%02d.pvs | world load, game+0x114B0C0 | 10.6 |
Ribbon_%02d\%sout_%02d.hex | world load | 10.6 |
tdaosettings.bin | world load, game+0x113BAB0 | 10.15 |
PhysicsDefinitions.bin | world load, game+0x377460 | 10.12 |
Ribbon_%02d\%s.nav, .oww | world load | 10.14 |
trackroutes\%s.nt, OpenWorld\%s\AITracks\%s.owt | per race | 10.14 |
triggerzones\tz_*\*.tz | world load | 10.14 |
ribbon GameObjs.xml, Locators.xml, TriggerVolumes.xml, PreRaceCams.xml, TrackSegCams.xml, ParticleInstances.particlebin | world load | 10.14, 10.16, 10.18 |
<T>_track_NN.crowd | world load | 10.16 |
Lights_*.lightdb / .lightrtudb / .animlightdb | world load | 10.15 |
Files the game never opens: PVSSamplePoints.bin (a build leftover, used only by a debug overlay), .imap,
<T>_track_00.col on the open-world maps, CollObjs.xml (its copy is 159 placeholders), the .sh road-lighting
files and staticcarcubemap.xpr (Xbox 360 leftovers in big-endian formats). Some Storm Island trigger zones and AI
files are loaded by the hard-coded name Test03 whatever the current world is.
An empty lights database is 12 bytes: PVSL, version 2 (or 1), count 0.
bin.zip contents
The track's asset zip. It uses the game zip layout above.
| Entry | Contents |
|---|---|
AssetManifest.xml | models, materials, shaders and textures with their sources |
Materials\_0xNNNNNNNN.materialbin | one material per hash-named file |
Shaders\_0xNN\<name>.shaderbin + .pc.vso, .pc.pso, .durango.*, .gso | shaders and their compiled variants |
_0xHASH.swatchbin | textures not streamed through GeoChunks |
Animations\*.GR2 | scenery animation (Granny) |
AssetManifest.xml
Lists models (with <Mesh> lists and <Instance Id="guid" Index="n" Ribbon="...">), materials, shaders
(<Shader Name="shaders\_0xNN\<name>.shaderbin" Source="...">) and textures (Source, SourceHash, Width,
Height, Compression, QualityLevels, Limited).
- The game does not read the texture attributes at run time. Streaming tables are built from the
.pvstexture records instead. Keep the manifest consistent anyway. - Manifest texture index x 16 + piece = the texture's chunk key id.
<Instance Index="i">=.pvsplacement record i; indices past the record count are smashable pieces.- On
Limited="1"entries,Widthholds the entry's own index. - Compressions in FH2's tracks: UnsignedBc5, Bc7, Bc1, UnsignedBc4, SignedBc5, R8G8B8A8, SignedBc4, UnsignedBc6H, R8. No track ships BC2 or BC3 (both still draw).
- Shaders can be copied from the mainland's
bin.zipinto anotherbin.zipunder the next free_0xNNfolder with a new manifest entry. Two entries may share aSource. Proven in game.
10.6 World layout: .pvs, PVSZ cells and .hex
.pvs world root (SVPF v60)
Where: tracks\<T>\ribbon_00\<T>out_00.pvs. One per world: mainland Anthem, Storm Island Test03, Test04
and the Autoshow studio homespace02. How read: serialiser game+0x114B0C0 (0x14114B0C0). Status: all four
stock files round-trip byte for byte (offline only); the fields marked below were changed and proven in game.
It holds the collision roots, the cell grid, the texture, shader and material registries, every placement ("draw") and a per-model record table. Two independent decoders read some sections differently; where they disagree both are noted.
Header:
| Offset | Type | Meaning |
|---|---|---|
| 0x00 | char[4] | SVPF (0x46505653) |
| 0x04 | u32 | version 60 |
| 0x08 | u32 | CPU data size (14,000,000 in stock files) |
| 0x0C | u32 | build stamp |
| 0x10 | u32 | count of pgeo (key type 0x00) ids; sizes the procedural tables |
| 0x14 | u32 | size of the streaming object-id space. Raise it when you add streamed objects (TDAO tiles, lane tiles). Proven in game |
| 0x18 | u32 | .phys / collision-object count |
| 0x1C | u32 | maximum ids in one cell (unconfirmed) |
| 0x20 | u32 | maximum records in one cell; raised with 0x14 when lane tiles were added (proven in game) |
A PVSZ record of type 0x00 in a world whose 0x10 count doesn't cover it reads an empty table and probably crashes
(unconfirmed, from code).
Sections, in order:
| Section | Layout |
|---|---|
| Objects (collision roots) | u32 n x 104 bytes {f32 4x4 matrix (translation in the last row), f32 min xyz + 0, max xyz + 1 (world box), u32 .phys id, i32} + u8 present + settings |
| Grid | f32 x0, z0, x1, z1, cell width, cell height; u32 0; 2 x u32 0; u16 0; u16 50; u8 0; u32 n + n x {u32 key, u32 cell}; u32 total cells (= PVSZ cells); u32 4; 4 level entries; u8 has_atlas |
| Textures | u32 n + 56-byte records (below) |
| Shaders | u32 n x {u32 hash, string game:\media\tracks\<T>\bin\shaders\_0x...\<name>.shaderbin} |
| Materials | same layout, ...\bin\materials\_0xNNNNNNNN.materialbin, in manifest order |
| Per-placement blocks | u32 n x {u32 0, u32 1, u32 k groups, k x {u32 m, m x (u8 slot, u32 texture index, u16 0xFFFF)}}; v60 keeps only slots 3/4 (cube probes) |
| Placements | u32 n + variable records (below) |
| Per-model records | u32 n + records (below) |
| Zones | u32 n x {u32 36, GUID, f32 x, y, z, radius, u8, u32, u32, u16 0}; probably the probe list |
| Tail | 3 index maps; secondary placements; string <T>out; 3 bools; 2 string tables (the second = .gsf animation paths); animation tables; optional per-zone u16 data; 3 i32 zone maxima; texture lookup table; u8 0 |
Grid examples: the studio spans -1108..1192 m in 100 m cells (23 x 23, 203 cells used); the mainland and Test04
use 139.273 m cells over x -5313.24..11264.39, z -8823.76..1052.54.
Shader and material paths are absolute. A world served from another folder must rewrite these paths, or it binds the original world's materials: models draw but every texture falls back to the default. A rewritten path must keep its byte length unless you rebuild the file. Proven in game.
Texture lookup table (end of file): u32 count + count x {u32 name hash, u32 texture index}, sorted by hash.
The game binary-searches it for each hash a material asks for. A texture with no pair is never found and samples
black. Proven in game.
Texture record (56 bytes)
The game builds its streaming tables from these, not from the manifest: u32 source hash, 4 format bytes (a copy of
swatchbin bytes 0x4F-0x51, then 0), 8 x u32, one per piece and 0 after the last, = mips in piece << 28 | byte offset of the piece, then 16 more bytes. Pixel data runs largest mip first: the top mip's piece is at offset 0, piece 0 (the small mips) last. Example, a
2048 BC7 texture in 4 pieces: 0x80550000, 0x20500000, 0x10400000, 0x10000000. Writing records from the pieces
reproduced all 7,428 mainland textures byte for byte. Proven in game.
Placement record (v60)
Called "draws" in the code. Copied unchanged into the instance at game+0x11337E0 (0x1411337E0); serialiser
game+0x114C8D0 (0x14114C8D0), draw constructor game+0x110FA80 (0x14110FA80).
| Offset | Type | Meaning |
|---|---|---|
| +0 | u32 | model file number (<T>out.%05d.modelbin, also the per-model record number; not the manifest position) |
| +4 | u16 | flags: bit 0x4 must be set to draw (clearing it hid a whole world); 0x2 = invisible placement |
| +6 | u16 | 0x?FFF; bit 0 of the top nibble = decal pass (road lines) |
| +8 | u16 | f8 flags: 0x40 = at origin (template placements); 0x100 adds the placement to the ground reflection; 0x1000 = cube-map-only stand-in; 0x2000 skips the small-object cull |
| +10 | u16 | mask: bits 2-5 = LOD bands 0-3 drawn (0x3C = all); bit 7 (0x80) = no sun-cascade shadow |
| +12 | u16 | instance index (manifest Instance & 0xFFFF; read and dropped) |
| +14 | 2 x u16 | links into the animation tables (0xFFFF = none) |
| +18 | 4 x half | LOD switch distances in metres (-1 = defaults 20/40/60/80; 65504 = never) |
| +26 | u8 | fixed-LOD keep flag |
| +27 | 3 x f32 | position |
| +39 | 9 x half | 3x3 rotation and scale rows |
| +57 | 4 x f32 | per-instance shader Vector4 (copied to material +0xE0) |
| +73 | 4 x i8 | relative offsets to this object's LOD0-3 records (127 = none) |
| +77 | u8 + items | item count, then items {u8 m, u16[m], i32, char[32] name}, e.g. BARN_FIND_11_CLOSED (a second decoder reads this as one settings block) |
| end | 4 x f32 | (0, 1, 0, v) |
A record without items is 94 bytes.
- Transform: world =
[v, 1] x M, with rows 0-2 = the nine halves and row 3 = the position (row vectors, no pivot). Moving a record moved the object. Proven in game. - No-shadow bit (mask 0x80): read at
game+0x1353BD2(0x141353BD2) in the sun-cascade branch of per-view visibility. Setting it on a large custom world's placements removed its self-shadow passes and doubled the frame rate. Proven in game. - Cube maps (car reflections): a placement only draws in a cube face if it has a separate "level 3 only" record or
bit 0x1000 in
f8. A placement with every LOD band in one record never appears in car reflections. Proven in game. - Small-object cull
game+0x133ADC0(0x14133ADC0) hides a placement when distance² x k1 > size x k2, unlessf8bit 0x2000 is set.
Per-model record
One per model file number: u32 t + t texture indices, u8 enabled, 80 bytes of box (3x4 axes, centre xyz, 1.0,
half extents xyz, in model space), 4 x i32 LOD0-3 model ids (-1 = none), then 9 bytes (byte 0 = has placements,
bytes 7-8 = u16 placement count; a second decoder reads them differently).
- The texture list must contain every texture the model's MatIs use. FH2's own maximum is 125.
- The list is limited to 256 positions. A streamed texture is re-bound by a 16-byte message whose list position
is a
u8(handlergame+0x13B6220,0x1413B6220; sendersgame+0x13B6449,0x13B73AD,0x13B74DD,0x132F1AB). A texture at position 256 or later re-binds the wrong texture (often a single-channel map in a colour slot, which shows red). Split big models into several. Proven in game. - LOD distance is measured from the camera to the nearest point of this box (
game+0x1251FE0,0x141251FE0; 0 when inside), so one huge mesh stays at LOD0 from far away. Split large meshes.
PVSZ visibility cells (key type 0x0C)
One entry per cell, read by game+0x114D230 (0x14114D230). Status: every stock cell rebuilds byte for byte;
changed cells proven in game.
'PVSZ', u8 0, then u32-counted vectors:
draws u32: placement index (low 30 bits); bit 30 = mirror view; bit 31 = car cube-map eligible
models u32 model file numbers visible from the cell
textures u32 texture indices to stream, ascending
qualities u16 per texture: pieces to stream (near cells all, far cells 1 = small mips)
dependencies {u32 object id, u32 chunk key (type << 24 | index)}: collision roots (0x01), neighbour cells
(0x0C), lane tiles (0x03), TDAO tiles (0x0D); 0x80-flagged keys are the prefetch ring
auxiliary u32 ids into the .pvs objects section
final u32 (empty)
- Placements become instances only through a cell's
drawskeys. The cell loadergame+0x139AC40(0x14139AC40, world vtable slot 0x158) refcounts each key; on the first reference it builds the 0x1F0-byte instance (game+0x137BD50,0x14137BD50). Slot 0x160 unloads. - The
modelsandtextureslists only drive streaming. A texture no cell lists is never streamed. - To add any streamed object (a texture, a lane tile, a TDAO tile), put a dependency record in every cell that should
load it, and raise the
.pvscount at 0x14.
.hex free-roam cell grid (HEXY)
Where: ribbon_00\<T>out_00.hex. Maps a position to a streaming cell. Status: proven in game (a world moved to
a new position loaded after growing this grid and the .pvs grid).
| Offset | Type | Meaning |
|---|---|---|
| 0x00 | u32 | HEXY (0x59584548) |
| 0x04 | u32 | version 100 or 101 |
| 0x08 | f32 | hexagon radius (100 m) |
| 0x0C | f32, f32 | origin x, origin z |
| 0x14 | u32 | cell count |
| 0x18 | u32, u32 | columns, rows |
| 0x20 | i32[rows x columns] | cell number per lattice slot, -1 = none |
| then | n x {i32 column, i32 row} | each cell's own slot |
| then (v101) | n x u8 | neighbour mask (6 bits; 63 mostly) |
Flat-top hexagons: columns 1.5 r apart (150 m), rows 2·√0.75·r apart (173.2 m), odd columns offset half a row. The
lookup mirrors game+0x1889D20 / game+0x1887DB0 (0x141889D20 / 0x141887DB0). A car position in no cell hangs
the boot's streaming wait. The mainland grid: origin (-4750, -9006.66), 105 x 54 slots, 2,796 cells.
10.7 Models (.modelbin)
Where: track models in GeoChunks (key 0x04) or bin.zip, car models in car zips (scene\...), characters in
their own zips. Same format everywhere. How read: Grub reader game+0x13E6A60; Mesh reader game+0x13F13C0
(0x1413F13C0). Status: proven in game (built and changed models draw); every stock track mesh rebuilds byte for
byte.
Sections
| Section | Version | Purpose |
|---|---|---|
Skel | 0.0 | bone tree |
MatI | 1.0.2 | material instances (10.9) |
Mesh | 1.7.2 | one per draw |
IndB | 1.0.1 | index buffer |
VLay / ILay | 1.1.1 | vertex layout / instanced layout |
VerB | 1.0.1 | vertex buffers |
Skin | 1.0.1 | skin weights |
MBuf, Mrph | 1.0, 0.0 | damage morph buffers and targets (cars) |
Modl | 1.1.2 (1.1.1 = no TRef) | model summary, always last |
Order in stock files: Skel, MatI, Mesh, IndB, VLay, [ILay], VerB, [Skin], Modl. A missing Modl or Skel crashes.
Modl (14 bytes)
u16 mesh count, u16 buffer count (VerB + IndB + Skin + MBuf), u16 layout count, u16 MatI count, u8 has
LOD, i8 highest-detail LOD, i8 lowest LOD (the track decode reads a u16 at 10), then u16 = OR of all mesh LOD
masks at 12.
Metadata: BBox = the corners of the non-Shadow meshes' boxes through their bones' world matrices; TRef = the
union of each MatI's texture hashes (order unknown; textures outside TRef still draw). Counts are trusted: wrong
counts crash or hang. Stock car maxima: 10 VLay, 16 VerB, 8 MBuf, 1 IndB, 74 MatIs.
Mesh 1.7
| Offset | Type | Meaning |
|---|---|---|
| 0 (0x00) | i16 | MatI, by its metadata Id (-1 for the Shadow mesh) |
| 2 (0x02) | i16 | rigid bone index |
| 4 (0x04) | u16 | LOD mask: bit k+1 = LOD k (cars use bit 0; 0xFFFF = none) |
| 6, 7 | u8, u8 | highest and lowest LOD (0x1E / 0xFF with no LOD) |
| 8 (0x08) | u16 | bucket flags: 0x1 opaque, 0x2 decal, 0x4 transparent, 0x8 shadow, 0x10 not shadow, 0x20 alpha to coverage. Seen: 0x11 opaque, 0x38 cut-out, 0x1C blended, 0x09 Shadow mesh |
| 10 | u8 | bucket order |
| 11 | u8 | skin influences per vertex |
| 12 | u8 | morph target count |
| 13 | u8 | is damage morph |
| 14 (0x0E) | u8 | 1 = 32-bit indices |
| 15 (0x0F) | u16 | topology (4 = triangle list) |
| 17 | i32 x 4 | index buffer, index offset, start index (+25), base vertex (+29) |
| 33 (0x21) | i32 | index count |
| 37 (0x25) | i32 | triangle count |
| 41 (0x29) | f32 | vertex-cache ratio (ACMR) |
| 45 (0x2D) | u32 | referenced vertex count |
| 49 (0x31) | i32 | vertex layout, by position in the file |
| 53 (0x35) | i32 n + n x 16 | streams {VerB Id (-1 = the shared position buffer, stride 12), slot, stride, byte offset} |
| then | 16 bytes | {-1 morph buffer, Skin Id, 0, source mesh = manifest <Mesh> index} |
| then | 5 x 4 f32 | UV transforms for TEXCOORD0-4: u = u_off + u_scale x raw / 65535 |
Vertex address = stream offset + (index + base vertex) x stride; indices are absolute. Most track meshes use 16-bit indices; 32-bit works.
The Shadow mesh is named Shadow, flags 0x09, MatI -1, vertex count 0, uses a position-only layout (always
last) and reuses the index ranges of the meshes that cast shadows.
Skel
u16 bone count; per bone a string name (Latin-1), i16 parent, i16 first child, i16 next sibling, 16 f32
local matrix (row-major, row vectors; world = local x parent world). Bone 0 is <root>. FH2 puts each track mesh on
its own bone named after the mesh, and applies bones to static meshes too, so one vertex set can be placed several
times (fences do this). Proven in game.
VLay and ILay
u16 name count + names (strings); u16 element count; 20-byte elements {u16 name index, u16 semantic index, u16 input slot, u16 instance step rate, u32 DXGI format, i32 byte offset (-1 = append), u32 slot class (0 vertex, 1 instance)}.
Then one u32 code per element (POSITION 3, NORMAL and TANGENT 9, TEXCOORD 46, COLOR 22; never used for drawing) and
a u32 input mask: TEXCOORDn = bit n, TANGENTn = bit 5+n, COLORn = bit 10+n. Elements map one to one onto
D3D11_INPUT_ELEMENT_DESC (game+0x13F2CD0, 0x1413F2CD0).
Formats: POSITION R32G32B32_FLOAT (stream 0, stride 12); NORMAL and TANGENT R16G16B16A16_FLOAT; TEXCOORD R16G16_UNORM, decoded by the mesh's UV transforms; COLOR R8G8B8A8_UNORM. Car layouts: TEXCOORD2 = ambient occlusion, TEXCOORD3 = livery UVs, stride 40, mask 111; glass also needs TEXCOORD4 and TANGENT4 (mask 598) or it is invisible.
ILay is the VLay plus a 24-byte per-instance stream in the next slot, used by procedural (instanced) models:
I_POS R16G16B16A16_UNORM, I_UVSCALE R8G8B8A8, I_XAXIS and I_YAXIS R10G10B10A2, I_COLOUR R8G8B8A8. A model has
an ILay exactly when it is named in a .plib (10.13).
VerB, IndB, Skin, MBuf
16-byte header: u32 count, u32 byte size, u16 stride, u16 element count, u32 DXGI format (VerB 10; IndB 42 =
R32_UINT or 57 = R16_UINT; Skin 34 = R16G16_FLOAT). Skin data is per vertex and influence {half weight, half bone},
read by the shader as Buffer<float2> with bones in a 2048-row constant buffer.
Meshes that draw black
At draw time the vertex and pixel shader setup (game+0x1134A40, check at 0x141134CDC; game+0x1133D20, check at
0x141134072) require (shader inputs & layout mask) == shader inputs. The shader's inputs come from the VDCL
block of its .shaderbin. If the layout lacks any declared input, the game swaps in built-in shaders whose pixel
shader writes (0, 0, 0, 1): solid black. A road without TANGENT drew black. Add missing inputs; append COLOR0
last so no offsets move. Proven in game.
Limits seen working: one model with 463 meshes and 305 MatIs; a scene model with 831 bones and 3,358 meshes. Each mesh is one draw call (and one more per shadow pass), so mesh count costs frame time.
10.8 Textures (.swatchbin)
Where: everywhere: track GeoChunks (key 0x05, in pieces), bin.zip, car zips, UI zips, map zips.
How read: game+0x10DBB90 (0x1410DBB90). The reader copies pixel data with no size check: a wrong header
draws garbage or reads out of bounds. Status: the tiling is offline only (364,284 pieces from two Forza games and
48,767 FH2 entries round-trip byte for byte); textures encoded this way are proven in game.
A swatchbin is a Grub bundle with one TXCB 2.0 section; its TXCH header body starts at file offset 0x30.
| File offset | Header +n | Type | Meaning |
|---|---|---|---|
| 0x0C | u32 | bundle size (0x53 + data) | |
| 0x20, 0x24 | u32 | data size | |
| 0x30 | +0 | 16 bytes | GUID |
| 0x40 | +16 | u16 x 3 | width, height, depth of this piece |
| 0x46 | +22 | u16 x 3 | full width, height, depth |
| 0x4C | +28 | u8 | mips in this piece |
| 0x4D | +29 | u8 | total mip count |
| 0x4E | +30 | u8 | first mip in this piece |
| 0x4F | +31 | u32 bit field | bits 0-4 tile mode (14 = 2D thin, 13 = 1D thin); bits 5-10 format; bits 11-16 transcoding; then colour profiles, domain; bit 25 cube; bit 26 3D; premultiplied; bits 28-31 log pitch |
| 0x51 | +33 | u8 | 0x12 = sRGB colour; 0x80 = lightmap/probe flag on some files |
| 0x53 | pixel data |
Format codes (bits 5-10): 0 BC1, 1 BC2, 2 BC3, 3 BC4, 4 BC4 signed (likely), 5 BC5, 6 BC5 signed, 7 BC6H unsigned, 8 BC6H signed (likely), 9 BC7, 11 RGBA16, 12 RGBA16F, 13 R8G8B8A8, 19 R8, 20 A8.
Header bytes 0x4F-0x52 of common stock textures: BC7 sRGB colour 2e 01 12 b0, BC4 interior gloss 6e 00 00 a0,
R8 car AO 6e 02 00 90, RGBA8 premultiplied dash ae 01 00 98.
The two notes on byte 0x51 agree on 0x12 = sRGB; for a linear texture (AO, gloss, normal) set it to 0. One reader also describes car textures as "1D thin"; the safe path is to copy the header from a stock texture of the same size and format and change only what you must.
Tiling
Pixel data is Xbox One GCN tiled, not row order:
- Elements (a 4x4 BC block or a texel) sit in 8x8 micro tiles in Z order.
- 2D mode: P4_16x16 pipes, 8 banks, bank width 1, 256-byte interleave. 4-, 8- and 16-byte elements use bank height 1 and macro aspect 2 (macro tile 64 x 32 elements); 1-byte elements bank height 4, aspect 4 (128 x 64).
- Array and cube slice s XORs
(3s) & 7into the bank bits. - Mip 0 is padded to whole macro tiles (2D) or multiples of 8 (1D). A mip stays 2D only while its pitch and height reach a macro tile (BC formats: 256 x 128 and up), smaller mips are 1D.
- In a piece: mips largest first, each rounded up to 256 bytes, each holding all its slices (a cube's 6 faces take 8 slots). There is no mip tail.
Because mip L of a W-wide texture is tiled exactly like mip L-1 of a W/2 texture, dropping the top pieces only changes the header (full size >> d, mip count - d, first mip - d). Proven in game. The reverse is not true: a 1D-tiled small mip moved up to become mip 0 must be re-tiled.
Adding a texture to a track
All of these are needed, and all are proven in game:
- A 56-byte texture record in the
.pvs. - A pair in the
.pvslookup table, inserted in hash order. - The pieces in a GeoChunk, keyed
index x 16 + piece, each piece in a group of its own. - The texture index, with a piece count, in every PVSZ cell that sees the model.
- The index in the model's per-model texture list (mind the 256 limit).
- A manifest entry (for consistency only).
Other swatchbins
- Map pictures (
media\ui\textures\data_bound\The_Island.zip,Anthem_Map.zip):Map/low-0-0.swatchbin(Storm Island 2048 x 3584 BC7, one mip) andMap/high-<row>-<col>.swatchbintiles (1024 x 1024 BC7). A loose override reaches the file inside the zip, and RGBA8 is accepted. Proven in game. The map layers are configured inMapProfile*.xml(10.18). - Car thumbnails:
Stripped\RC1\Thumbnail_<car>_Big.swatchbin(816 x 459) and_Small(192 x 108), BC7, one mip. Keep the top left of_Bigempty: the Autoshow writes the make and model there. Name built atgame+0x26E290(0x14026E290). - Car AO maps: R8, 255 = open.
10.9 Materials (.materialbin, MatI, MTPR)
Where: track bin.zip\Materials\, media\cars\_library\Materials.zip (3,493 shared car materials), car zips,
and inside every model as MatI sections. How read: builders Material game+0x10DB1C0 (0x1410DB1C0), MatI
game+0x10E1D50 (0x1410E1D50); Material::Build game+0x10F1350 (0x1410F1350), MaterialInstance::Build
game+0x10F15B0 (0x1410F15B0); alpha test (ATST) handled at game+0x10DA540 (0x1410DA540). Status: proven
in game.
The binding chain:
Mesh --MatI index--> MatI (in the model) --path--> material (.materialbin) --path--> shader (.shaderbin)
MTPR: per-instance values MTPR: material values
MATL(LTAM1.0.2) andMatI(ITAM1.0.2): aNamemetadata entry (and an optional 1-byteATSTalpha flag), payload = a path length (u8, or a 2-byte varint from 128) and the shader's (for MATL) or base material's (for MatI) logical path, such asGame:\Media\_library\shaders\pg_vegetation\tree_foliage_alphacoverage_hiquality.shaderbin.- MatI sections are sorted by name. Their
Ids must be exactly 0..n-1, or a car loads for ever.
MTPR parameter block (2.0)
u8 count, then per parameter {u16 2, u32 hash = CRC-32 of the exact HLSL name, u8 type, value}, then 12 trailing
bytes (two CRCs, of the non-string records and of the strings; copy them from a template, the game does not seem to
check them).
| Type | Value |
|---|---|
| 0, 1, 5 | float4 (vector, colour, particle vector) |
| 2, 3, 4, 11 | float, bool, int, float2 |
| 6 | texture: varint length + path + u32 hash of the path |
| 7 | sampler: 3 x u32 (track default (1, 1, 2), decals (1, 1, 3); the first two look like address modes) |
| 8 | inline 1D gradient: u32 n + n RGBA8 |
- A MatI value overrides the material's value of the same hash, and a MatI may set parameters the material lacks. Per-MatI textures are proven in game.
- Texture paths in a MatI can be changed: the texture loads even with a stale hash. Proven in game.
- Never rely on the shader's defaults (
DFPR). Road materials missing gloss or F0 drew white or black in places. Write every constant the shader has, and give every texture slot a texture (flat white if nothing fits). Proven in game.
Useful hashes: car paint colour 0xC0CB2820, glass colour 0x1925D9BF, emissive colour 0x21EC1E4D, livery diffuse
0x10350BBC, livery opacity 0x66E53F62, lamp code 0x493073A0, flag wind strength WindMagnitude_floatVal
0x382B69D4, track skid mask 0xD77978DD.
10.10 Shaders (.shaderbin and compiled variants)
Where: a folder per shader: Shaders\_0xNN\<name>.shaderbin in a track's bin.zip, media\_library\Shaders.zip,
and car zips. Beside it, one compiled file per light scenario and vertex variant: .pc.vso / .pc.pso (PC),
.durango.* (Xbox One, not read on PC), .gso. How read: Shader::Build game+0x1150290 (0x141150290),
builder game+0x1139A10 (0x141139A10); the BLEN block is read at game+0x113F150 (0x14113F150) and VDCL at
0x14113F1ED. Status: offline only for the layout; copying stock shaders between worlds is proven in game. Nobody
has compiled and shipped a new FH2 shader yet, and it is not known whether the game checks the DXBC checksum.
The .shaderbin is a Grub bundle of these sections:
| Section | Version | Contents |
|---|---|---|
LSCE | 1.4.2 | light scenarios: bool inline, u8 count, per scenario {varint name, u32 stamp, bool instanced, u16 n vertex programs {u8 flags, path, instanced path}, i32 stages, pixel path}; metadata blocks VDCL (input mask) and BLEN (2 bytes: blended, alpha-tested) |
DBLS | 1.4.2 | light-scenario table |
TXMP, CBMP, SPMP | 2.0.0 | u8 n + n x {u32 parameter hash, u16 t-register / byte offset in the material constant buffer / s-register} |
DFPR, TRGT | 2.0.0, 1.1.0 | parameter defaults in MTPR form; targets |
- The compiled files are plain D3D11 Shader Model 5 DXBC (
RDEF ISGN OSGN SHEX STAT), compiler 9.30.9200.16384. - Scenarios:
TrackLightScenario(main view),CubemapLightScenario,ShadowDepth,DebugLighting; vertex variants for skinning, morphing and_Instanced. - Material textures use registers t16-t63; the engine binds t0-t15 and t64 and up (t50 vegetation flattening, t60 real-time reflection, t107 TDAO).
- Constant buffers the engine fills: cb0 material, cb2
globalCBuffer(time, wind, occlusion floors), cb3 light scenario (1,144 rows), cb7g_TrackParams(filled atgame+0x13AE700,0x1413AE700; row 3 = the weather's wet scaling of diffuse and gloss). BLENexamples:diff1_alpha=00 01(alpha-tested),diffnormmaskgloss=00 00(opaque), glass =01 00.
Shader choice and per-shader parameters for scenery are covered in chapter 9 (weather) and chapter 6 (props and trees). Shaders from another Forza game do not drop in: FH2 lays out cb3 differently and binds different registers.
10.11 Collision
.col track collision (offline only)
Where: ribbon_NN\<T>_track_NN.col. The mainland's .col is an 80-triangle placeholder; open-world collision
lives in .phys templates. The format is big-endian except where marked. All 83 stock files decode.
Header (0x58 bytes):
| Offset | Type | Meaning |
|---|---|---|
| 0x00 | u32, u32 | grid width, height (100 m cells; cell = row x width + column) |
| 0x08 | f32 x 4 | min x, min z, max x, max z |
| 0x18, 0x20 | f32 x 2, f32 x 2 | 100, 100 (little-endian); 0.01, 0.01 |
| 0x28, 0x2C, 0x30 | u32 x 3 | file size; version 2; 0xABCD1234 |
| 0x34, 0x3C, 0x44 | f32 x 2 each | cell size 100, 100; cell margin 8, 8; sub-cell 10, 10 (little-endian) |
| 0x4C, 0x50, 0x54 | u32 x 3 | non-empty cells; 0x54; first block offset |
Then 24-byte cell records {u32 i, cell, block offset, block size, 0, next}, zeros to 0x800, then blocks (multiples
of 0x800). A block: u32 vertex count, triangle count, 0x40, triangle offset, sub-grid 12 x 12; the cell box grown by
8 m; f32 10, 10, 0.1, 0.1; u32 sub-grid offset, 0. Vertices are 32 bytes (f32 x, y, z, u32 packed normal,
padding); triangles 32 bytes (u8 flags, u8 surface, u16 0, u32 a, b, c as byte offsets from the block
start, f32 normal xyz, f32 0). The sub-grid is 144 u32 list offsets for 10 m squares; a list is a u16 count
plus u16 triangle indices. Triangles are stored with their own vertex copies in every cell they touch.
.phys collision templates (key type 0x01)
Little-endian. Proven in game: a track-import mod converted .col cells into .phys templates and got native
collision with no hooks.
string name
8 f32 bounds, 4 f32 extra bounds
u32 nx, nz + 8 f32 grid header (as in a .col block)
u32 n vertices x { 4 f32, u32 packed normal }
u32 n triangles x { u8 flags, u8 surface, 3 x u32 vertex index, 4 f32 normal }
u32 n x i32 sub-cell offsets (-1 = empty)
u32 n x u16 refs (count + triangle indices)
Templates are instanced when a cell's dependency list requests them (10.6).
Packed normals, winding and surfaces
- Packed normal word (vertex w): x in bits 0-10 and z in bits 11-21 (signed, /1023), y in bits 22-31 (signed,
/511). Treat it as raw bits; as a float it is often a NaN pattern. The game packs normals itself at
game+0x12A9E41(0x1412A9E41). WithUseVertexNormals TRUEinmedia\physics\PhysicsSettings.inithe wheel contact (game+0x12B875E->game+0x12523A0) blends corner normals, and a wrong word fires a false impact on descents. Proven in game. - Winding: stored normal = +cross(b - a, c - a); ground faces up, walls face the track.
- Surface byte = index of the child element in
<SurfaceTypes>ofmedia\physics\surfaceTypes.xml(245 entries; for example 2 Grass, 3 GuardRail, 4 ConcreteBarrier, 9 Invisible, 11 RubberTire, 23 Gravel, 66 AsphaltTrack, 85-87 rumble strips). Map surfaces by name, never by copying numbers from another game's files.
Run-time triangles
CollisionWorld::GetPolys game+0x12CC730 (0x1412CC730) returns 32-byte triangles {u8 flags, u8 surface, u16, three vertex refs, normal xyz, w}. Cameras query with flag 4, so added triangles without bit 0x04 are ignored by the
camera. WreckingBall hooks the same function: chain, don't replace. See chapter 6.
10.12 PhysicsDefinitions.bin (track dynamic objects)
Where: tracks\<T>\PhysicsDefinitions.bin. Smashables, rigid props and cloth. How read: loader
game+0x377460 (0x140377460), serialiser game+0x12DB000 (0x1412DB000), factory game+0x12B0550
(0x1412B0550). Status: offline only (round trip; matches WreckingBall's run-time dump 265 of 265); smashables
built this way proven in game.
u64 count
count x definition
u64 MaxGlobalIndex + u16 GlobalToListIndex[] (read when the first definition's version >= 11; 0 = ids are list indices)
A definition (all stock files are version 20; fields gated by version):
u32 Version u32 DefinitionType (v8+: 0 smashable, 1 vehicle, 2 cloth)
f32 Mass f32[9] InertiaTensor, f32[9] InverseInertiaTensor
f32[3] HalfExtents f32 BoundingRadius f32[3] GraphicsOffset
u32 NumChildren f32[3] AabbCentreOffset (v12+)
u32 RenderModelIndex (manifest model id) f32 VisibleDistance u32 SurfaceTypeIndex
u8 IsTrigger f32 BreakSpeedMph u32 UniqueIndex u32 ObjectNameHash
u8 ObjectTypeIndex (v9+) u8 SecondaryTypeIndex (v14+) u16 MeshIndex (v15+) string ConnectionList (v15+)
f32 MaxBendAngle, MinBendForce, MaxBendForce, u32 LowSpeedBehaviour (v17+)
u8 AllowClothAttachments (v19+)
u32 NumCollisionShapes + shapes
NumChildren nested definitions
The fixed head is 0xA5 bytes plus the connection list; RenderModelIndex sits 21 bytes before the name hash.
Shapes: i32 type: 0 sphere (PositionPlusRadius, 16 bytes after a 2-byte header), 1 box (transform + half extents),
2 convex hull and 5 point cloud (i32 size + blob). A point-cloud blob: 05 07 + 6 zero bytes, u64 0x30, u64 n,
u64 0x30 + 16n, 16 zero bytes, n x f32 xyz0.
10.13 Procedural instances: .pgeo and .plib
.pgeo blocks (key type 0x00)
Compiled from the world's procedural scene. One block places many copies of template models: trees, bushes,
smashables, barriers, props, grass and crowds. How read: load game+0x1886DA0 -> factory game+0x1884FC0;
ProceduralModels deserialiser game+0x1871B90 (0x141871B90; WreckingBall hooks it). Status: offline only
(every Storm Island block and 50,725 instances rebuild byte for byte).
string name, u32 type: 0 ProceduralModels, 1 PlacementMesh (grass), 2 Crowd, 3 CrowdMesh, 4 SplineModels,
5 SplineCrowd. A ProceduralModels block:
| Field | Type |
|---|---|
| version | u32 (5) |
| block box | vec4 min, vec4 max (also the instancing shader's MinBlockAABB / MaxBlockAABB) |
| library | string (TREEANDBUSHTEMPLATE, SMASHABLETEMPLATE, PROPS, BARRIERTEMPLATE, ROCKTEMPLATE, VEHICLES) |
| (v5) | f32 |
| (v2+) filter | string: ;-separated event ids (~1642 = not during that event), then a string |
| (v3+) groups | u32 n x {i32 version; if >= 0, 7 i32: collidable definition id, 3D batch, first, count, billboard batch or -1, first, count} |
| batches | billboard, 3D and extra batches: each u32 n x {string name, u32 k, k x 32-byte instance, u32 r x {string, u32 first, u32 count}} |
Instance (32 bytes), decoder game+0x1874600 (0x141874600):
| Offset | Type | Meaning |
|---|---|---|
| 0 | 3 x u16 | position, quantised in the block box (q / 65535) |
| 6 | u16 | scale x 655.35 (0x028F = 1.0) |
| 8 | u32 | I_UVSCALE (0x80800000) |
| 12 | u32, u32 | X axis, Y axis as 10:10:10:2 UNORM (v x 2 - 1; Z = normalised cross(X, Y)) |
| 20 | u32 | colour (0xFFFFFFFF or a tint) |
| 24 | u32 | 0 |
| 28 | i32 | -1 |
Scale is uniform only.
- A library name that isn't loaded silently skips the whole block, renderer included (
game+0x18671F0). - Every model a block draws needs an
ILaysection and a shader with_Instancedvertex programs (46 of the mainland's 113 track shaders have them;diffnormmaskglossdoes not). - A ProceduralModels block with groups is the game's own smashable: it spawns a collision object per child.
.plib template libraries
Where: ribbon_00\instancetemplates\objects\<template>.plib (and \Placement\), loaded on every world load by
game+0x133D1A0 through game+0x186BDF0 (loader game+0x1871D10, version 11, about ten sections; the grammar is not
fully decoded). A LOD entry is {string .max path, u32, i32 0x7FFFFFFF, u32 1 or 2, u32 instance index}, where the
instance index is a .pvs placement index of a template placement (f8 0x40, at the origin) whose model is drawn.
A smashable ties three things together: a .plib entry, a type-0 cell group pointing at its 32-byte instances, and
PhysicsDefinitions.bin[global id], whose RenderModelIndex is the manifest model. Proven in game by a track-import
mod.
10.14 AI, navigation and races
The shared AI container
.nav, .owt, .oww and lane tiles share one envelope. Header reader game+0x18E3410 (0x1418E3410).
16-byte header char[4] magic, u32 version, u32 hash, u32 payload size (multiple of 16)
payload arrays of count x record size, each padded to 16
16-byte trailer identical to the header
On disk, links between records are i64 indices (-1 = none); the game turns them into pointers after reading, and
out-of-range indices become null.
| Magic (stored) | Reads as | Version | File | Hash rule |
|---|---|---|---|---|
FTWO | OWTF | 3 | .owt race line | not checked |
FWWO | OWWF | 0x102 | .oww lane tile list | sets the world's AI hash |
LBWO | OWBL | 0x102 | lane tile | must equal the .oww hash |
WVAN | NAVW | 0x100 | .nav road graph | stored in the save's road-discovery record |
.nav road graph (WVAN)
Where: tracks\<T>\ribbon_00\<T>_00.nav. Roads, junctions and their tags: the GPS, the map's roads, traffic and
road discovery. Builder game+0x191B1B0 (0x14191B1B0). Status: a writer rebuilds all three stock navs byte for
byte (offline only); a nav built that way was used in game.
| Part | Size | Content |
|---|---|---|
| root | 0x70 | nine pointer slots (0 on disk); nine i32 counts at +0x48..+0x68; ???? at +0x6C |
| nodes | 40 | i64 first node_roads index, i64 first prop (-1 none), u32 key (unique, ascending), f32 x, y, z (y up), u32 road count, u32 prop count |
| roads | 24 | i64 first road_nodes index, i64 first prop, u32 node count, u32 prop count |
| road_nodes | 8 | i64 node index (each road's polyline in order) |
| node_roads | 16 | i64 road index, u32 position in that road, u32 |
| props | 16 | i64 key index, i64 value index |
| keys, values | 8 | i64 byte offset into the string block |
| strings | 1 | NUL-terminated, sorted, unique |
- First-index fields are prefix sums of the counts; key and value tables are sorted.
- A node that belongs to no road is invalid (the traffic spawner dereferences null).
- Tag keys:
road_type(a,b,dirt,freeway,none,shortcut; only real types draw on the map),display_name,profile_name(unique per road),traffic_density_name,ai_disabled,traffic_disabled,oneway_forward,oneway_backward,uturn,roundabout,give_way,deadend,discovery_zone,initial_install,initial_experience. Every road hasdisplay_name,profile_name,road_typeandtraffic_density_name. - The mainland: 22,138 nodes, 703 roads, 461.5 km; nodes about 20 m apart.
.owt race line (FTWO v3)
Where: OpenWorld\<T>\AITracks\Route<id>.owt, one per route. The line the AI races. Status: all 146 stock
files parse; written files proven in game (seven AI drivers raced a written line).
Payload: a 32-byte root {u64 0, u64 0, u32 segment count, u32 point count, i32 -1, u32 0}, then segments, then
points.
Segment (48 bytes): i64 first point, i64 next[3] (-1 = none), u32 point count, u32 next count, u32 flags
(1 = main path; 2 / 4 = branches that split and rejoin within 9-20 m), 4 bytes padding. A circuit's last segment
links back to segment 0; a point-to-point route has no next.
Point (48 bytes), also used by lane tiles:
| Offset | Type | Meaning |
|---|---|---|
| 0 | 4 x f32 | position x, y, z, 0 |
| 16 | 4 x f32 | side vector x, y, z, 0: travel x up; its length = half the road width (2-7 m stock) |
| 32 | 8 x i16 | chi values / 32767 (clamped to ±1): chi[2] = racing line across the road; chi[0] / chi[1] ≈ ∓0.5 (lane centres, unconfirmed); chi[3..7] = 0, 0, 0, 1, -1 on every stock point |
Points are about 2 m apart.
.oww lane tile list (FWWO v0x102)
Where: tracks\<T>\ribbon_00\<T>_00.oww. Payload: u32 count, f32 tile size (200 m), 8 bytes padding, count x
{i16 x, i16 z}. A lane tile's id is its index in this list. Storm Island has 179 tiles, the mainland 1,380.
Proven in game.
LBWO lane tiles (key type 0x03)
The free-roam AI's lanes, one tile per 200 m square. How read: reader game+0x18DFDF0 (0x1418DFDF0), payload
parser game+0x18DFF60, insert game+0x18CD920. Status: proven in game: 83 tiles appended to a world, listed in
every cell, made drivatars spawn. All stock tiles round-trip.
Root (0x70 bytes): 8 u64 array slots (0 on disk); +0x40 u32 tile id; +0x44 i16 x, z; +0x48..+0x64 eight u32
counts; +0x68 u8 loaded (0 on disk). Links: A -> B, D; B -> C; D -> F, F, E x 4, H; F -> G.
| Record | Size | Meaning |
|---|---|---|
| A | 32 | +0 -> B, +8 -> D; +0x10 u32 segment id (unique world-wide); +0x14 / +0x16 i16 .nav node keys (lane runs node0 -> node1); +0x18 u32 flags (0x400 always, 0x001 traffic disabled, 0x002 one-way, 0x100 road type none, 0x200 AI disabled); +0x1C / +0x1D u8 Densities.xml id at each end; +0x1E i16 junction node key on connectors, else -1 |
| B | 24 | -> first C point, u32 point count (one per ~2 m), u32, u32, u16 |
| C | 48 | a lane point, exactly the .owt point format |
| D | 64 | -> F x 2, -> E x 4, -> H; +0x38 4 x u8 lane counts (forward n0, n1, back n0, n1: two-way (1,1,1,1), one-way (2,2,0,0)); +0x3C junction bits |
| E | 16 | xyz, 0: lane quad corners |
| F | 24 | -> G, -> G+2, u16 segments meeting at the node, u16 |
| G | 16 | xyz, 0: gate ends across the road, then up vectors |
| H | 8 | f32 lane length (m), f32 curvature radius (m); not a speed |
Tiles stream like any other object: key 0x03000000 | id in a ChunkMap, each appended tile in a group of its own,
and a dependency record in every cell that should load it (10.6).
Route locators (.nt)
Where: tracks\<T>\trackroutes\Route<id>.nt. Plain XML: <TrackLocators> with <Locator Version='2'> entries
(a name, GUID 0, a SceneTransform _11.._44, an empty AttachTo). Rows: right, up, forward, position. A race
route has start_location_N grid slots (16), waypoints, checkpoints with _left / _right gate ends, a
finish_line and end positions. The smallest valid file is \r\n<TrackLocators Version="2"/>. Proven in game.
ribbon_00\GameObjs.xml holds START_LINE_<route> and FINISH_LINE_<route> objects (a transform plus a locator set,
no model).
Trigger zones (.tz)
Where: tracks\<T>\triggerzones\tz_*\*.tz, for example tz_race_activations\triggers.tz. Plain XML with a BOM
and CRLF: <triggerzones> holding <triggerzone type="sphere" name="race_trigger_zone_rt<route>" mobile="false" delay="0" streamed="false"> with a <position>, a <size> (x = y = z = radius, 20 m for race starts) and three
<orientation> rows. Stock files list every zone twice. Polygon zones use <poly><vert x z/> ...</poly>. A served copy with an added zone
worked. Proven in game.
EntityModel\AI\Densities.xml holds the festival and traffic density lists (<Density id=... min= max= spawnAwayChance=>, ids 1-based) that lane records refer to.
10.15 Trigger zones, audio and lighting in GeoChunks
Compiled trigger zones (key type 0x08)
Ambience zones (Amb_Zone_*), reverb zones (REV_TZ_*), rain zones (*_rainzone_*) and car meets. Byte-packed, no
alignment. Status: offline only (all 2,087 stock entries rebuild byte for byte).
u32 version (1) u32 shape (4 = mesh, 1 = sphere) string name
u8 0 u32 0
f32 pos[3] mesh: (0, base y, 0); sphere: centre
u32 0 u32 area number shared by neighbours; reader not found
f32 size x, height, size z, max(size x, size z)
mesh: u32 ntri x { 3 x (u8 ntags, f32 x, f32 z, tags), u32 0 } 2D triangles in world x/z
sphere: 11 f32 (identity rows)
u32 ntags x tag sorted by name
tag = string name, u32 type, value type 0: u8 | 7: u32 | 0x0C: u32 nchars + UTF-16LE
Reverb tags read by game+0x19687C0 (0x1419687C0): rev_type (TunnelReverb, TrackReverb), rev_send0,
rev_send1, rev_panmindist, rev_panmaxdist, rev_ssOnEnter* / Exit*. Ambience tags: amb_event, audio = 1.
Rain zones and car meets have no tags.
AudioTile (key type 0x09)
UTF-8 XML, CRLF, 2-space indent, one per PVSZ cell id: sound banks (bankname, bankfilecrc), Track3D emitters
(objectName, eventPath, eventName; two equal positions = a point, different = a line), and the tree and crowd
positions the ambience mixes from. Status: offline only.
FMOD bank entries (key type 0x0A)
A 32-byte header (u32[0] = CRC-32 of the lower-case bank file name) and a complete FMOD Studio bank. The loose
_soundbank_lookup.xml maps <Soundbank crc filename/>, with crc as a signed i32. Status: offline only. Adding
audio to a world needs entries, ChunkMap keys and a dependency in every cell; no tool does it yet.
TDAO: top-down ambient occlusion
tdaosettings.bin (56 bytes, tracks\<T>\), read into the TDAO object by game+0x113BAB0 (0x14113BAB0):
origin x / z (stored with a half-cell shift), cell size x / z (512 m), columns, rows, resident slice side n (slices =
(n + 2)²), border (1 texel), resolution (512), DXGI format (34 = R16G16_FLOAT), pitch (resolution x 4). Limits:
columns x rows <= 1024 and (n + 2)² <= 1024.
Tiles (key 0x0D000000 | id, id = row x columns + column): a DDS with a DX10 header, 148 bytes + res² x 4,
R16G16_FLOAT (R = low height, G = top height). Neighbouring tiles share border texels. The u axis runs mirrored
(origin x - x). Status: proven in game (added tiles visible). Each tile needs its own group, a ChunkMap key, a
dependency in every cell and a larger .pvs count at 0x14. When the resident array is full, tiles are dropped
silently at game+0x113BF20 (0x14113BF20).
Lights_*.lightdb (offline only)
Lights_Models.lightdb:PVSL,u322,u32light-model count, then per light modelu32 nand n 68-byte records (4x4 matrix, position in the fourth row,u32preset number).Lights_Presets.lightdb:PVSL, 2,LDFB, size, version 1, preset count, then per presetu32bytes,u32fields and tagged fields(u8 id, u8 size, value)(field 2 = colour, 3 = range, 5 and 6 = angles). The blocks parse to within a few bytes of their end: copy them whole, don't edit them.
10.16 Effects, crowds and animation
ParticleInstances.particlebin (placed effects)
Where: tracks\<T>\Ribbon_NN\ParticleInstances.particlebin. Chimney smoke, camp fires, birds, balloons,
fireworks. How read: at every world load by game+0x128A5A0 (0x14128A5A0); pointer fix-up game+0x13E6FF0
(0x1413E6FF0). Status: offline only (a writer re-creates all four stock files byte for byte); a served file
loads by the log, but nobody has confirmed seeing the effects.
file 'burG' 1 0 | u16 1 | u32 0x28 | u32 file size
section 'BLCP' major minor u16 0 | u32 0x28 | u32 0x28 | u32 body size | u32 body size
body u32 first pointer slot (8) | u32 count | slot -> records | records | sub arrays | strings
slot u32 target (body offset, -1 = null) | u32 next slot (-1 = end of chain)
The parser is picked by section version: 2.2 and later (what FH2 ships) uses 104-byte records:
| Offset | Type | Meaning |
|---|---|---|
| +0x00 | ptr | instance name (<effect>_InstanceN) |
| +0x08 | ptr | effect name in the FX library |
| +0x10 | u32 | type: 1 = placed effect (the only kind built) |
| +0x14 | u32, 8 bytes | 0 |
| +0x20 | f32 | 1.0 |
| +0x24 | 3 x f32 | position |
| +0x30 | 4 x f32 | rotation quaternion x, y, z, w |
| +0x40 | 3 x f32 | scale |
| +0x4C | u32 | extra: -1 mostly, an event or show id on festival effects (unconfirmed) |
| +0x50 | u32 | unread |
| +0x54 | u32 | sub-item count |
| +0x58 | ptr | sub-items |
| +0x60 | ptr | extension (null in stock) |
Version 2.1 records are 100 bytes (no +0x4C). Serving another Forza game's particle file crashes FH2: its 2.1
parser reads the records at the wrong stride. Effects switch on within 2,520 m of the camera and off beyond 2,760 m,
grouped in 1,200 m cells. Effect names come from media\FXParticles\XboxOne\ParticlesLibrary.fxb, loaded once at
start-up, so every effect is available in every world.
TriggerVolumes.xml (<Volume Version="4"> with enter and exit events that activate particle instances) is parsed
by game+0x12D53D0, but in the retail build the activation does nothing, and all stock files are the empty
<TriggerVolumes/>.
.crowd (version 4)
Where: tracks\<T>\ribbon_NN\<T>_track_NN.crowd. Spectators. How read: parser game+0x11AE8F0
(0x1411AE8F0; another reading names game+0x1394790 as the loader). Status: proven in game (written files
draw); every stock file round-trips.
| Part | Layout |
|---|---|
| Header | u32 4, u32 0, u32 0 |
| Groups | u32 n; each: u32 1, f32 min xyz, max xyz, centre xyz, radius, u32 0, u32 first person, u32 people |
| People | u32 n; each: u32 1, u32 1, u8 s0..s5, u16 s6, u8 s8, u8 s9, half q0..q3 |
| Names | u32 n strings (crowd type names) |
s0 = index into names; s1 = model choice; s2 = a random byte (used to thin crowds and pick male or female); s5-s9 are animation state (cleared by the loader); q0-q2 = position minus the group centre; q3 = facing in radians. People within about 25 m draw as 3D models (one draw each), the rest as one sprite draw per group; the default draw distance is 250 m.
Granny animation (.gr2, .gsf)
.gr2files are Granny 3D, built against Granny 2.9.20.1 in the exe. FH2's file type tag is0x80000038; other tags are converted on load. Sections use Oodle1 compression; uncompressed sections are accepted. Status: offline only; no public writer has been tested.- Car
.gsffiles hold the part animation state machine (doors, bonnet, wipers, needles); they are not decoded, so keep a stock car's. - World scenery animation:
Animations\*.GR2inbin.zipplus skeleton entries (key0x07), linked from placements through the.pvsanimation tables (names,.gsfpaths, sets{u16 gsf, 0xFFFF, 0}, instances{u32, u16 set, u8 0}; placement +14 = name index, +16 = instance index). Offline only. - Pedestrian crowd animation is baked into memory at 30 frames per second, 36 bytes per bone per frame (x axis, y axis, position); see chapter 7.
10.17 Car files
A car is a Data_Car row, media\cars\<MediaName>.zip and a zipmanifest.xml line. What each entry in the zip
does, how a car loads and how to add one are in chapter 14 (the entries:
14.4 The car zip). This section keeps the full carbin layout; the car's other files are
laid out in chapter 14, and its models, textures and materials use the formats in 10.7 to 10.9.
Exe format strings: game:\media\cars\%s\%s.carbin at game+0x1FFCC00 (0x141FFCC00), physicsdefinition at
game+0x20170C0 (0x1420170C0), Lights.bin at game+0x221AB60 (0x14221AB60), LightPresets.bin at
game+0x221AB70 (0x14221AB70).
.carbin (version 5, model version 15)
The car's scene: which models, where, on which bone, and which upgrade parts they belong to. Status: proven in game
(cloned and built cars load). Strings are u32 length + text; the reader has no end check.
Scene header: u16 version 5, 16-byte build GUID, u8 BuildStrict, u32 Ordinal (car id), string MediaName
(lower case; its text starts at file offset 0x1B), string SkeletonPath, u16 LOD flags (0x7F), u32 plain part
count, u32 upgradable part count.
Plain part: u8 type, u16 version 2, u32 type again, u32 model count, models, bounds (2 x 4 f32; an empty
part's box is inverted, ±3.4e38).
Upgradable part: u16 3, u32 part type, u32 upgrade count, upgrades, then u32 n shared models.
- Upgrade (45 bytes):
u163,u8level,u8IsStock,i32part id,i32CarBodyId (-1 = the car's own),u8ParentIsStock, 8f32bounds. - Shared model:
u32 n+ ni32upgrade ids it belongs to, then the model. - Upgradable types: 9 rear wing; 34, 35, 36, 37, 40, 41 body parts. Part ids are
car id x 1000 + nin every stock carbin, and a model whose part id matches no database row is not drawn. A cloned car's carbin must be pointed at its own rows; the platform's car packs do this from a part-ids list.
Model (v15):
u16 version (15)
string path (the .modelbin)
f32[16] matrix: rows, translation in the last (point = p x M[0..2] + M[3])
u16 LOD flags (LOD 0 = 0x7E)
string bone name, i16 bone index, u8 SnapToParent
i32 draw groups: 1 exterior, 2 cockpit, 4 shadow, 8 bonnet, 16 windscreen reflection, 128 proxy LOD
u32 n MaterialOverrides x {key, length, bytes} nearly always 0
u32 n paint list x {string MatI name, u32 zone mask}
u8 droppable (+ f32, i32 when set) f32 BreakAmount
u32 n AO map infos x {u16 3, string path, u32 part type (-1), i32 part id, GUID, u8 IsDefault, i8 LodTest, i8 LodValue}
u8 IsInteriorWindshield, u8 ReceivesImpact, u8 ReceivesSplatter, u32 x 4 Receives Damage / Dirt / Oil / Rubber
string AssemblyName, 16-byte GUID, 16-byte drop GUID + u32
i32 Horizon-only field (this is what makes v15; the Motorsport-series v14 lacks it)
Draw groups are proven in game (cockpit and bonnet views). A paint MatI not listed in the paint list stays grey.
physicsdefinition.bin (car, v20)
The car's collision hull: convex point clouds in car space, in the PhysicsDefinitions.bin family (10.12). Status:
offline only; keeping a stock car's file is safe. Layout and rules: 14.8 Collision hull.
Lights.bin and LightPresets.bin
Lamp glows and beams on the car's lamp models (0xDEADBEEF v1) and their looks (LDFB v1), written as a pair.
Status: offline only. Layouts, light types and tags: 14.7 Lights.
ManufacturerColors.bin (MNCL 1.0)
The factory paint choices, a Grub bundle with one MNCL section. Status: offline only. Layout and how to add a
paint: ManufacturerColors.bin.
.avpins
Forzavista points of interest, XML, a delta on a template in media\cars\_library\*.avpins. Elements and rules:
Forzavista pins.
10.18 Other formats
.fcx car recording (version 2)
Recorded drives, ghosts and replays. Status: proven in game: files written by a mod play, and the ghost packet removes collision.
u32 version (2) | u8 relative flag | u32 N | u32[N] packet offsets | packets
packet = f32 time | u8 header (class in bits 0-2: 0 attach, 1 keyframe, 2 update; type << 3) | payload | u32 payload length
CMsgCarPosRaw (21 bytes):
| Offset | Type | Meaning |
|---|---|---|
| 0 | u64 | X 22 bits, Y 20 bits, Z 22 bits (X and Z cover ±16,000 m, Y -1,000..1,020 m) |
| 8 | 3 x i16 | quaternion x, y, z (w >= 0 implied) |
| 14 | u8 | clutch |
| 15 | u8 | handbrake nibble, gear nibble |
| 16 | i8 | steering |
| 17 | u16 | throttle 7 bits, brake 6 bits, 3 bits |
| 19 | u16 | engine speed as a fraction of the redline |
The smallest file the game accepts: two or three keyframes (an attach of object 9, type 1, and a CMsgCarPosRaw);
for a ghost add a type 14 CMsgCollidableState, bytes 00 00 80 3F 01 00 00 00 00 00 80 3F 01 00 00 00, timed
0.2 s before the first keyframe; then update packets with 23-byte payloads.
String tables (.str, LSB2)
StringTables\<LANG>.zip holds one .str per table. Magic LSB2; u32 section count at 0x10; section offsets from
0x14. Section 0: size, count, then (count + 1) x {u16 key, u32 offset in UTF-16 units}, then NUL-terminated UTF-16
texts. A database text _&N uses the low 16 bits of N as the key. Loose files are read before the zip. Proven in game.
Use the platform's string API rather than writing tables (chapter 2, chapter 4).
Text and data formats in brief
| Format | Where | What to know | Status |
|---|---|---|---|
.vfont | media\ui\Fonts.zip | glyph table at the u32 at file offset 0x80; 28-byte records: u32 code point, f32 advance, then vertex and index counts. Enough to measure text offline | Offline only (partly) |
| Camera XML | TrackSegCams.xml, PreRaceCams.xml, CarRelativeCams.xml in ribbon folders; ASCII, CRLF | <Cams CutQueueType="TrackSeg|Time|Random|Manual"> holding <Cam Version="3|4" Type= StartCut=> with <Anim> keys (time, position, yaw, pitch, roll, FOV), <PostEffectsAnim>, fades, <CameraPhysics> noise layers, <DynamicLimiting>. StartCut = lap fraction (TrackSeg) or seconds (Time, Random). Files up to 202 KB load | Proven in game |
| Cinematic XML | Cinematics.zip Global\*.xml (UTF-8 BOM); per-route overrides in Global\RouteSpecific\<route>\ | case-insensitive names; Bezier keys (tangents User 0, Fast 1, Slow 2, Step 3, Smooth 4, Flat 5). Linear keys wobble at joins; user tangents of length 0.3333 cure it. Director object game:player hands the view back. See chapter 8 | Proven in game |
| Map profile | media\ui\MapProfile*.xml | per layer Size (z extent in metres), Offset (lowest x, z), Tiles, VisibleRange; square texels; view_area and cursor_area must move with the frame. The picture shows turned 90 degrees anticlockwise (screen up = +x): paint names into it turned clockwise | Proven in game |
Weather and time-of-day .fxb | media\weather\WeatherManager*.fxb, timeofday\xboxone\TimeOfDay_island.fxb | typed curve files. Same-size in-place value edits load through an override; key times can't move; several fields can share one value block, so one edit changes all of them. Presets*.xml beside them are plain XML | Same-size edits proven in game |
| Bink video | media\ | stock files are Bink 2 (KB2i); Bink 1 (BIKi) also plays | Proven in game |
| Game database | media\Stripped\gamedbRC.slt (SQLite) | read once at start-up; change it only with the platform's add_sql (UPDATE and INSERT) or Extra Options' database.json. See chapter 4 | Proven in game |
10.19 What is still unknown
.pvs: the zone section, the placement tail at +77 and the last bytes of the per-model record are read differently by two decoders. Extending the per-model table has loaded in game, but no new record has been drawn..plibgrammar (about ten sections) and the.gsfstate-machine format.- LBWO records E, G, H and the F count: written to match stock patterns, readers not traced.
- Compiled trigger zones: the area number's reader; the sphere's eleven floats.
- Shaders: how the engine picks a scenario's file, and whether it checks the DXBC checksum.
MTPRtrailer: the two CRCs appear unchecked, but that was not traced.Lights_Presets.lightdbblocks parse only to within a few bytes.PVSSamplePoints.binand.imapare not decoded (the game never opens them).- Swatchbin: the tile-mode values are given differently by two readers; copy the header bytes from a stock file of the same size and format.
