This chapter is about what Forza Horizon 2 reads from disk: where the files are, what is in them, and how a mod can change them without breaking the game or other mods. It covers the game database, string tables, the UI, cars, the world, audio, saves, liveries and skies. You need it for data-only mods, and for any code mod that changes text, cars or game data. The APIs that write these files are in chapter 2 (FH2 Mod Platform) and chapter 3 (Extra Options).
Addresses in this chapter are for forza_durango_release_final.exe of 24 Nov 2015 (TimeDateStamp 0x565501ED,
SizeOfImage 0x3A18000), image base 0x140000000. Each is given as an RVA (game+0x...) and as the absolute
address at that base. Paths use these names:
| Name | Means |
|---|---|
<Azimuth> | the folder that holds azimuth.exe |
<Mount> | the game folder Azimuth points at: the game's game:\ drive |
<Mount>\media\X.zip\path | the file path inside the zip X.zip |
Inside zips the game uses forward slashes; on disk this chapter uses backslashes.
4.1 What to change where
Start here. Each row is a common goal, the file that holds it, and the usual way to change it.
| Goal | Where it lives | How to change it |
|---|---|---|
| Car prices, PI, stats, AI aggression, Wheelspin prizes, event weather, engine and drivetrain swaps | media\Stripped\gamedbRC.slt | add_sql UPDATE / INSERT (4.5) |
| Any on-screen text, car names, car-meet AI names | media\Stripped\StringTables\<LANG>.zip | set_string / replace_string / set_string_tr (4.6) |
| Built-in Drivatar names in races | media\DrivatarGlobalCache\DefaultCache.bin | override file (4.5.4) |
| The look of one HUD widget | media\UI.zip Controls\*.xaml | set_file("UI/Controls/...") (4.7) |
| A new menu page or settings | the platform's page API | never replace the platform's own pages (chapter 2) |
| Clouds and skies | media\Sky.zip Clouds\<set>\ | a whole replacement set of loose files (4.13) |
| Weather changes in free roam | media\weather\Presets*.xml | override file |
| Radio stations and songs | media\audio\RadioInfo_*.xml + FMOD banks | needs hooks (4.10) |
| A new car | car zip, DB rows, zipmanifest line, thumbnails, string keys | platform car packs (2.9.0+) (4.8) |
| Car paint colours | car zip ManufacturerColors.bin + Combo_Colors rows | new paints copy a stock material |
| Vinyl designs | save files, or live editor objects in memory | the in-game editor or a memory tool; never ship save edits (4.12) |
| World objects, routes, trigger zones | media\tracks\<world>\ribbon_00, trackroutes, triggerzones | loose overrides; advanced (4.9) |
| Global physics tunables | media\physics\PhysicsSettings.ini and friends | override file (4.14) |
4.2 Four rules for every data mod
- Never edit the game's zips or
media\zipmanifest.xmlin place. The manifest stores each zip's central-directory offset and the game trusts it. Override files instead: the platform'sset_file, the override folders, or an Extra Options mod's media folder (4.4). - Never edit saves. Read them only, and only fully committed revisions (4.11).
- The game reads string tables, the database and most files once, at start-up. A change shows from the next
launch. On the platform, changes made inside
fh2mod_initare always in time. - The game trusts its data. A missing database row reads back as
INT_MAXorFLT_MAX, a missing model or material makes a car load for ever, and a bad Id can crash. Check your data offline before you ship it.
4.3 The game folder: Mount and media
Which folder the game runs from
Azimuth's settings file, <Azimuth>\data\azimuth.ini (UTF-16), has a section for FH2:
[title-1a96545b]
folder=<game folder>
content=<game folder>\Mount\DLC\StormIsland_1.0.0.36_neutral__8wekyb3d8bbwe
folder=names the game folder. ItsMountsubfolder is the game'sgame:\drive. Read this value; never hard-code a path.content=points at downloadable content. Storm Island is a separate package folder,<Mount>\DLC\StormIsland_1.0.0.36_neutral__8wekyb3d8bbwe\(about 3.1 GB), with its ownmedia\tracks\test03\andmedia\openworld\test03\aitracks\. Ifcontent=points at a missing folder, the island is very likely not available (inferred, not tested).- Several Azimuth folders can share one game folder. Anything written into
<Mount>\mediaoverrideis then seen by all of them. The platform's per-Azimuth layer (2.9.0+, 4.15) avoids that. - FH2's title ID is
1A96545B. On multi-game Azimuth (1.0.1+) other titles share the launcher: Forza Horizon 2 Presents Fast & Furious5A9771A4, Forza Motorsport 57B35D917, Forza Motorsport 664F9397E, Forza Horizon 34CE1DFAB.
Top level of Mount
| Entry | Size | What |
|---|---|---|
forza_durango_release_final.exe | 58,204,160 bytes | the game (the Xbox One build) |
media\ | about 40 GB | all game data |
mediaoverride\ | varies | loose override files, made by Extra Options, the platform or mods; not shipped |
mediapc\ | varies | a second override layer some tools create; not shipped (car packs used it before 2.9.0) |
DLC\ | 3.1 GB | the Storm Island package |
AppxManifest.xml, appdata.bin, networkmanifest.xml, Catalog000.bin, hash.manifest, Microsoft.Xbox.*.dll, psapi.dll, *Logo.png, SplashScreen.png and others | small | Xbox package metadata, Xbox-side DLLs that Azimuth stands in for, store art |
The game folder above Mount may also hold EmbeddedXvd\ and era.vbi: Xbox system parts, not game data.
The exe itself is useful data too: MSVC RTTI is intact (vtable[-1] leads to the CompleteObjectLocator and the type
name), .pdata gives function bounds, and its SQL strings show which tables and columns it reads.
Files at the top of media
| File | Size | What |
|---|---|---|
zipmanifest.xml | 82 KB | 609 <Zip> lines: every zip the game mounts (4.4) |
UI.zip | 1.25 MB | the front end: 460 XAML files (4.7) |
stateflow.zip | 188 KB | 64 state-machine XMLs, including ui_screens.xml and pause.xml |
stateflowdebug.zip | 31 KB | debug flows |
Sky.zip | 61 MB | cloud texture sets, moons, star catalogue (4.13) |
Livery.zip | 19 MB | vinyl and decal shapes: 1,480 Vinyls\*.modelbin and 940 Decals (4.12) |
Particles.zip | 68 MB | particle effects |
Cinematics.zip | 91 MB | cutscenes (Forzavista and car cinematics name entries here) |
Crowds.zip, Spectators.zip | 21 MB, 6.7 MB | crowd models |
PostEffects.zip | 3.5 MB | post effects |
GameTunableSettings.zip | 30 KB | 34 tunables XMLs (PlayerXPLevels.xml, Skills.xml, RaceFeats.xml, CareerPlayerLevels.xml, GameOptionPresets.xml, Bonuses.xml, collidablepresets.xml...) and GameTunableSettings.ini |
EntityModel.zip, entitymodeldebug.zip, Camera.zip | small | entity and camera definitions |
GlobalRegistry.xml, ThumbnailCamSettings.xml, UICarTargetCameraPresets.xml, PhotoModeEffectPresets.xml, Controller*.xml/.ini, DemoConfigs.xml, DebugStatView.xml, FakeLeaderboardEntries.xml | small | loose settings (ThumbnailCamSettings.xml holds a thumbnail camera per car) |
Folders in media
| Folder | Size | What |
|---|---|---|
cars\ | 6.9 GB | 354 car zips <MediaName>.zip, CarAttribs.xml (global damage scalars), _library\ (shared car Materials.zip, Textures.zip, Cinematics.zip, Forzavista templates *.avpins, DefaultLightControllers.xml, GlobalCarAttributes.xml) |
tracks\ | 26 GB | the world: anthem\ (mainland), homespace02\, test03\ (Storm Island stubs; the real data is in the DLC package), AnthemTrackSettings.xml, anthemunderground.zip, Test03underground.zip, anthemcubescenes.zip |
openworld\anthem\aitracks\ | 16 MB | AI routes Route<n>.owt |
audio\ | 5.2 GB | XML config and FMOD banks in fmodanthem\durango\ |
stripped\ | 71 MB | gamedbRC.slt (the database), RC0.zip-RC22.zip (data-bound art: maker logos, car thumbnails), stringtables\ |
ui\ | 1.4 GB | Fonts.zip, Effects.zip, Textures.zip, textures\ (Anthem.zip, Data_Bound.zip, Localized.zip, WPF.zip, data_bound\*.zip), Bink videos videos\*.bk2, map profiles MapProfile*.xml, HUDPriorities.xml, credits.xml |
_library\ | 135 MB | shared Materials.zip, Shaders.zip, Textures.zip |
brakes\ | 4.8 MB | caliper and rotor models |
drivers\ | 6.7 MB | driver models (default, defaultRace, suited, unsuited, AIRace, AIUnsuited, stig) |
drivatarglobalcache\ | 1.2 MB | DefaultCache.bin: the built-in Drivatars |
physics\ | 1.5 MB | PhysicsSettings.ini, surfaceTypes.xml, PI.xml, SmashableObjectTypes.xml, BreakEffects.xml, CollObjects.xml, suspension\*.xml |
timeofday\ | 644 KB | TimeOfDay.xml, TimeOfDayA/B.xml, xboxone\*.fxb |
weather\ | 16 KB | Presets.xml, Presets_Island.xml, xboxone\WeatherManager.fxb |
unlocks\ | 68 KB | UnlockRules.xml (badge and title unlock rules) |
profileschema\ | 44 KB | ForzaProfile.sch, calendar.cal |
renderscenarios\ | 25 KB | render budgets per scene (Anthem.xml, Race.xml, PhotoMode.xml, 8-Car.xml...) |
dynamicpost\, lensflare\, fxparticles\, shaderpatch\, speech\anna\, webserver\ | small | the rest |
On disk some folder names are lower case (stripped\stringtables); the game's file system ignores case.
4.4 Override folders and zipmanifest.xml
How an override replaces a file
- A file inside a zip,
media\X.zip\path\file, is replaced by the loose filemediaoverride\X\path\file. - A loose file,
media\path\file, is replaced bymediaoverride\path\file. - New files that the zip doesn't have are found too (for example new UI files or thumbnails).
- Priority, highest first: the platform's layer and car packs (2.9.0+), then
mediaoverride, thenmediapc, thenmedia. - The override folders are mounted by Extra Options when its
[Files] EnableMediaOverrides=1, or, without Extra Options, by the platform itself (2.7.3+). The platform mounts folder volumes at priorities0x7FFFFFFEand0x7FFFFFFD; with its 2.9.0 layer the layer is at0x7FFFFFFE, the override folders at0x7FFFFF00and0x7FFFFEFF, and car packs from0x7FFFFFF0down. The resolver slot is atgame+0x2E6EF28(0x142E6EF28). - Only Azimuth's drives exist for the game:
game:\is<Mount>, andT:\is<Azimuth>\data\titles\1A96545B\tmp(it persists between starts). Agame:\path containing..stops the game; host paths likeC:\...aren't found.
On the platform, don't write into these folders yourself. Use set_file (one owner per file) and the platform's
override_root(); the platform decides whether that is mediaoverride or its own layer. See
chapter 2. An Extra Options mod ships its files in its own media folder; see
chapter 3.
zipmanifest.xml
The game mounts only the zips listed in media\zipmanifest.xml (UTF-8 with BOM, CRLF, <ZipFiles version="3">):
<Zip version="1" path="game:\media\cars\for_mustanggt_15.zip" priority="80"
dirstart="19831020" dirsize="67706" direntries="548" />
dirstartis the central directory's offset,dirsizeruns to the end of the file (end record included),direntriesis the entry count.- It is read once at start-up (
game+0xFD1600,0x140FD1600). - A zip with no line is never mounted. A line for a missing zip very likely crashes. Any element other than
<Zip>hangs start-up. So there is no safe generic way to append to it: a changed or added zip needs an exact line. - Game zips have their entries in upper-case name order and local headers with no extra field, and each
central-directory record carries a 4-byte extra field
0x1123holding the entry's data offset. Generic zip libraries don't write that field, so write zips in FH2's layout. - Platform car packs and Extra Options car mods merge manifest lines for you (4.8).
4.5 The game database
Basics
media\Stripped\gamedbRC.sltis a plain SQLite 3 file: 5,974,016 bytes, 288 tables, no views. Open a copy in any SQLite browser.VersionInfo.database_versionis-2067577858in the shipped file.- The game reads it through its file system as
game:\media\Stripped\gamedbRC.slt, once, at start-up, so an override copy wins. (The exe also namesmedia\db\gamedb.slt, which isn't shipped.) - Rows are read through
CRecordSet. A missing row, a missing column or NULL reads back asINT_MAXorFLT_MAX, never as an error and never as 0 (proved in code). Missing rows give garbage physics or crashes, not messages. - Text columns hold string-table references such as
_&3444141176, not text (4.5.11). - The
NewProfile_*tables are the template for the player's profile database inside the save (4.11).
Changing it safely
On the FH2 Mod Platform (API 2 and later) use add_sql:
extern "C" __declspec(dllexport) int fh2mod_init(const FH2ModApi* api) {
FH2Mod* mod = api->register_mod(&g_info);
if (!mod) return 0; // always return 0, even when the mod turns itself off
if (api->api_version >= 2)
api->add_sql(mod,
"UPDATE TombolaPrizes SET CreditAward = CreditAward * 2 WHERE CreditAward > 0;");
return 0;
}
The platform copies the database the game would read, runs car packs' SQL first, then each mod's statements in load
order, each mod in its own transaction: one failing statement rolls back that mod's changes only, with the SQLite
error in platform.log. It rebuilds only when something changed. Statements added inside fh2mod_init are applied
for you; later ones need apply_database (seconds; call it from your own thread; shows next launch). clear_sql
gives the game its stock rows back when a feature is switched off.
- Use UPDATE and INSERT only (and DELETE of rows you added yourself). Never DROP and recreate a table.
- Write SQL that is safe to re-run on a fresh copy:
min(),max(),WHEREguards,INSERT OR IGNORE. - Never ship a whole database. If you really must, build it from the game's original or set
PRAGMA application_id = 0; the platform's copies carry application_id0x46483244("FH2D") and are never built on. - Never tell players to delete
mediaoverride\Stripped\gamedbRC.slt. Other mods' changes live in it, and the platform puts back what was there. - Online play (FH2MP) needs the server's exact database; the platform leaves FH2MP's copy alone while online (chapter 9).
- The 2.9.0 "database guard" catches one known crash (a
Data_Car.PowertrainIDnot inPowertrains). Everything else must be right when you ship.
With Extra Options (0.3 and later, on Azimuth 1.0.1+), an EO mod in <Azimuth>\mods\<name>\ can carry a
database.json with rows to add (with Id renumbering and an id_conflicts policy) and a strings.json for names.
The format is described in chapter 3. The same rules apply: add and change rows, never replace
the file.
Id ranges, and why Ids are forever
| Range | Who uses it |
|---|---|
| 247-2501 | stock cars (Data_Car.Id; Forza Motorsport 5 leftovers go up to 2169) |
| 3000-8999 | platform car packs: the platform hands out a permanent Id per car |
| 9000 and up | a mod that adds a car under its own Id |
A car's own rows in the List_Upgrade* tables use Id*1000 to Id*1000+999 (car 247's engine rows are
247000-247003), so a car at 9000 owns rows 9000000-9000999. Pick your range and never move it.
Ids are forever. A save stores every bought car by Id, and every fitted part by its row Id. If a mod removes or
renumbers an upgrade row that a save uses, the game crashes when that car's physics load: a NULL read at
game+0x105BEEC (0x14105BEEC, the clutch reader), and at game+0x1064614 (0x141064614, the transmission reader)
once that is fixed. There is no guard. Removing a car the player owns is just as dangerous (the exact behaviour isn't
fully known; it can crash or move the player into another car). So:
- never renumber or delete rows you have shipped;
- when a mod is switched off, expect players to have its cars and parts in their saves;
- tell testers to back up
<Azimuth>\data\titles\1A96545B\savesbefore trying anything that changes cars or upgrades.
4.5.1 Cars and makes
Data_Car (354 rows, 146 columns) has one row per car.
| Group | Columns |
|---|---|
| Identity | Id, Year, MakeID (to List_CarMake.ID), MediaName (maker code + model + year, e.g. TOY_2000GT_69; names the car's zip), ModelId (must equal Id), DisplayName / ModelShort / MakeName (string refs), Thumbnail, ContentId (0 = no licence check; stock DLC cars carry ids such as 99), IsPurchased, IsInstalled, IsDrivable, IsArcade, IsUnicorn |
| Class and price | ClassID (to CarClasses.Id: 0-7 = D, C, B, A, S1, S2, X, R), PerformanceIndex (a float, 0 to 1.1; the PI shown is about 906 x PI + 127), BaseCost (credits), BaseRarity |
| Layout | PowertrainID (to Powertrains.Id, 0-7 only: a bad value crashes the Autoshow and garage), DriveTypeID, EnginePlacementID, EngineConfigID, CylinderID, AspirationTypeId (display only), Displacement, NumGears, CurbWeight, WeightDistribution, StockWheelID (to List_Wheels.ID), tyre sizes FrontTireWidthMM... RearWheelDiameterIN, ride heights |
| Shown stats | Time:0-60-sec, Time:0-100-sec, QuarterMileTime-sec, TopSpeed-mph, SpeedRating, HandlingRating, AccelerationRating, LaunchRating, BrakingRating (stored for cars you don't own; recomputed and written back once owned), Sim* |
| Physics and handling | 12 Steer* columns (identical on every stock car), BodyAero*, GameTorqueScale, GameDragScale, Lat* / Long*Scalar*, AssistsTCS* |
| Looks and cameras | HasLivery, HasRaceLivery, IsOpenCockpit, IsOpenWheel, WingMask, CaliperRGBFront/Rear, IsCameraCollidable, UseBoxCameraCollision |
Car 247 as a sample: (247, 1969, 'TOY_2000GT_69', '_&3444158956', ClassID 0, PI 0.329861, BaseCost 80000, PowertrainID 1).
The tables around it:
| Table | Key columns | What it does |
|---|---|---|
Data_Engine (355) | EngineID (1-2631), MediaName, EngineName, EngineMass-kg, ConfigID, CylinderID, Compression, VariableTimingID, StockBoost-bar, MomentInertia, GasTankSize, EngineGraphingMaxTorque/Power, EngineRotation, Carbureted, Diesel, Rotary | one row per engine. MediaName is also the engine sound name (4.10). EngineName is plain text ("6.2L V8"). AspirationID_Stock is never read by the exe |
Data_Drivetrain (357) | DrivetrainID (up to 5000), DrivetypeID, EngineMountingDirection, ShiftSystemID | drivetrains |
Data_CarBody (354) | dimensions, wheelbase, ModelFrontTrackOuter, ModelRearTrackOuter, ride heights, bounding box | the track columns set where the tyres' outer faces sit |
Data_Motor (1) | the one electric car (Tesla Model S, car 2101), with List_UpgradeMotor and List_UpgradeMotorParts | |
List_CarMake (66) | ID, DisplayName, ManufacturerCode (ACU, AST, AUD...), CountryID, IconPath (game:\Media\Stripped\RC0\Manu_Logo_<code>.swatchbin), IconPathLarge, IconPathBase, Profile | car makers |
Data_Car_Buckets (336) | CarId, CarBucket (to CarBuckets.Id), BucketHero | the car's Autoshow group. A car without a row isn't listed |
CarBuckets (38) | Id, Name, ParentBucketId, SortPriority | the groups themselves |
Powertrains (8) | Id 0-7, drive type, engine placement, icon | 0 FWD front; 1-3 RWD front/mid/rear; 4-6 AWD front/mid/rear; 7 RWD with placement 4 and no icon |
CarClasses (8) | ClassColor (signed ARGB int), MaxPerformanceIndex, BadgeTexturePathPrefix (CLASS_D...) | classes D to R |
CameraOverrides (346) | CarId + about 30 offsets (follow, bumper, hood, cockpit) | goes with the car zip's Locators.xml: take both from the same car |
CarExceptions (202) | CarID, NoMirrors, NoWindows, NoHood, NoPaintableWing | per-car exceptions |
CarPartPositions (2451) | ID, Ordinal (= car), PartId, PartPosX/Y/Z | part positions |
TrafficCars (17) | CarId, IsLaunchChunkCar | traffic cars; the Autoshow lists Data_Car minus these |
4.5.2 Upgrades, engine swaps and drivetrain swaps
The game knows 43 part kinds ("enums"; the table is at game+0x2E797F0, 0x142E797F0). Each List_Upgrade* table
belongs to one kind and is keyed by one owner:
| Enums | Tables (List_Upgrade*) | Keyed by |
|---|---|---|
| 0-11 | Engine, Drivetrain, CarBody, Motor, Brakes, SpringDamper, AntiSwayFront, AntiSwayRear, TireCompound, RearWing, RimSizeFront, RimSizeRear | Ordinal = car Id |
| 12-29 | EngineCamshaft, Valves, Displacement, PistonsCompression, FuelSystem, Ignition, Exhaust, Intake, Flywheel, Manifold (21), RestrictorPlate, OilCooling, TurboSingle / Twin / Quad (24-26), CSC, DSC (27, 28), Intercooler | EngineID |
| 30-33 | DrivetrainClutch, Transmission, Driveline, Differential | DrivetrainID |
| 34-41 | CarBodyFrontBumper, RearBumper, Hood, SideSkirt, TireWidthFront, TireWidthRear, Weight, ChassisStiffness | CarBodyID |
| 42 | MotorParts | MotorID |
- Row Ids are
owner * 1000 + n. Car 247's engine rows are 247000-247003; engine 1045's sub-parts start at 1045000; drivetrain 1's transmissions are 1000-1004. - Common columns:
Id, the owner column,Level(0 = stock, 1-3 = upgrades; level 4 is a "remove" kit in the wing and bumper tables),IsStock(exactly one stock row per enum the car uses),ManufacturerID,Price,MassDiff,WeightDistDiff,DragScale,WindInstabilityScale, andRequiresGraphicson visual parts. - An engine swap is a non-stock
List_UpgradeEnginerow:Ordinal= the car,EngineID= another engine. Car 247 (Toyota 2000GT) has stock engine 1 (row 247000, Level 0) and swaps to engines 136, 579 and 87 (Levels 1-3). The swapped engine's sub-parts come from that engine's ownEngineID-keyed rows, which exist for every stock engine. On a swap the garage resets the engine's sub-parts (game+0x2CD090,0x1402CD090). The engine sound follows the fitted engine'sData_Engine.MediaName. - A drivetrain swap is a non-stock
List_UpgradeDrivetrainrow (DrivetrainID,PowertrainId): car 247's row 247001 swaps to drivetrain 2102, powertrain 4 (AWD front). - Aspiration: each engine needs exactly one stock part among enum 21 (manifold) and 24-28 (turbos and superchargers), or the car never finishes loading. A naturally aspirated engine's "aspiration part" is its stock manifold (TorqueScale 1.0). Forced induction needs the matching stock row plus a stock intercooler row.
- Revs:
Data_Engine.MomentInertia, the stock flywheel'sMomentInertiaand the stock camshaft curve'sList_TorqueCurve.ZeroThrottleTorqueScaletogether set how fast revs rise and fall. Take all three from one engine. - Torque:
List_UpgradeEngineCamshaft.TorqueCurveFullThrottleIDpoints intoList_TorqueCurve(TorqueScale,NumTorqueValues,v0..v245,ZeroThrottleTorqueScale). - Gearbox: transmission rows have
GearShiftTime,FinalDriveRatio,NumGears,GearRatio0..8,CVTShiftTime. - Suspension:
List_UpgradeSpringDamper.Front/RearSpringDamperPhysicsIDpoint intoList_SpringDamperPhysics(ride height, spring and damper ranges, bump stops). - Extra Options'
[Experiments] AllEngineSwapsandAllTransmissionSwapsunlock swaps in memory instead (chapter 3).
4.5.3 Events and championships
| Table | Rows | What it holds |
|---|---|---|
AnthemEvents | 790 | AnthemEventId, Name, Description, CareerStage, EventType (0 = championship race, 762 of them; 1-4 other kinds), CampaignId, UnlockGroup |
AnthemEventRaces | 790 | per event: Order, NumberOfAIDrivers, TimeOfDayStart/End, TrackId, NumLaps, RaceModeId, CustomWeather, WeatherPreset, WeatherEnvironmentWetness, WeatherPrecipitationLevel, UnpauseWeather, Radio1Track..Radio8Track, DifficultyMin/Max, LoadBackToStart, HardcoreMode |
Campaigns | 198 | championships: Id, Name, CareerLocationId (0 mainland: 168, 1 island: 30), RoadTripLocationId, CarBucket (which car group may enter) |
IslandCampaigns | 30 | Storm Island tiles |
EventCars | 11 | fixed loan cars, with every part Id |
RaceModes | 37 | Enum: LapsRace, StreetRace, CrossCountry, XEvent, Scramble, TrailRace, HillClimb, Showcase, Endurance, SpecialStage, Joust, RelayRace, CustomCommunity, PassChallenge, Delivery, Domination, Elimination, Outlaw, TopSpeed, CarPaintball, Countdown, SpeedTrapChallenge, SpeedZoneChallenge, SkillBattle, HangTime, King, Infection, PrisonBreak, CaptureTheFlag, SmashAttack, RoadTrip, P2P, RallyX, RallyRush, CrossCountryCircuit, ExtremeCrossCountry, IronMan (the gauntlets) |
Events, Races, MiniCareers | 588, 588, 42 | mostly Forza Motorsport-era structure kept in the file |
Showcases have no table of their own: they are in media\tracks\anthem\ShowcaseEvents.xml plus the Showcase race
mode.
4.5.4 AI and Drivatars
| Table | What it holds |
|---|---|
AITemperaments (12) | Ids 1-10 run from calm to aggressive, -1 is the fallback, 100 is special. Columns: MiscDriver_Pass, Passing_AggressionLevel, Passing_StartPassAtImpactTime, Passing_TrailingDistance, Passing_ScriptedPassProbability, Passing_InteractionLinePassProbability, Passing_LowRelVelPassProbability, Passing_CarClearance, Passing_TrackEdgeClearance |
AIDrivingBehaviorObservationDefaults (143) | starting habits by DifficultyLevelId and AIPlayerId: CornerCutting*, GoingWide*, GoingOff*, TimeRatioMean/Stddev, BlockingMean, SideswipeMean, TemperamentMean, RacingLineOffsetMean |
AIPlayers (26) | Id, Name (to AIPlayers.str), DriverModelId, IsSpecial, XP: the names of car-meet and road-trip drivers (the exe runs SELECT Name, DriverModelId FROM AIPlayers WHERE Id=%d). AIPlayerColors holds their paint |
AIMistakeScales_CarClass, AIMistakeScales_TurnType, AIFrictionScales, AILineChoices | AI skill tuning |
The built-in Drivatars are not in the database. They are in media\DrivatarGlobalCache\DefaultCache.bin:
| Offset | Type | What |
|---|---|---|
| 0x0 | u32 | version, 4 |
| 0x4 | u32 | record count, 125 (25 gamertags x 5) |
| 0x8 | 125 x 0x2658 bytes | records |
| record +0x0 | UTF-16, 32 bytes | gamertag (15 characters and a NUL) |
| record +0x2650 | u32 | Drivatar id, 1-25 |
The file is read once at start-up (game+0xA2D0E0, 0x140A2D0E0). A championship copies the records it picks into
the save (ChampionshipDrivatarsState), so a replacement file changes new championships only. A mod can replace it
with set_file("drivatarglobalcache/DefaultCache.bin", ...) or through an override folder.
4.5.5 Credits and rewards
| Table | Columns | What |
|---|---|---|
TombolaPrizes (54) | PrizeId, InitialExperienceId, CreditAward, CarAwardIds, HyperPrize | Wheelspin prizes |
Rewards_DriverLevelv3 (77) | DriverLevel, RewardCarId | cars given at driver levels |
RentalCars (22) | CarId (primary key) | cars you can borrow |
CareerTargetPayouts, CareerTargetScores, EventBonuses, EventRandomBonuses, Perks, SkillTypes, VipDiscounts | payouts, bonuses, perks and skills | |
Data_Car | BaseCost | Autoshow price |
XP levels and wristband colours are not in the database: they are in GameTunableSettings.zip
PlayerXPLevels.xml (ColourNum, TextColour, signed ARGB).
4.5.6 Bucket lists, barn finds, car meets and travel
BucketLists(7):ListId,Title/Subtitle/Tagline(andCoopversions),Image,Visible,MediaTrack(542 mainland, 549 island),ProductId(the DLC GUID of the Porsche list),SortOrder.BucketListChallenges(63):ChallengeId,SlotId,CarId,ListId,Type,Difficulty,Description,TimeLimit,TargetScoreSolo/Coop,Destination,SkillType/SkillRank(three of each), time of day, weather, radio,SmashableType,RouteId,CoopRouteId,ForcedCamera. When you clone a car, don't copy its row here: it would show up in a second challenge.- Barn finds have no table. They are world objects (
tracks\anthem\ribbon_00\GameObjs.xmlBARN_FIND_nn_CLOSED/OPEN), trigger zones (triggerzones\tz_barn_finds\barn_find_spatial_triggers.tz), the stateflowbarn_finds.xmland the text inBarnFind.str. Progress lives in the save. CarMeets(7:Id,RoadTripLocationId) andCarMeetEvents(19:CarMeetEventId,CarMeetId,TrackId).RoadTripEvents,RoadTripLocations,DestinationHubsandEnvironments(55;MediaName, map position, loading art) describe festival sites and travel.
4.5.7 Weather in the database
WeatherPreset Ids pick a weather for an event (AnthemEventRaces.WeatherPreset, with CustomWeather = 1):
| Id | Preset | Id | Preset |
|---|---|---|---|
| 0 | Clear | 7 | StormBCloudyA |
| 1 | CloudyA | 8 | StormBCloudyB |
| 2 | CloudyB | 9 | CloudyFog |
| 3 | ThreateningStormACloudyA | 10 | ThreateningFog |
| 4 | ThreateningStormACloudyB | 11-13 | StormTropical (island) |
| 5 | ThreateningStormCCloudyA | ||
| 6 | ThreateningStormCCloudyB |
WeatherSeverity and EnvironmentTimeOfDay go with it. Free-roam weather is in XML files (4.13).
4.5.8 Colours and liveries in the database
Combo_Colors(1040:ID,Ordinal= car,Sequence,Metallic,RGB,BaseTexture,DamageTexture,ColorClassId): the paint swatches per car. These Ids are not car-based (the highest is 1,519,397): new rows take Ids above the current maximum.Combo_Colors_Exceptionsadds second colours and stripes.List_SpecialColors,StripeColors,List_LiveryMaterials(paint materials and finishes),TeamColors.Livery_VinylsDecals(1440:ID,Category,Name,Path,SortOrder): the shapes a livery layer's shape Id points at (101 is the first letter). WithLivery_Categories,Livery_DecalsandLivery_VinylNames.
4.5.9 Example SQL
All of these go through add_sql. "Offline" means the statements were run on a copy of the stock database and did
what they say there; "in game" means someone saw the result in the game.
1. Calmer AI (no hooks at all). Offline: yes. In game: unconfirmed.
UPDATE AITemperaments SET
Passing_AggressionLevel = min(Passing_AggressionLevel, 0.25),
Passing_TrailingDistance = max(Passing_TrailingDistance, 8.5),
Passing_CarClearance = max(Passing_CarClearance, 1.75),
Passing_TrackEdgeClearance = max(Passing_TrackEdgeClearance, 1.05)
WHERE id <= 10; -- 1-10 and the -1 fallback; leaves the special 100 alone
UPDATE AIDrivingBehaviorObservationDefaults SET SideswipeMean = 0, BlockingMean = 0;
2. Economy. Offline: yes. In game: unconfirmed.
UPDATE Data_Car SET BaseCost = MAX(1000, BaseCost / 2); -- half-price Autoshow
UPDATE Data_Car SET BaseCost = BaseCost / 4
WHERE MediaName LIKE 'FER\_%' ESCAPE '\' AND Year < 1970; -- by maker code
UPDATE Data_Car SET BaseCost = CAST(BaseCost * 1.25 AS INTEGER) WHERE PerformanceIndex >= 0.9;
UPDATE TombolaPrizes SET CreditAward = CreditAward * 2 WHERE CreditAward > 0; -- double Wheelspin credits
These are not idempotent in the strict sense, but that is fine: the platform always starts again from the stock values, so each runs once per build.
3. An engine swap on a stock car. Offline: the row inserts. In game: not tested. Car 247 already uses Levels
0-3, so the next swap takes Id 247004 and Level 4; whether the swap menu lists a Level above 3 is unverified. Engine
2144 is a stock "6.2L V8" (CHE_CorvetteStingray_14), so its sub-part rows and engine sound already exist.
INSERT OR IGNORE INTO List_UpgradeEngine
(Id, Ordinal, Level, EngineID, IsStock, ManufacturerID, Price,
MassDiff, WeightDistDiff, DragScale, WindInstabilityScale)
VALUES (247004, 247, 4, 2144, 0, 49, 60000, 80, 0.02, 1.0, 1.0);
Remember Ids are forever: once a player fits this engine, row 247004 must stay.
4. Weather for one championship race. Offline: yes. In game: unconfirmed.
UPDATE AnthemEventRaces
SET CustomWeather = 1, WeatherPreset = 7, WeatherPrecipitationLevel = 1, WeatherEnvironmentWetness = 1
WHERE AnthemEventId = <id>;
5. A car in the Autoshow group of your choice, and as a rental. Offline: yes. In game: the bucket change is unconfirmed, the rental is unverified.
UPDATE Data_Car_Buckets SET CarBucket = <bucket id> WHERE CarId = <car id>;
INSERT OR IGNORE INTO RentalCars (CarId) VALUES (<car id>);
6. A new car cloned from a stock one. This is the pattern platform car packs use (proven in game through car
packs). {car:FOR_MustangCL_15} is the car-pack placeholder the platform replaces with the car's permanent Id; a
plain mod writes its own 9000+ Id instead.
INSERT INTO Data_Car (<all columns>)
SELECT <...>, {car:FOR_MustangCL_15} AS Id, 'FOR_MustangCL_15' AS MediaName,
{car:FOR_MustangCL_15} AS ModelId, 0 AS ContentId, 'Mustang GT Clone' AS DisplayName, ...
FROM Data_Car WHERE Id = <base>;
-- Then, for each table with an Ordinal or CarId column (List_Upgrade*, physics lists, CameraOverrides,
-- CarPartPositions, Data_Car_Buckets, CarExceptions): copy the base car's rows with Ordinal/CarId set to the
-- new Id, and shift any *Id column in base*1000 .. base*1000+999 by (new - base) * 1000.
-- Combo_Colors: ID = max(ID) + Sequence.
-- Copy List_AeroPhysics rows numbered in the car's range too (109 stock cars' wings use them).
-- Skip BucketListChallenges, races and championships, and colour exceptions.
7. Names are not SQL. AIPlayers.Name, Data_Car.DisplayName and similar columns hold string refs, so renaming a
car-meet driver or a stock car is set_string on an AIPlayers.str or Data_Car.str key (4.6),
not an UPDATE.
4.5.10 What a new car needs at minimum
In short: a Data_Car row (ModelId = Id, a valid PowertrainID, a MakeID that leads to List_Country), a
Data_Car_Buckets and a CameraOverrides row, exactly one stock row per upgrade enum including one aspiration part,
no TrafficCars row, a string-key name and a zipmanifest.xml line. The full rules, and what breaks without each, are
in 14.3 The database.
4.5.11 Text in the database is string ids
A text column holds _&<number>. The low 16 bits are the key in a string table, the high 16 bits a constant for that
table. Data_Car.str's constant is 0xCD49, so _&3444141176 = 0xCD496C78 = key 0x6C78 in Data_Car.str,
"Mustang GT". Most database tables with text have a string table of the same name.
4.5.12 All tables
The 288 tables of the shipped file, with their row counts. For every table's columns, ask a copy of the file itself:
SELECT name, sql FROM sqlite_master WHERE type = 'table'.
| Table | Rows | Table | Rows | Table | Rows | Table | Rows |
|---|---|---|---|---|---|---|---|
AddOnTable | 2 | EventBonuses | 46 | List_UpgradeCarBodySideSkirt | 473 | NewProfile_Career_Track_Stats | 0 |
AIDrivingBehaviorObservationDefaults | 143 | EventCars | 11 | List_UpgradeCarBodyTireWidthFront | 1155 | NewProfile_CarExperienceRevealsSeen | 0 |
AIDrivingBehaviorObservationModel_Beliefs | 57 | EventGroups | 18 | List_UpgradeCarBodyTireWidthRear | 1351 | NewProfile_CarExperienceUnlocks | 4 |
AIDrivingBehaviorObservationModel_Observations | 57 | EventRandomBonuses | 81 | List_UpgradeCarBodyWeight | 1228 | NewProfile_CarPointsOfInterestProgress | 0 |
AIDrivingBehaviorObservationModelTR_Beliefs | 18 | EventRestrictions | 0 | List_UpgradeDrivetrain | 750 | NewProfile_ChangeTracking | 0 |
AIDrivingBehaviorObservationModelTR_Observations | 18 | Events | 588 | List_UpgradeDrivetrainClutch | 1139 | NewProfile_ContentSeen | 0 |
AIDynamicLineObservations | 10 | EventScoring | 8 | List_UpgradeDrivetrainDifferential | 1044 | NewProfile_FreeCars | 0 |
AIFrictionScales | 21 | FeaturedTilesOfflineCars | 12 | List_UpgradeDrivetrainDriveline | 1232 | NewProfile_GameplayAggregate | 0 |
AILineChoices | 24 | FeaturedTilesPanamaCars | 5 | List_UpgradeDrivetrainTransmission | 1500 | NewProfile_IslandCareer_ChampionshipEventsCompleted | 0 |
AIMistakeScales_CarClass | 11 | FixedLiveryCars | 4 | List_UpgradeEngine | 821 | NewProfile_IslandCareer_ChampionshipHistory | 0 |
AIMistakeScales_TurnType | 16 | FlyingStartPositions | 52 | List_UpgradeEngineCamshaft | 1049 | NewProfile_IslandCareer_ChampionshipsCompleted | 0 |
AIPlayerColors | 25 | ForcedCameras | 6 | List_UpgradeEngineCSC | 249 | NewProfile_IslandCareer_ChampionshipStandings | 0 |
AIPlayers | 26 | FreeRevOverrides | 2 | List_UpgradeEngineDisplacement | 1063 | NewProfile_IslandCareer_ChampionshipsWon | 0 |
AITemperaments | 12 | GameCinematics | 39 | List_UpgradeEngineDSC | 392 | NewProfile_LastUsedGarageId | 1 |
AnthemEventLimits | 1 | GameOptionCategories | 19 | List_UpgradeEngineExhaust | 1050 | NewProfile_PerkUnlock | 0 |
AnthemEventParticipants | 13 | GameOptionCategoryMap | 391 | List_UpgradeEngineFlywheel | 1234 | NewProfile_PhotoCaptures | 0 |
AnthemEventRaces | 790 | GameOptionGroups | 17 | List_UpgradeEngineFuelSystem | 969 | NewProfile_VisitedHopperCategories | 0 |
AnthemEvents | 790 | GameOptionMap | 253 | List_UpgradeEngineIgnition | 976 | OnDiscContent | 221 |
AnthemEventUnlocks | 5 | GameOptions | 123 | List_UpgradeEngineIntake | 1099 | PerformanceBudget | 55 |
AnthemOnlineEventPermissions | 814 | GameOptionValues | 148 | List_UpgradeEngineIntercooler | 977 | PerformanceBudgetCameras | 5 |
AnthemOnlineEvents | 204 | GraffitiPoints | 2335 | List_UpgradeEngineManifold | 585 | Perks | 25 |
AuctionSearchValues | 26 | HiddenContentTable | 0 | List_UpgradeEngineOilCooling | 1041 | PittingProfiles | 25 |
AutoSteerOverrides | 3 | HorizonRecommends | 12 | List_UpgradeEnginePistonsCompression | 925 | PlayerSections | 16 |
BackfireLevels | 16 | IEAutoShowCars | 3 | List_UpgradeEngineRestrictorPlate | 13 | PlayerSectionSceneMapping | 16 |
BristolLayouts | 5 | IslandCampaigns | 30 | List_UpgradeEngineTurboQuad | 0 | Powertrains | 8 |
BucketListChallengeDifficulty | 3 | IslandIEDriveCars | 4 | List_UpgradeEngineTurboSingle | 454 | RaceModes | 37 |
BucketListChallenges | 63 | KinectSplitscreenTracks | 30 | List_UpgradeEngineTurboTwin | 490 | RaceParticipantGroups | 162 |
BucketListChallengeTypes | 15 | List_AeroPhysics | 377 | List_UpgradeEngineValves | 1109 | RaceParticipants | 1004 |
BucketLists | 7 | List_AntiSwayPhysics | 1965 | List_UpgradeMotor | 1 | Races | 588 |
CameraOverrides | 346 | List_Aspiration | 8 | List_UpgradeMotorParts | 4 | RacesSpecial | 21 |
Campaigns | 198 | List_BadgeAndTitleUnlocks | 377 | List_UpgradeRearWing | 836 | RentalCars | 22 |
CampaignScoring | 12 | List_BrakeType | 5 | List_UpgradeRimSizeFront | 1367 | Rewards_DriverLevelv3 | 77 |
CarBuckets | 38 | List_CarMake | 66 | List_UpgradeRimSizeRear | 1368 | Rewards_EventCars | 0 |
CarClasses | 8 | List_CarType | 3 | List_UpgradeSpringDamper | 1355 | RibbonConfigurationTypes | 6 |
CarDetails | 33 | List_ColorClass | 24 | List_UpgradeTireCompound | 1442 | RoadTripDestinationList | 15 |
CareerEventTypes | 17 | List_ColorFinish | 3 | List_VariableTiming | 3 | RoadTripEvents | 17 |
CareerIntros | 20 | List_Country | 23 | List_Wheels | 620 | RoadTripEventTypes | 5 |
CareerLocations | 2 | List_Cylinders | 12 | List_WheelStyle | 0 | RoadTripLocations | 8 |
CareerMetaGroups | 8 | List_DamageModDef | 11 | Livery_Categories | 45 | RoadTripLocationTypes | 2 |
CareerStage | 4 | List_DriveType | 3 | Livery_Decals | 466 | RoadTripPlaythrough | 5 |
CareerTargetPayouts | 18 | List_EngineConfig | 9 | Livery_DecalsSortOrder | 3012 | SkillTypes | 49 |
CareerTargetScores | 32 | List_EnginePlacement | 3 | Livery_VinylNames | 40 | SplitPoints | 544 |
CarExceptions | 202 | List_FamilyBody | 46 | Livery_VinylsDecals | 1440 | StartGridPositions | 1585 |
CarInvalidDefaultParts | 0 | List_FamilyModel | 38 | MiniCareerCars | 232 | StripeColors | 103 |
CarListFilters | 1 | List_FamilySpecial | 5 | MiniCareers | 42 | TeamColors | 4 |
CarMeetEvents | 19 | List_HopperBackgroundImages | 21 | MultiDiscContentPacks | 5 | ThumbnailTypes | 6 |
CarMeets | 7 | List_HopperEventIcon | 21 | MultiDiscSlides | 3 | TombolaPrizes | 54 |
CarPartNames | 6 | List_LiveryMaterials | 43 | NewProfile_AddOnState | 0 | TrackPittingZones | 91 |
CarPartPositions | 2451 | List_MaterialType | 2 | NewProfile_BadgeTitleProgress | 0 | Tracks | 287 |
CarsDropParts | 6 | List_PartAttribute | 546 | NewProfile_BadgeTitleUnlocks | 0 | TrackStartingMerges | 42 |
CarTrackOffsets | 75 | List_PartManufacturer | 547 | NewProfile_BarnFinds | 0 | TrafficCars | 17 |
Combo_Colors | 1040 | List_PartsStrings | 136 | NewProfile_BucketListProgress | 0 | TrialLoadingImages | 7 |
Combo_Colors_Exceptions | 190 | List_Region | 3 | NewProfile_Career_Affinity | 0 | TurnSections | 1264 |
Combo_TireBrandCompound | 30 | List_ShiftSystem | 7 | NewProfile_Career_AIHistory | 0 | UpgradeAreas | 7 |
ContentOffers | 87 | List_SpecialColors | 102 | NewProfile_Career_CampaignResults | 0 | UpgradeEverymanOptions | 1 |
ContentOffersMapping | 133 | List_SpringDamperPhysics | 2722 | NewProfile_Career_CarGroups | 0 | Upgrades | 207 |
ControllerLayouts | 13 | List_SuspensionPhysicsType | 19 | NewProfile_Career_ChampionshipEventsCompleted | 0 | UpgradeTypes | 46 |
DamageDiffSettings | 4 | List_SuspensionType | 6 | NewProfile_Career_ChampionshipHistory | 0 | UpgradeWizardParts | 84 |
Data_Car | 354 | List_TireAffectCurve | 110 | NewProfile_Career_ChampionshipsCompleted | 0 | UpgradeWizardPartsRemoval | 30 |
Data_Car_Buckets | 336 | List_TireCompound | 10 | NewProfile_Career_ChampionshipStandings | 0 | UpgradeWizardPowerRemoval | 17 |
Data_CarBody | 354 | List_TireFrictionCurve | 58 | NewProfile_Career_ChampionshipsWon | 0 | VersionInfo | 1 |
Data_Drivetrain | 357 | List_TireFrictionMultiCurve | 29 | NewProfile_Career_Destination_Stats | 0 | VipDiscounts | 1 |
Data_Engine | 355 | List_TorqueCurve | 1050 | NewProfile_Career_DestinationUnlock | 0 | VolatileHostOptions | 11 |
Data_Motor | 1 | List_Unlocks | 4 | NewProfile_Career_EventCarsClaimed | 0 | WeatherPreset | 14 |
Demo_CarList | 12 | List_UpgradeAntiSwayFront | 971 | NewProfile_Career_EventResults | 0 | WeatherSeverity | 4 |
DestinationHubs | 9 | List_UpgradeAntiSwayRear | 994 | NewProfile_Career_EventUnlock | 0 | WheelAnnotations | 99 |
DrivatarTestingAIPlayers | 88 | List_UpgradeBrakes | 1055 | NewProfile_Career_Garage | 0 | WheelCategories | 4 |
DrivatarTestingObservationDefaults | 89 | List_UpgradeCarBody | 354 | NewProfile_Career_Playthrough | 0 | WheelExceptions | 30 |
DriverModels | 2 | List_UpgradeCarBodyChassisStiffness | 1124 | NewProfile_Career_PurchasedParts | 0 | WheelLayouts | 5 |
EnvironmentLoadingImages | 208 | List_UpgradeCarBodyFrontBumper | 887 | NewProfile_Career_RaceResults | 0 | WheelNormOffsets | 111 |
Environments | 55 | List_UpgradeCarBodyHood | 479 | NewProfile_Career_Track_DrivatarStats | 0 | Wristbands | 3 |
EnvironmentTimeOfDay | 36 | List_UpgradeCarBodyRearBumper | 510 | NewProfile_Career_Track_RaceFeats | 0 | XboxMusicSettings | 1 |
4.6 String tables
Where and what
media\Stripped\StringTables\<LANG>.zip, one zip per language (18 in all):EN(US),GB,DE,FR,ES,MX,IT,JP,KO,CHT,RU,PL,br(Brazilian Portuguese),nl,cz,HU, plusDEV(developer English) andLOC(placeholders likeMain:IDS_Press).cz.zipandHU.zipare byte-identical; the game shows English for Czech and Hungarian.- Each zip holds 126 tables,
<Name>.str, one per area:Main.str,PauseMenu.str,LoadingMessages.str,AIPlayers.str,Data_Car.str,List_CarMake.str,AnthemEvents.str,Campaigns.str,BucketList*.str,BarnFind.str,CarMeets.str,Tracks.str,Upgrades.str,UpgradeTypes.str,Livery*.str,HelpButtons.str,GameOptions.str,ScreenTitles.str,TheIsland.str,Panama.str(the Porsche expansion),TitleUpdate*.strand more.
Keys
- Every string has a 16-bit key, the same in every language, and a developer name
IDS_.... - A database reference
_&<n>names the table by its high 16 bits and the key by its low 16 bits (4.5.11). - Strings may contain
{0}placeholders (keep them) and\nline breaks where the box has room. - Useful keys:
| Table | Key | Name | Text |
|---|---|---|---|
Main.str | 0xB197 | IDS_Press | PRESS |
Main.str | 0x18F0 | IDS_To_Start | TO START |
LoadingMessages.str | 0x6875 | IDS_FastTravel | |
LoadingMessages.str | 0xBA63 | IDS_EnteringCarMeet | Entering {0} Car Meet |
AIPlayers.str | IDS_Name_1... | the 25 Drivatar gamertags and "HRZN Ben" | |
Data_Car.str | 0x6C78 | Mustang GT |
To find a key, use scripts/dump_strings.py in the
platform repo; it lists and searches a language zip.
The LSB2 format
| Part | Layout |
|---|---|
| Header | "LSB2", u32 0, u32 0x200, u32 header size 0x24, u32 section count 4, u32 offsets[4] |
| Section 0, strings | u32 size, u32 count, (count + 1) x {u16 key, u32 offset in UTF-16 units} ending with a 0xFFFF sentinel, then NUL-terminated UTF-16LE text |
| Section 1, names | u32 size, u32 count, count x {u16 key, u16 index, u32 offset}, then the ASCII IDS_ names |
| Section 2 | a "DBPipeline tool" comment |
| Section 3 | key order |
To change a string, rebuild section 0 and shift the later offsets. To add a key, insert it in key order in section 0
with matching records in sections 1 and 3 (the platform does this from 2.9.0). The game's own Data_Car.str keys end
at 0xFEC3, so the platform gives added car names keys from 0xFF00.
Changing text
Don't edit the zips. Override one table at a time: mediaoverride\Stripped\StringTables\<LANG>\<table>.str (or
the platform's layer). Through the platform, which merges every mod's edits to the same table:
api->set_string(mod, "Main.str", 0x18F0, L"TO DRIVE"); // one key, every language
api->replace_string(mod, "PauseMenu.str", L"PHOTO", L"PICTURE"); // every exact match in a table
api->clear_strings(mod, nullptr); // undo all of this mod's edits
set_string,replace_stringandclear_stringsset one text for every language.set_string_tr(API 10) sets a text per language. Signatures and the per-language rules are in chapter 2.- The game reads string tables once, early in start-up: changes made in
fh2mod_initare always in time. Later changes needapply_stringsand show from the next launch. - With Extra Options, an EO mod's
strings.jsongives names; see chapter 3.
Fonts and character sets
- The Anthem fonts (
media\ui\Fonts.zip,.vfont) have 248 glyphs: all Polish, Czech and Hungarian letters, but not Romanian ă ș ț, and of Cyrillic only Ё and ё.verdana(full Cyrillic) loads only for Russian. Japanese, Korean and Traditional Chinese use subset CJK fonts. - Message boxes go through the UTF-16
CLocString. MakeDisplayString(game+0x323310,0x140323310) converts with the Windows code page, so non-ASCII text passed through it can come out garbled.
4.7 The UI: UI.zip and stateflow
What is in UI.zip
media\UI.zip is a plain zip with 467 entries: 460 .xaml files, 6 compiled effects (Effects\*.bin.dx11:
CircularProgress, MotionBlur, NormalEffect, SRGBShader, TextureMaskEffect, TintShader) and UITransitions.xml.
| Folder | Count | What |
|---|---|---|
| top level | App.xaml, AnthemApp.xaml, SystemResources.xaml | |
Scenes\Anthem\ | 181 | the real FH2 pages, A_*.xaml (and AR_* in-world markers) |
Scenes\WPF\ | 184 | F###_*.xaml pages from the Forza Motorsport 5 era (unverified whether any can be reached) |
Resources\Anthem\ | 47 | shared styles: Global_* (Brushes, Colors, Controls, Converters, DefaultStyles, Sizes, TextStyles, Textures, Timings, Transforms, Transitions...), Common_*, Shared_* (Shared_OptionsScreens.xaml with A_Style_Slider_Options, Shared_TiledMenus.xaml with A_ControlTemplate_IconTile, Shared_Hud.xaml, Shared_TextMenus.xaml, Shared_Bars.xaml, Shared_CarSelect.xaml, Shared_LiveryMenus.xaml...) |
Resources\ | 7 | *ResourceDictionary.xaml: Animation, Career, DialogPopup, HUD, Options, PrePostRace, UpgradeTuning |
Controls\ | 38 | HUD widgets as user controls: HUDSpeedometerControl, HUDRadioControl, HUDMinorNotificationControl, HUDMajorNotificationControl, HUDRaceProgressControl, HUDSkillControl, HUDMiniLeaderboardControl, HUDWrongWayControl, IconTileControl, NotificationPopupControl... |
The pages that matter
Page (Scenes\Anthem\) | What it is |
|---|---|
A_Splash.xaml | the title screen, class Splash ("PRESS (A) TO START" is its HelpButton) |
A_PauseMenu.xaml | the pause menu (tabs of icon tiles) |
A_PauseOptions.xaml | Pause > Settings, class PauseOptionsMenu, a 5 x 2 tile grid |
A_HUDOptions, A_VideoOptions, A_AudioOptions, A_AssistOptions, A_ControllerOptions, A_GameOptions | the options pages |
A_Hud.xaml | the free-roam and race HUD, class Hud; A_Telemetry.xaml replaces it when the telemetry HUD is on |
A_MessageBox.xaml | the generic message box and list popup |
A_Map.xaml, A_IslandMap.xaml | the world maps (MaxMapDistance caps zoom-out) |
A_Garage, A_CarSelect, A_Upgrades, A_TuningOptions, A_Livery*, A_ColorSelect, A_ViewCar, A_PhotoMode, A_Rewind, A_Tombola, A_PostRace*, A_RoadTrip*, A_BucketList*, A_CarMeet* | everything else |
How a page works
- The XAML is WPF-style and read by AVUI, Turn 10's C++ take on WPF:
Binding, styles, templates and converters all work. A page starts like this:
<Page x:Class="ForzaUI.Scenes.Anthem.A_X"
xmlns:local="clr-namespace:ForzaUI"
Style="{StaticResource A_Style_Page_Generic}"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
local:UIPageTransitionManagersets the open and close sounds (for example/Master/UI/PopUpMenu/HZ2_SFX_HUD_PopUpMenu_Open_01).- Each page is also a C++ class. It binds the XAML's
PART_*named elements (such asPART_Button_Achievements) and supplies the properties the bindings ask for, looked up by name throughAVUI::Type::FindProperty(game+0x157FF60,0x14157FF60; the platform hooks this one, so don't). - A page may use only resources that exist in UI.zip. An unknown resource or markup extension crashes the game when the page opens. Test every page by opening it.
- Textures for the UI are in
media\ui\textures\:Anthem.zipholds HUD art (radio icons areHUD\HUD_RadioIcon_<Station>.swatchbin, 196 x 96, BC7, Xbox-tiled, premultiplied alpha).Data_Bound.zipanddata_bound\*.zip(one zip per area:upgrade_parts,drivetrain_icons,the_island,panama,cu2..cu5update packs,horizon_map,help_buttons...) hold art the database points at, with paths likeGAME:\Media\UI\Textures\Data_Bound\Upgrade_Class\Upgrade_Image_Cars1.swatchbin.
stateflow.zip: which page opens when
media\stateflow.zip has 64 state-machine XMLs: ui_screens.xml (screen states, for example
show_hud_and_continue leads to UIPageHud or UIPageTelemetry), pause.xml, global.xml, in_game_ui.xml,
boot.xml, career_states.xml, race_flow.xml, post_race_flow.xml, barn_finds.xml, bucket_list_*.xml,
car_meet*.xml, garage.xml, paintshop.xml, autoshow.xml, fast_travel.xml, track_swap_flow.xml,
skill_tree.xml, speed_*.xml, tombola.xml, network_*.xml and more. The shape:
<stategroup id="...">
<state id="...">
<node state="..." />
<exit target="..." />
<behavior id="UIPage..." />
</state>
</stategroup>
The XAML reader's quirks (proved in code)
- Entities: only
& ' " > <and hex references with a lower-case x (ó) are decoded. Any other reference, every decimal one such asóincluded, becomes a space (DecodeEntity,game+0x153BEB0,0x14153BEB0). No stock page uses an entity, so offline tests won't catch this. Use&#x...;. - Encoding: a file without a BOM is read one byte per character as Latin-1 (0x80-0x9F are control characters, not
Windows-1252). A UTF-8 BOM (
EF BB BF) switches on a lax UTF-8 decoder that can swallow a closing quote after a stray byte. Write UTF-8 with a BOM and check every non-ASCII character. - Braces: don't turn
{/}into literal braces: an unknown markup extension crashes the page. - Radio lists (
RadioInfo_*.xml) are read with no entity decoding at all: write&raw there.
Who owns which UI files
The platform owns these files and refuses set_file for them:
UI\Scenes\Anthem\A_Hud.xaml,A_Splash.xaml,A_PauseMenu.xaml,A_PauseOptions.xaml,A_ModOptions.xaml,A_ModPage_NN.xaml;stateflow\pause.xmlandstateflow\ui_screens.xml.
Any other UI file (a HUD control such as UI\Controls\HUDSpeedometerControl.xaml) can be replaced by one mod at a
time with set_file. For new pages, use the platform's page API (chapter 2).
Extra Options rewrites some pages
Extra Options (winmm.dll) edits page text as the game reads it. It finds a page by an exact, case-sensitive
x:Class="..." match, whatever the file is called. The classes it looks for (0.4.4):
ForzaUI.Scenes.Anthem.A_MessageBox,ForzaUI.Scenes.Anthem.A_AssistOptions,ForzaUI.Scenes.Anthem.A_CarMeetCarDetails;ForzaUI.A_HudOptions,ForzaUI.A_AudioOptions,ForzaUI.A_VideoOptions,ForzaUI.A_PhotoMode,ForzaUI.A_PauseMenu,ForzaUI.A_PostRaceEventResults,ForzaUI.A_ViewCar,ForzaUI.A_ColorSelect.
For the message box it swaps the whole tilt, MainContent and Menu tags for its own. If your page keeps one of
these classes but must not be rewritten, write x:Class ="..." with a space before the =: the game still reads it,
Extra Options no longer matches it. More in chapter 3.
4.8 Cars
A car is a Data_Car row and its upgrade rows (4.5.1,
4.5.2), a zip media\cars\<MediaName>.zip and a line in
zipmanifest.xml. Everything about adding or converting one is in chapter 14; this section only points
there.
Car zips
There are 354 car zips in media\cars\, named by Data_Car.MediaName, with shared materials, paints and shaders in
media\cars\_library\ and media\_library\. Physics and handling are in the database, not the zip. What each entry
does, and what happens when it is missing or borrowed: 14.4 The car zip.
File formats in brief
Models, textures and materials are Grub bundles whose counts and Ids the game trusts; textures are Xbox One tiled and copied with no size check, so a wrong header draws garbage; glass needs TEXCOORD4 and TANGENT4. The car-specific rules are in 14.5 Models and the carbin and 14.6 Materials and textures (texture tiling under Textures); the byte layouts in chapter 10.
How a car loads (proved in code)
A scene state machine waits for the carbin, the skeleton and every model and material instance, and never marks one failed: a missing or unreadable modelbin or materialbin means an endless load, while textures and AO maps count a failure as done. Step by step: 14.2.
Ways to add a car
- Platform car packs (2.9.0 and later, the recommended way): Car packs.
- Extra Options car mods: Add-on cars.
- Cloning or converting a car by hand: the checklist in 14.1 Adding a car: the short path.
Removing cars is the risky part. A bought car is stored in the save by Id (Ids are forever); tell players to back up their saves before they remove one.
Car pitfalls
Crashes, endless loads, garbage physics, parts not drawn, silent engines and the rest, each with its cause and fix: 14.16 Pitfalls.
4.9 Tracks and the world
The two worlds
| Mainland | Storm Island | |
|---|---|---|
| Internal name | Anthem | Test03 |
Tracks.id | 542 | 549 (and 33 rows 549-1060 for its races) |
| Media | media\tracks\anthem\ | media\tracks\test03\ in the Storm Island DLC package |
| World name | anthemout | test03out |
| AI routes | media\openworld\anthem\aitracks\ | media\openworld\test03\aitracks\ in the DLC package |
The mainland is southern France and northern Italy. homespace02 is a small home-space (garage) scene. Tracks
also keeps about 50 Forza Motorsport tracks (Le Mans, Spa, Nürburgring, Bathurst, Top Gear...) with no media shipped;
Tracks.MediaName names a track's folder.
Tracks columns: id, names (string refs), MediaName, RibbonIndex, Length, start grid and flying start Ids,
IsHomespace, Active, EnvironmentId, QuickRaceLapCount, StartLine / FinishLine, Route, MediaTrack,
StrayWarningDistance, StrayTeleportDistance, UseCrossCountryAI and more.
Inside a world folder
media\tracks\anthem\ has 73 entries, about 26 GB:
| Entry | What |
|---|---|
GeoChunk0..19.minizip + ChunkMap0..19.dat, ChunkAssign.dat | streamed geometry (up to 4.2 GB a chunk) |
bin.zip | 32 MB, 4,910 entries: 645 .materialbin in Materials\, 4,197 Shaders\, 66 Animations\ (.gsf, .gr2 for animated scenery), AssetManifest.xml, build report |
ribbon_00\ | GameObjs.xml (gameplay objects: barn finds, boards...), CollObjs.xml (2.2 MB of breakable and collidable placements), AI.zip, PreRaceCams.xml, TrackSegCams.xml, TimeOfDay*.xml, anthem_00.imap, .nav (road nav for resets), .oww, .pvs, anthem_track_00.col, .crowd, anthemout_00.hex, instancetemplates, ParticleInstances.particlebin, aitracks |
trackroutes\*.nt | Route<n>.nt, IERespawns.nt, ParkingAreas.nt, bucket_challenges_startend_locations.nt |
triggerzones\tz_*\*.tz | barn finds, bucket challenges, car meets, cube-map scenes, dynamic post, fog disable, green light, race activations, rain zone, route joins, track limits, water reflection, weather chance, world constraints |
Lights_*.lightdb, .lightrtudb, .animlightdb | lighting |
PVSSamplePoints.bin, PVSZLookup.dat | visibility |
physicsdefinitions.bin, tracksettings.xml, ShowcaseEvents.xml, staticcarcubemap.xpr, tdaosettings.* | physics, settings, showcases, reflections, AO |
Anthem_ambience.xml, _reverb.xml, _soundbank_lookup.xml | world audio |
extras\Anthem.track | a scene XML of instances (cube-map probes and so on) |
RenameMap.txt, IntialInstallChunks.txt | build leftovers |
- The base Mount's
tracks\test03\has onlytriggerzonesandbuildNumber.txt. The DLC package has the island's 4 GeoChunks,bin.zip,ribbon_00,trackroutes, lights,Test03_*audio XML andaitracks. media\tracks\also holdsAnthemTrackSettings.xml,anthemunderground.zip,Test03underground.zipandanthemcubescenes.zip.- Maps:
media\ui\MapProfile*.xml(MapProfileHud,MapProfilePauseMenuand...Islandvariants) and tiled map pictures. The island profiles are chosen by track Id 549. - Smashables:
media\physics\SmashableObjectTypes.xml(Default, Fence, Mailbox, RoadClosedSign, TrashCan, LogPiles, FruitCart, FireHydrant, TargetTypeA) and the break effects inBreakEffects.xml. Procedural trees, fences and poles are world objects handled in game code; WreckingBall hooks the collision world to change them (see its README and chapter 6). - Scenery animation lives in
Animations\in a world'sbin.zip, with skeleton entries. FH2 has a flags shader for waving flags.
4.10 Audio
The files
media\audio\fmodanthem\durango\*.bankare FMOD Studio 1.x banks (FSB5 MPEG samples inside):
| Banks | What |
|---|---|
MasterBank.bank + MasterBank.strings.bank | the master bank; event paths resolve only through the strings bank |
PG_<engine>.bank (351) | engine sounds |
HZ2_SFX_* | UI, tyres, collisions, smashables, weather, traffic, crowds, cutscenes, ambient emitters (HZ2_SFX_EMT_*) |
HZ2_AMB_* | location ambiences |
HZ2_DX_*, HZ2_VO* | dialogue (ANNA, sat-nav) per language |
HZ2_MX_Radio_0N_Tracks.bank, _TracksLFE.bank | radio music |
HZ2_MX_Radio_0N_DJ_<LANG>.bank, _Expansion_DJ_<LANG>.bank, _Stingers_<LANG>.bank, HZ2_MX_Radio_3D.bank, Shared_Tracks.bank | DJs, stingers and shared tracks |
Voice and DJ languages: BR, DE, EN, ES, FR, IT, JP, MX, PL, RU.
media\audio\AudioBanks.xmllists the global banks to load (<Bank name=".." localised="true|false"/>).- Other XML:
AudioGlobals.xml(also has per-car entries),AudioCollisionInfo.xml,AudioPassbyInfo.xml,AudioSnapshotInfo.xml,AudioSurfacesInfo.xml,Ambience_Templates.xml,Reverb_*.xml,Placeable_Audio_Events.xml,Triggerable_Audio_Events.xml,SatNavConfig.xml,ui\UI4Audio.xml,ui\UISceneAudioMappings.xml,vo\DialogueScript.xml, andcars\<name>.xml(208 engine modulation files). - Game UI sounds can be played by event path, for example
HZ2_SFX_HUD_Notification_GenericOn_01.
Radio stations
The station lists are media\audio\RadioInfo_<LANG>.xml (10 languages, about 191 KB each):
<Radio>
<RadioStations>
<RadioStation Name="Horizon Pulse" Number="1" RecentlyPlayedListSize="-1">
<Playlist Type="FreeroamTracks">
<Entry EventName="/Master/Radio/Track" SoundName="HZ2_R1_Chromeo_ComeAlive" SampleLength="236936"
DisplayName=".." Artist=".." TrackStart=".." DJDrop=".." TrackDrop=".." TrackBreakDown=".."
StingerStart=".." DJStart=".." End=".." />
- Playlist types:
FreeroamTracks,EventTracks,Stingers,ShortStingers,DJ. Times are in milliseconds. - Seven stations: 1 Horizon Pulse, 2 Bass Arena, 3 Horizon XS, 4 Radio Levante, 5 Hospital Records, 6 Ninja Tune,
7 Innovative Leisure. Event names are
/Master/Radio/Track,/DJ,/Stingerand Levante's_Levantevariants; 1,000 entries in all. - The text is plain ASCII with a raw
&; this reader decodes no entities. - The DJ's lines are keyed by game events (weather, time of day, barn finds, road trips, races, wristbands). The game may end a song early to start the next with a DJ line, and it preloads DJ lines and idents about 2 s ahead.
- Station icons:
ui\textures\Anthem.zipHUD\HUD_RadioIcon_<Name>.swatchbin(196 x 96, BC7, tiled, premultiplied alpha).
At runtime the radio is the class RadioStreamFmod (vtable game+0x2E76220, 0x142E76220); each sample's
properties sit at sample +0x08 (sound name +0x00, event +0x20, display name +0x40, artist +0x60, length in ms
+0x8C). Changing what plays needs hooks: FH2 Universal Radio hooks the System::createSound call in
RadioStreamFmod::load (game+0x1018A13, 0x141018A13) and the Sound::getSubSound call in
RadioStreamFmod::start (game+0x10221F2, 0x1410221F2). The FMOD functions themselves are exported by name;
look them up that way. New stations also need the station-unlock check (stations are unlocked by name, from a list in the progress data) and
the step where the game moves to a random valid station before events (it picks from slots 1-8). Hook details are in
chapter 7.
Public examples:
- Radio Manager (github.com/Trinculo54/RadioManager): every folder
in
fh2-mods\RadioManager\becomes a station after the game's own. A station folder hasMusic\,DJ\(idents) andDJ\<moment>\(lines over music for moments such asweather_rain,barn_find_spotted,road_trip,wristband,finale), and anicon.pngfitted into 196 x 96. It levels tracks to EBU R128 and reads tags orTitle - Artistfile names. - FH2 Universal Radio (github.com/Trinculo54/FH2-Universal-Radio): takes over one station and streams other sources through the game's own FMOD radio.
Engine sounds
- A car's sound name is its engine's
Data_Engine.MediaName(orData_Motor.MediaName). The game runsSELECT MediaName FROM Data_Engine ... UNION ... Data_Motor(game+0x292840,0x140292840) and loadsmedia\audio\fmodanthem\durango\PG_<name>.bankif it exists. - Events are
/Master/PG_Cars/PG_<name>/PG_<name>_<group>, with groups Engine, Exhaust and Intake (classesAudioObjectEngineGroupEngineFmod,...ExhaustFmod,...IntakeFmod). They resolve only throughMasterBank.strings.bank, which knows 366 stockPG_names. So a new car must use a stock engine sound name, or it is silent. Share one with a similar engine. - A bank holds fixed-rpm loops (
Engine_05357,Exhaust_...,Intake_...), backfires, burbles, turbo, supercharger, blow-off, shifter, damage and whine. The group parameters copied each update include EngineRPM, Throttle, ThrottleDelta, Pos/NegTorque, Boost, ClutchPosition, gear, gear ratio and TurboRPM. - The bank manager keeps one bank per lower-cased path; the same bank under a second file name fails to load, silently. Cars that share a sound name share one loaded bank.
- An engine-sound mod can swap a car's event name, or insert FMOD DSPs at runtime: the FMOD low-level API is exported
by name (for example
System::getMasterChannelGroup,game+0x1998C90,0x141998C90). Channel groups are freed on the upgrade screen. The exe also holds an unused "PG Engine Synth" FMOD DSP (FMOD_PGEngineSynth_GetDSPDescription,game+0x102D000,0x14102D000).
4.11 Saves (read only)
Never write to a save from a mod, and never tell players to edit one. Read saves only, and only revisions that are complete. The rest of this section is for reading.
Why: Azimuth checks the hash and size of every file, the game holds saves open, a bad write loses the player's
progress, and the Ids in a save (cars, fitted parts) must keep matching the database. A mod that needs a copy of the
saves uses the platform's request_save_snapshot (API 9), which copies them to fh2-mods\save-snapshots\
(chapter 2).
Layout
Saves are in <Azimuth>\data\titles\1A96545B\saves\player-1\. Every save item is a container folder
<Kind>_<...>\revisions\<16 hex digits>\ holding a commit file and a data\ folder.
The commit file is text:
Azimuth complete save revision v2
blobs N
<sha256> <size> <name>
...
one line per file in data\. A reader must take a revision only when every file matches its line; a
half-written revision is never used. The game writes a new revision every few minutes and keeps the last two.
| Container | Files in data\ | What |
|---|---|---|
User_<id> | SaveState, ProfileData, PlayerDatabase, BinarySaveState, VersionFlags | the profile |
BaseLivery_<carId4>_<stamp> | C_livery, header | a car's plain paint (never draws layers) |
Livery_<carId4>_<stamp> | C_livery, header, bigThumb.png, smallThumb.png | a vinyl design |
LayerGroup_<n>_<stamp> | C_group, header, thumb.png | a saved vinyl group |
Tuning_<carId4>_<stamp> | Data, header, Thumb.png | a tune |
GarageThumbnail_<carId4>_<stamp> | bigThumb.png, smallThumb.png | garage pictures |
The profile's files
SaveStateis XML: an<ObjectDictionary>of<Object Id=".." Type="..">with<Property Name=".." Value=".."/>. Object types includeCareerState(ActiveCareerLocation,WonFirstFinal...),BarnFindState(barn_find_01..10and Storm Island'spdlc_barn_find_01, State "Collected" or "Restored"),BucketListState/BucketListSlotState,DiscountBoardSaveState,DialogueSaveState,RadioState(the active station, by name),ChampionshipDrivatarsState,PlayerState,ForzaEconomyState,SkillsState,RoadDiscoveryState,TombolaState,GameTimeState,IESaveState/IslandIESaveState,CameraState.ProfileDatais a binary tree:ssmc, u32 payload size, u32 root count, then nodes of u32 name length, name,20 00 00 00 00, u32 type, value. Types: 15 group (u32 child count), 0/1 byte, 3/7 int32, 4 uint64, 9 float, 12 string (u32 length + UTF-16). It holds stats and options (for exampleOptions/MinorNotifications).PlayerDatabaseis an 8-byte header (ssmc+ u32) followed by a SQLite database. Its tables match the game database'sNewProfile_*templates:Career_Garage(Id, CarId, PI, class, ratings, livery file name...),Career_PurchasedParts(GarageId, PartEnum, PartId...),Career_EventResults,Career_RaceResults,Career_ChampionshipsCompleted/Won,Career_ChampionshipStandings/History,IslandCareer_*,Career_EventUnlock,Career_DestinationUnlock,BarnFinds(CarOrdinal, State),BucketListProgress(ChallengeId, Completed, CompletedCoop...),PhotoCaptures(CarOrdinal),PerkUnlock,BadgeTitleUnlocks,ChangeTracking,FreeCars,LastUsedGarageId.
A worked reader
The Achievements mod (github.com/Trinculo54/fh2-achievements,
src/save_reader.cpp) is a complete read-only reader:
- Find the
User_*folder (skip copies such asUser_<id>.fresh-...). - Pick the newest revision whose files all match
commit. - Copy
PlayerDatabaseminus its first 8 bytes to a temporary file. - Open that copy read-only with SQLite, and parse
SaveStateas XML.
Never open the save's own files for writing, and never hold them open.
4.12 Liveries and vinyls
Shapes and projections
- Shapes are in
media\Livery.zip(Vinyls\*.modelbin: 1,480;Decals\: 940 including swatchbins), indexed by the database'sLivery_VinylsDecals.ID(withLivery_Categories,Livery_Decalsand the sort tables). - Each car zip has
LiveryMasks\Masks.xmlwith one element each for Front, Back, Top, Left, Right and Wing (attributesvalid,xorigin,yorigin,top,bottom,left,right,xAxis,yAxis,xScale,yScale,rotation), in livery-atlas pixels from the atlas centre, y up. The masks are BC4, 1024 x 1024. The livery UV is TEXCOORD3; windows take no livery.
A design on disk
This is how the game stores a design; it is here so tools can read designs, not write saves.
Livery_<car>_<stamp>\...\data\C_livery: u32 packed size, u32 size, then a zlib stream.- Chunks have reversed tags (they read
vlrc,yrvl,gyvlin the bytes):crlv: u32 version 1, a u32 lock flag at raw +8 (1 = someone else's locked design, 0 = your own), u32 car Id, factory colour index;- four
lvrychunks, the first holdinglvyg; lvyg: six side groups, Front, Back, Top, Left, Right, Wing.
- A group: f32 x, y, scale, rotation; u8 flags; u16 child count; u32 mask size; an is-group bitmask; then the children.
- A layer is 31 bytes: u8 1, u16 shape, f32 rotation, x, y, scale x, scale y, skew, then B, G, R, A. The first child is the bottom layer. The format has no mask layers or mirrored groups.
header: name (UTF-16), SYSTEMTIME, type (3 design, 4 base livery), creator, layer count, car Id.- Applying a design creates the
Livery_entry, removes the car'sBaseLivery_entry and setsCareer_Garage.LiveryFileName. - Newer Forza titles use a closely related layout (11 side groups, 32-byte layers with a mask byte), so designs can be converted.
Editing a design in memory
A livery tool can work without touching files: it edits the editor's live objects while the player has the vinyl group editor open, and the player then saves as usual, so the game writes the save itself.
| What | Where |
|---|---|
CLiveryLayer vtable | game+0x2EB02D8 (0x142EB02D8) |
CLiveryGroup vtables | game+0x2EB0460 (0x142EB0460) and game+0x2EB05F8 (0x142EB05F8) |
| group's children vector | group +0x78 |
| layer position, scale, rotation, skew | +0x18, +0x28, +0x50, +0x70 |
| layer colour (RGBA) | +0x74 |
| layer shape Id (u16) | +0x78 |
| "changed" flag | bit 0 of +0x58 (what the game's setters set) |
SetShape | game+0x1231A60 (0x141231A60); also drops the cached mesh at +0xA8 |
A shape written directly, without SetShape, shows only after the design reloads. Find objects by vtable and check
them before every write: the editor frees them when it closes (chapter 5).
4.13 Skies, weather and time of day
Skies
media\Sky.zip holds:
CloudDefinitions.xml: cloud layers (Cirrus, Summer, Threatening, Stormy) with speed and render order;CloudScapes per weather naming texture sets (CloudyA = Cloud5 + Cirrus1, CloudyB = Cloud6 + Cirrus2, CloudyFog = Cloud7);Animationfades between scapes.- Texture sets
Clouds\<set>\: Cirrus1, Cirrus2, Close1, Cloud5, Cloud6, Cloud7, StormCloud, StormCloud1, StormCloud2. Moons\Moon0-4.swatchbinandStarCatalogue.bin.
A cloud set is four textures: AlphaDiffuse.swatchbin (R alpha, G brightness), FadeDensity.swatchbin,
TopBottomLight.swatchbin (BC5) and CloudShadow.swatchbin (BC4).
- FH2 has no photo sky.
RealtimeSkydraws the sky and sun and lights these layers, so a sky photo from another game carries over only as cloud shapes, not colours. - Stock Cloud5 is a 1536-row panorama with the horizon near row 1280. The game draws it mirrored left to right.
- Replace a set with loose files at
mediaoverride\Sky\Clouds\<set>\<file>.swatchbin, or withset_file("Sky/Clouds/<set>/<file>.swatchbin", ...), a whole set at a time. - The textures must be encoded and Xbox-tiled like the stock ones (4.8). BC6H sources need a float decoder.
Weather
media\weather\Presets.xmlandPresets_Island.xml:<Preset name severity cloudScape lighting>and<AllowedTransition preset1 chance preset2>(Clear to CloudyA/B to ThreateningStorm... to StormB...; the island uses StormTropical). Override these files to change how weather moves in free roam.- The database's
WeatherPresetIds 0-13 pick these presets for events (4.5.7). - In the world, the
tz_weatherchanceandtz_rainzonetrigger zones play a part. - An Extra Options add-on gives pause-menu time and weather controls (chapter 3).
Time of day and post effects
media\timeofday\TimeOfDay*.xml: bloom, motion blur, depth of field and desaturation keyframes.media\timeofday\xboxone\*.fxb: TimeOfDay, TimeOfDay_island, Garage, Hub, AutoShow, Homespace.media\dynamicpost\Presets.xml, each world'sribbon_00\TimeOfDay*.xml, and the database'sEnvironmentTimeOfDay.
4.14 Other data worth knowing
| File | What |
|---|---|
media\physics\PhysicsSettings.ini | global physics tunables as Key value lines: TimeScale, CarGravityScale, AirbornGravityScale 1.15, TCS and ABS thresholds... |
media\physics\surfaceTypes.xml | 1.2 MB of grip per surface |
media\physics\PI.xml | the PI calculation |
media\physics\suspension\*.xml | FiveLink, ModernWishbone, OffroadTrailingBeam |
media\cars\CarAttribs.xml, cars\_library\GlobalCarAttributes.xml | damage scalars and part-drop values |
media\unlocks\UnlockRules.xml | badge and title unlock rules: <Rule name type targetValue> with <Unlock type="BadgeTitle" unlockId=..> |
media\GameTunableSettings.zip | XP levels and wristbands, skills (Skills.xml, SkillChainXPRewards.xml), race feats, ANNA recommendations, collidable presets, hero-drive times and weather, option presets |
media\ThumbnailCamSettings.xml | 131 KB: the thumbnail camera per car |
media\Particles.zip, media\fxparticles\xboxone\ | particle systems |
media\drivers\*.zip | driver models, with the DriverModels table |
4.15 The Azimuth folder and the logs
What a mod sees next to azimuth.exe
<Azimuth>\
azimuth.exe
d3dcompiler_47.dll FH2 Mod Platform (the name Azimuth up to 1.0.2 loads)
DWrite.dll the same platform DLL (the name Azimuth 1.0.3+ loads)
winmm.dll Extra Options (optional), with FH2_ExtraOptions.ini / .log / .dat
Gamerpic.png the avatar, when Extra Options' [Profile] CustomGamerpic=1
mods\ Extra Options mods: <name>\mod.json (+ media folder, plugins), loadorder.txt
fh2-mods\ platform mods: <Mod>.dll, <Mod>.ini, <Mod>\ data folders, platform files
fh2-cars\ platform car packs (2.9.0+): <pack>\pack.ini ...
data\
azimuth.ini UTF-16: [launcher] (player name, graphics, wheel), [title-1a96545b] folder=, content=
logs\azimuth.log, *.dmp Azimuth's own log and crash dumps
bin\, cache\ Azimuth runtime
titles\1A96545B\
saves\player-1\... the saves (read only, section 4.11)
tmp\ the game's T:\ drive (persists): Turn10Temp.scratch, and from platform 2.9.0:
fh2-platform\media\ the platform's per-Azimuth layer: set_file files, string tables
(Stripped\StringTables\<LANG>\<table>.str), the built gamedbRC.slt,
the merged zipmanifest.xml, the MODS tab pages; read ahead of mediaoverride
fh2-platform\packs\<pack>\ hard-linked car-pack media
fh2-platform\eo-media\ with Extra Options: packs' database, car names, zipmanifest
art\ Azimuth art cache
Extra Options is loaded only as winmm.dll next to azimuth.exe (Azimuth 1.0.4 doesn't load it from mods\).
Where the platform writes
| Setup | Where set_file, strings and the database go |
|---|---|
| Extra Options loaded | <Mount>\mediaoverride (shared by every Azimuth folder on that game folder) |
Azimuth 1.0+ without Extra Options, with data\titles\1A96545B\tmp\Turn10Temp.scratch present | the platform's own layer (the first session on a fresh folder still uses mediaoverride) |
FH2MP present (an fh2mp folder) | the database stays in mediaoverride for online play |
So use set_file and override_root(); never hard-code mediaoverride (chapter 2).
The platform's own files in fh2-mods\:
| File | What |
|---|---|
platform.log | the main log; rewritten every launch (and Azimuth can start the game twice in one launch) |
platform-logs\ | older logs |
crashes\crash-*.txt | crash reports |
save-snapshots\ | copies made by request_save_snapshot |
platform-files.txt, platform-tables.txt | what it wrote and where (mediaoverride, layer or both) |
platform-db.txt, platform-db-base.slt, platform-db-base.previous.slt, platform-db-fh2mp.txt | the database build, and other mods' databases it built on |
platform-car-ids.txt, platform-pack-cars.txt, platform-eo-packs.txt | car-pack Ids and packs |
platform-mods.txt, platform-disabled.txt, platform-language.ini, platform-session.json | mods, switched-off mods, language, session |
platform-old-overrides\ (+ moved.txt) | old override files it moved aside |
With Extra Options, [Files] EnableMediaOverrides=1 in FH2_ExtraOptions.ini must be on for mediaoverride to be
read. Its other keys are in chapter 3.
Logs to collect when something breaks
| Log | Where |
|---|---|
| the platform | <Azimuth>\fh2-mods\platform.log |
| your mod | its own log in fh2-mods\ |
| crashes | <Azimuth>\fh2-mods\crashes\crash-*.txt |
| Extra Options | <Azimuth>\FH2_ExtraOptions.log |
| Azimuth | <Azimuth>\data\logs\azimuth.log |
Copy them straight after the run: they are rewritten every launch. Chapter 10 lists the crashes seen so far and their causes.
