8.7 KiB
Collision System Port - Status and Plan
2026-07-31 placement checkpoint 2
Runtime now owns the retail collision-report state required by canonical
SetPosition: exact-incarnation object-contact tables, the environment latch,
ordinary/ethereal expiry, force-end ordering, asymmetric object/environment
report eligibility, missile-state clearing, reentrant ordered reports, and the
report-result boolean which distinguishes failed-placement Collided from
NoValidPosition. Successful dormant SetPosition commits reporting after
contact/ground state and before its one response plus shadow reflood. The
named-retail oracle and next-agent instructions are in:
docs/research/2026-07-31-runtime-set-position-collision-reporting.mddocs/research/2026-07-31-runtime-set-position-collision-reporting-handoff.md
This checkpoint deliberately does not activate production placement. Next, 4B2 must prepare exact authored movers and land one atomic Runtime body/local- controller transaction, followed by presentation-only host projection, collision-prefix quiescence, and an all-route cutover. AP-1 and AD-1 remain open until that cutover; AP-22 and AD-10 remain later campaign slices.
Current State (2026-04-29)
The collision system is no longer a pure placeholder and should not be treated as "delete everything and start over." A partial retail transition port exists:
PhysicsEngine.ResolveWithTransitionis the active player movement resolver.BSPQuerycontains a partial retail-style BSP dispatcher.TransitionTypescarries the activeSpherePath,CollisionInfo, transition, step, contact, and partial slide logic.PhysicsDataCacheloads GfxObj, Setup, and CellStruct physics data.- Landblock streaming never edits the live collision world incrementally.
PreparedLandblockCollisionGenerationowns an off-side cache, CellGraph, engine snapshot, buildings, statics, and versioned retained-owner refloods. Retained means every non-suspended dynamic or adjacent-root static touching (or withdrawn from) the target prefix; only authored target-root statics are superseded. Stable per-prefix owner slots bound capture independently of unrelated movement. One Runtime-scoped versioned journal records a live mutation once, coalesces repeated changes by owner, and lets every draft reconcile only that owner's latest exact state one owner per seal step. Relevant owners subscribe only after discovery, preserving exact continuous updates without the former preparations-by-mutations global fanout or a quiet frame. A changed prefix routes first target entry/departure to the one matching draft after its journal cursor has passed. During topology build, visited unrelated owners receive only coalesced dirty notifications; one later seal unit performs the exact mirror. After the topology seal exists, observed owners temporarily write through exactly until same-call activation, guaranteeing that the finite dirty queue drains under multi-owner motion. Old slots are superseded at the tail rather than reused behind live cursors, new drafts start at their captured suffix, and obsolete slots plus empty prefix containers are reclaimed under churn. Admission captures the active aggregate root reference in O(1), then stable landblock/owner suffixes materialize the non-target cache, CellGraph, engine, and shadow leaves one work unit per host step. All scans and replacement construction run through bounded preparation/capture/seal cursors. Cache, CellGraph, engine, and shadow topology share one complete off-sideCollisionWorldState; final activation is a single zero-allocation volatile root transfer that preserves borrowed facade identities and revokes staging. Deterministically ordered concurrent preparations queue their deltas into later drafts only after commit; each seal call rebases at most one cache/graph/landblock/owner leaf. Demotion or withdrawal cancels matching queued/active rebases, suppresses stale source- clone leaves, and retires one owner/cache/graph/outdoor leaf per seal step from growable storage; commit rechecks pending retirement after sealing. The host performs the zero-work root transfer in the same update-thread call that completes final reconciliation, avoiding a quiet-frame requirement. Cancellation tears down only the named staging generation. The old generation remains queryable until commit. Seedocs/research/2026-07-31-atomic-collision-generation.md. ShadowObjectRegistrygives the resolver a broadphase over nearby objects.TerrainSurfaceuses triangle-aware terrain contact.
This foundation is useful, but it is not complete retail collision parity. The project now tracks the remaining work as Phase L.2 - Movement & Collision Conformance:
- Plan:
docs/plans/2026-04-29-movement-collision-conformance.md - Roadmap owner:
docs/plans/2026-04-11-roadmap.md - Tactical follow-ups:
docs/ISSUES.md#30-#34
Durable Lesson
Do not guess at AC physics, movement packets, terrain/cell ownership, or collision constants. The previous patchwork failures came from simplified approximations:
- static overlap instead of swept-sphere transition behavior
- custom object collision instead of retail
CSphere/CCylSphere - incomplete BSP dispatch
- ad-hoc push-out instead of retail slide / edge / precipice handling
- server "no rubber-band" treated as proof of local collision correctness
The named retail decomp is now the primary source. Search
docs/research/named-retail/acclient_2013_pseudo_c.txt by class::method
before using older decompiled chunks or reference repos.
Active Approach
Continue by conformance lanes rather than rewriting blindly:
- Truth & diagnostics (L.2a). Add local placement/contact/cell, object-hit, outbound-packet, server echo, and correction-delta probes.
- Movement wire/contact authority (L.2b). Fix contact byte and full-cell truth before using ACE acceptance as evidence.
- Transition parity (L.2c). Port edge-slide, cliff-slide,
precipice-slide, step-up/down slide, and
NegPolyHitdispatch. - Shape fidelity (L.2d). Finish
CSphere/CCylSpheresemantics, live-entity shapes, and building object identity. - Cell ownership (L.2e). Port
CELLARRAY,find_cell_list,check_other_cells,adjust_check_pos, low-cell updates, andcell_bsp. - Real-DAT and live observer conformance (L.2f). Promote every synthetic case to real-world fixtures and retail-observer checks.
What To Preserve
CollisionPrimitives.cslow-level helpers, while auditing remaining shape gaps against named retail.PhysicsDataCache.csDAT-backed collision data loading.ShadowObjectRegistry.csbroadphase concept.TransitionTypes.csdata structures and partial transition port.BSPQuery.cspartial dispatcher as the current porting surface.PhysicsBody.cs,MotionInterpreter.cs, andPlayerWeenie.csfoundations.
Known Gaps
- Full
CELLARRAYand adjacent-cell ownership are missing. cell_bspis not yet a first-class runtime owner.- Building portal transit and building entry/exit collision are incomplete.
edge_slide,cliff_slide,precipice_slide, andNegPolyHitbehavior are incomplete.- Live entity shape fidelity is simplified.
- Outbound movement contact/cell fields can be overconfident.
- Routine local/server correction diagnostics are missing.
Retail Anchors
Primary:
docs/research/named-retail/acclient_2013_pseudo_c.txtdocs/research/named-retail/acclient.hdocs/research/named-retail/symbols.json
Key names:
CTransition::find_transitional_positionCTransition::transitional_insertCTransition::step_upCTransition::step_downCTransition::edge_slideCTransition::cliff_slideSPHEREPATH::step_up_slideSPHEREPATH::precipice_slideSPHEREPATH::adjust_check_posCTransition::check_other_cellsCObjCell::find_cell_listCPhysicsObj::is_valid_walkableCBuildingObj::find_building_collisionsCCellStruct::sphere_intersects_cellCCylSphere::intersects_sphereCSphere::intersects_sphereCSphere::slide_sphere
Older fallback:
docs/research/decompiled/chunk_00530000.cdocs/research/decompiled/chunk_00500000.cdocs/research/acclient_function_map.md
Reference aids:
references/ACE/Source/ACE.Server/Physics/references/holtburger/for movement wire behaviorreferences/AC2D/for the older client-side movement packet reference
Mandatory Workflow
For every AC-specific function:
- Grep named retail first.
- Cross-reference ACE / holtburger / AC2D where relevant.
- Write readable pseudocode before porting.
- Port faithfully; do not simplify.
- Add conformance tests.
- Integrate surgically into the active L.2 lane.
- Verify with synthetic tests, real-DAT fixtures, and live observer evidence.