Navigation
Browse the developer docs

FH2 Modding Guide · Chapter 11

Game structures

You need an object's layout: game manager, cars, cameras, input or the STL.

By Trinculo54 · from the FH2 Modding Guide · CC BY 4.0 · copied 4 Dec 2026 · read the original, which may be newer

On this page

This chapter maps the core objects a mod usually needs: the global roots, the game manager and simulation, views, cars, car physics, cameras, input and render, and the STL layouts the game uses. System-specific objects (collision and procedurals, the radio, weather, the HUD's pages) are in the hook chapters, each ending with its own "Structures and offsets" section.

All addresses are for forza_durango_release_final.exe of 24 Nov 2015 (TimeDateStamp 0x565501ED), image base 0x140000000. Vtables and globals are given at that base; under Wine or Proton add the load delta.

11.1 Finding things yourself

  • RTTI: for an object o, vtable = *(void**)o. vtable[-1] is the MSVC CompleteObjectLocator; its +12 holds the RVA of the type descriptor, whose name starts at +16 (.?AVForzaCar@@). Checking this is the most reliable way to confirm an object's type before trusting it.
  • Vtables move between interfaces. Several objects hand out a pointer into the middle of themselves (car physics below). Fields can then sit at negative offsets from the pointer you hold.
  • Objects are replaced and freed. The car's physics pointer changes when a simulation restarts, and world objects are freed as areas stream. Re-read pointers each frame from a stable root, check the vtable, and read through guarded copies (chapter 5).
  • Offsets below are as the released mods use them. Where a mod relies on one, it byte-checks the code that reads it. Do the same.

11.2 Roots

GlobalTypeNotes
0x1434ABA60CForza* (vtable 0x142C47AE0)the game. +0x48 CGameManager (getter 0x14021DFC0), +0x460 the entity world
0x14365D7C8CControllerManager* (vtable 0x142E7A2E8)input, see 11.8
0x14354F4F8App*[App]+0x28 is the render thread, see 11.9

11.3 Game manager and simulation

CGameManager (vtable 0x142C5F8C8):

OffsetTypeMeaning
+0x28bytespaused flags
+0x40doublegame clock (getter 0x140FBCC50)
+0x48floatgame speed. Set it with SetGameSpeed (vtable slot 17); the call itself stores here
+0x78components
+0x98ForzaSimulation*getter 0x1402E1520

ForzaSimulation (vtable 0x142C5FAE0):

OffsetMeaning
+0x10ICinematicSim (vtable 0x142C5FCC0)
+0x2D0, +0x2D8the views
+0x30Ccar-control value
+0x328CPhysicsWorld
+0x3CCrender mode (setter 0x140FAF8B0)
+0x480time of day
+0x488weather

Views: SplitView (0x142C66188), SimulationView (0x142E6F570) and MultiCamView (0x142E6E890). In a view, +0x20 is the car it follows and +0x40 its camera director (+0xC0 the director in a MultiCamView). Vtable slot 9 is SetRacingLineMode.

CPhysicsWorld (vtables 0x142EB46E0 / 0x142EB5C00): GetWorldBounds is slot 0xE0 (0x1412C5290). The bounds cache flag is at +0x205E8, the box at +0x205C0/+0x205D0, the sections at +0x20080.

11.4 Cars: ForzaCar

Vtable 0x142C5CB80, RTTI .?AVForzaCar@@. Every car in the world is one: the player's, AI, traffic and remote players'.

OffsetTypeMeaning
+0x4C08ptrcar physics interface (CCarDynamics, getter 0x140F605D0)
+0x4C58objcollidable request set (getter 0x140F60510); a std::list at +8
+0x4D08int32kind: 0 local player, 1 AI, 2 traffic, 3-5 remote players (getter 0x140F62280)
+0x4D38ptrpresentation wrapper; its vtable +0x130 SetAlphaScalar, +0x228 ShowCar, +0x230 HideCar
+0x50F1u8cleared by HideCar
+0x5370objreplay component; its first pointer is the car (only once loaded)

Vtable slots and functions:

Slot / addressWhat
slot 0x80 → 0x1402A9400per-frame update (car, dt, b, d). Hooked by several mods: chain it (chapter 5)
slot 0x130 → 0x14028D930apply collidable state
slot 0 → 0x14028B380deleting destructor, calls ~ForzaCar 0x140289320: drop notes about the car here
0x14028C590alpha float(self, ForzaCar**)
0x14028D350ShouldStartGriefing, the anti-griefing check (chapter 12)

Filter by kind before acting on a car: a hook on a shared function sees AI, traffic and remote cars too. WreckingBall once slowed AI cars because a pole hit read a car without checking its kind.

11.5 Car physics: CCarDynamics

Vtables 0x142EB4BB8 and, ref-counted, 0x142EB5E18. car+0x4C08 points at an interface inside the object, so the transform sits at negative offsets from it. Re-read car+0x4C08 every frame: 0x140FAABE0 swaps it when the simulation restarts.

FieldWhereGetter / setter (vtable offset)
position (vec4)dyn-0x3900x1412CD150 (+0x270); SetPosition (+0x280)
rotation rows right, up, forward (3 vec4)dyn-0x3800x1412CBEB0 (+0x2E0); row 2 is forward
velocity (vec4)dyn-0x3500x1412CDCF0 (+0x288); SetVelocity 0x1412E3CF0 (+0x290)
angular velocity, world (vec4)dyn-0x3400x1412C5C90 (+0x2B8); SetAngularVelocity 0x1412DD910 (+0x2C0)
engine speed / redlinedyn+0x148 / dyn+0x1CC0x1412C8050
gear (u8)dyn+0xAA10x1412C7CF0
controlsdyn+0xDF80x1412CBEF0

Prefer calling the setters to writing the fields: the physics keeps derived state the setters update.

11.6 Cameras

CMultiCam (vtable 0x142E70080) and its subclass ForzaMultiCam (0x142C6C840) direct the cameras. View 0's director is at view+0x40.

OffsetMeaning
+0x188camera list, 64-byte entries
+0x1B0-+0x1D0camera-index std::deque<int> (map +0x1B8, map size +0x1C0, offset +0x1C8, size +0x1D0)
+0x1E8target car
+0x1F0player link
+0x208active camera
+0x219cut flag (u8)
+0x220-+0x2C7view 0's camera cache
+0x2C8(ForzaMultiCam) camera taken by the rolled-over check, -1 if none; +0x2CC its timer
FunctionWhat
0x140FE61C0PostUpdate: the place to take over the camera each frame
0x140FE5780SetActiveCamera (mc, int)
0x140FE2AE0GetCurrentIndex
0x140FE2F60near-clip forwarder (slot 40)
0x1403986A0rolled-over check (ForzaMultiCam slot 80): switches to the chase camera when the car is upside down

Camera indices: 0 FollowCam, 1 FollowCam2, 2 DriverCam, 3 Hood, 4 BumperHigh, 12-14 others, 16 PhotoMode, 17 RearView. Other camera classes: CCamPhotoMode (0x142C6C578), CinematicGameCamera (0x142F3BAD0). More in chapter 8.

11.7 HUD notifications and achievements

AddressWhat
0x14073E0B1, 0x14073F046HUDMinorNotificationComponent constructor and destructor (instruction sites; shared)
+0x128+0x18the component's TemplateName
0x140755330Show (call it; never hook it)
0x140323310MakeDisplayString (call it; never hook it)
0x1403FCD60AchievementsModule update (vtable +0x20); its tick site 0x1403FCD84 is shared
0x1402F7940profile SetStat
0x141DD0060EtxEventWrite import slot (telemetry events, EtwPlus.dll)

On the platform, use its pop-ups (fh2mod_ui.h) instead of driving these yourself.

11.8 Input

  • CControllerManager is the global 0x14365D7C8 (vtable 0x142E7A2E8). Update 0x141075490, ReadPad 0x14106C320.
  • Each controller keeps its copy of the pad state at +0xBC; +0xAB28 is the pad used last.
  • The input context stack: Push 0x141073090, Pop 0x141072F60 (a deque at +0x38).
  • 0x1410768D0 ("release taken controls") belongs to the platform's pad layer: don't hook it.

On the platform, take buttons through the pad layer or hotkeys rather than hooking input. Which buttons the game already uses (RB changes camera, Y rewinds) is in chapter 8.

11.9 Render

  • [0x14354F4F8]+0x28 is the render thread (CRenderThread, vtable 0x142C65028); its depth-of-field block is at +0x590-+0x5B8.
  • The render mode setter is 0x140FAF8B0. Photo mode switches to its own render settings, which keep the player's car on its top level of detail; the driving settings hold it one level down (CarFocusLODMinMax min 1).

11.10 The game's STL (MSVC 2012)

The game was built with Visual C++ 2012 and its STL, MSVCP110 (15.6). Its containers are laid out like this (x64). The sizes and the offsets marked compiler were read back from code built with a compiler of the game's own build; the rest were found in the game.

TypeSizeLayout
std::string0x2016 bytes inline text or a pointer; size at +0x10; capacity at +0x18; inline while capacity < 16
std::wstring0x20as std::string, inline while capacity < 8
std::vector<T>0x18three pointers: first, last, end of storage
std::shared_ptr<T>0x10{ptr, ctrl}; the control block has uses at +8, weak references at +0xC; its vtable slot 0 is _Destroy, slot 1 _Delete_this
std::unique_ptr<T>0x8the pointer
std::list<T>0x10sentinel node pointer at +0, size at +8; in each node next at +0, prev at +8, value at +0x10
std::map<K,V>, std::set<K>0x10head (sentinel) node pointer at +0, size at +8 (compiler)
std::deque<T>0x28iterator proxy pointer at +0, then map +8, map size +0x10, offset +0x18, size +0x20 (compiler); four ints a block
std::unordered_map<K,V>, std::unordered_set<K>0x40a std::list of all elements at +0 (size at +8), a std::vector of bucket iterators at +0x10, mask at +0x28, bucket count at +0x30, max load factor (float) at +0x38 (compiler)
std::function<F>0x20inline storage, then the pointer to the callable's wrapper at +0x18 (null when empty) (compiler)
std::mutex, std::recursive_mutex0x8a pointer to the runtime's mutex (compiler)

Functions that take a std::string by value free it themselves. Build such a string with the game's allocator (operator new at 0x1403229C0), on a game thread, or the game will free memory it doesn't own.

“The FH2 Modding Guide” by Trinculo54 is licensed under CC BY 4.0; its code samples are under the MIT licence. This page is an unchanged copy (links point to this site) of 11-structures.md at commit bb10508; corrections belong in the original repository.