Skip to content

fix: Halo 3 and ODST split screen - bodies stay drawn when they pile up - #39

Merged
megabitt01 merged 2 commits into
megabitt01:master-chieffrom
kirklandsig:upstream/halo3-skinning
Oct 29, 2026
Merged

megabitt01 merged 2 commits into
megabitt01:master-chieffrom
kirklandsig:upstream/halo3-skinning

Conversation

@kirklandsig

Copy link
Copy Markdown

Halo 3 and ODST had the same "too many bodies" bug as Reach (#35): with lots of characters in one place in 4-player split screen, the later views draw characters and first-person weapons black, over-bright or not at all. It's the same per-frame skinning pool, only smaller, and this moves it to a bigger buffer the same way.

Cause

  • Every skinned object drawn in a frame, in any view and again for shadows, takes its bone matrices from one pool of 0x29000 bytes (168 KB, smaller than Reach's 0x35C00):
    • Halo 3: pool at halo3+0x4680DC4, allocator at 0x2A84F8.
    • ODST: pool at halo3odst+0x46AC274, allocator at 0x2CCFBC.
  • Each object asks for nodes x 0x30 + 0x44 bytes. When the pool is full the allocator returns -1, and that object is drawn without its bones. The views are drawn in order, so the last ones lose first.
  • The handle is the plain byte offset (& 0xFFFFFFF wherever it's read). Reach puts frame bits in its handle; Halo 3 doesn't.

Fix (src/mcc/module/entry/halo3/skinning.cpp, one file for both games since they share the engine)

  • When the DLL loads, a 4 MB buffer is allocated within 2 GB after the module.
  • Every lea reg, [rip + pool] is pointed at the buffer: 7 in Halo 3, 6 in ODST. Each is a user followed by its handle's and, plus one startup memset. Then the allocator's cmp edx, 0x29000 is raised to 0x400000.
  • The 28-bit handle already covers 4 MB, so there's no shift or mask to widen, unlike Reach.
  • Writes go in that order (leas first, limit last) and are put back last-first in unload_module, while the DLL is still mapped. Each game keeps its own writes, because MCC has both DLLs loaded at the main menu.
  • A build that doesn't have exactly this layout is left alone: the limit, the 28-bit handle, and the counts of users and leas are all checked.
  • Statically checked against MCC 1.3528: nothing else in either DLL points into the pools, neither RIP-relative nor through relocations.

Testing (MCC 1.3528, Steam under Proton, Sierra 117 / Prepare to Drop at 4 players). The probe read the pool's used count and high-water mark from game memory.

  • Before the fix:
    • I spawned 30 ODSTs and 20 Marines with our fork's spawn menu.
    • The high-water mark pinned at 0x29000, the limit.
    • Players 3 and 4 lost their first-person weapons, while players 1 and 2 kept theirs.
  • With the fix:
    • Both pools are logged as moved.
    • With the same pile, a frame used 0x392E4 bytes, more than the stock pool holds.
    • Player 3 drew its weapon and every Marine, and player 4's death camera drew the whole pile.
  • Reloads: after Save & Quit, a second Halo 3 load in the same MCC process moved the pool again at the module's new address.
  • ODST: it played at 4 players on its moved pool.
  • Build: clean on current master-chief (2c66a60).
  • Codex adversarial review: one medium finding, left as is. If a write fails during the install and putting the bytes back also fails, some users would read the old pool and others the new one. That needs two VirtualProtect failures on the module's own code in a row, and the result is wrongly skinned models for that session, not a crash (both buffers are at least the stock size). Reach's pool fix in fix: Reach split screen - bodies stay drawn, side-by-side HUD centred; patches saved off stay off #35 handles it the same way.

Doesn't depend on any open PR. #38 changes CModule.cpp and the offset headers too, so whichever goes in second needs a small rebase, and I'll do it.

🤖 Generated with Claude Code

Halo 3 and ODST give every skinned object drawn in a frame its bone
matrices from one 0x29000-byte per-frame pool, the same allocator as
Reach's (megabitt01#35) in a smaller pool. With four views and a pile of bodies it
runs dry and the later views draw characters and first-person weapons
black, over-bright or not at all. Move it to a 4 MB buffer: point its
users' leas at the buffer and raise the allocator's limit. Handles are
the plain byte offset (28-bit mask), so nothing else changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kirklandsig added a commit to kirklandsig/AlphaRing that referenced this pull request Oct 28, 2026
…pile up

Halo 3 and ODST share one 0x29000-byte per-frame skinning pool across all
views, the same bug as Reach's. Once it fills, the later views draw
characters and first-person weapons black, over-bright or not at all. The
pool is moved to a 4 MB buffer near the module: its leas are redirected and
the allocator's limit raised, then put back at unload. Same fix as upstream
megabitt01#39.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@megabitt01
megabitt01 merged commit 3c5520b into megabitt01:master-chief Oct 29, 2026
1 check passed
@kirklandsig
kirklandsig deleted the upstream/halo3-skinning branch November 20, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants