Implement gravity resolution and fast area calculations in collision handling
This commit is contained in:
parent
b3975ca41b
commit
2e16b2d524
8 changed files with 301 additions and 26 deletions
|
|
@ -328,9 +328,9 @@ The bounded staged dispatcher can now issue those actions against the host proce
|
|||
|
||||
The host-owned item move now follows `Item_MoveToPoint` (`10a0:1945`) through `ItemCache_Push`/`ItemCache_Poptocoords` (`10a8:1ced/1df5`) for two bounded cache effects: a moved item becomes the destination block's newest head, even when staying in the same block, and Z above `0xfa` is clamped. Caller-supplied item IDs can also be inserted at a block head. The host free-ID allocator uses the source `0x100..0x27ff` range, skips staged direct and contained records, and fails without mutation when exhausted. The window reserves staged contained IDs and retains their parent links; placing one in the world clears its parent while its children remain linked. Synthetic nested/exhaustion and retail-map tests pass. This does not yet implement returning freed IDs to the list, live inventory/container transfers, fast-area status, or viewport side effects.
|
||||
|
||||
The supported horizontal `GravityProcess_Run` path now issues `Item_Grab` at the old item position when Z speed is zero and X/Y speed is nonzero, then asks the injected sweep to approve movement. As in the source order, a refused sweep can leave a newly requested item process behind while the item stays put. The earlier no-mutation guarantee for a refused sweep applies only to the nonzero-Z path, which does not issue that request. The stationary zero-speed fall search, collision response, and automatic scheduler dispatch are still unported; a caller must provide shapes, group counts, and the sweep decision for this host-only branch.
|
||||
The supported horizontal `GravityProcess_Run` path now issues `Item_Grab` at the old item position when Z speed is zero and X/Y speed is nonzero, then asks the injected sweep to approve movement. As in the source order, a refused sweep can leave a newly requested item process behind while the item stays put. The earlier no-mutation guarantee for a refused sweep applies only to the nonzero-Z path, which does not issue that request. This callback-based unobstructed runner does not handle the stationary zero-speed fall search or collision response; a caller must provide shapes, group counts, and sweep approval.
|
||||
|
||||
The standalone `AreaSearch_SweepTestPt` bounds stage (`10e0:0b39`) clamps X/Y to `0..0x7fff` and Z to `0..0xfa`, reports failed-direction bits `1/2/4`, and distinguishes a horizontal hard failure from Z clamping. The source's `World_MapBlockInFastArea` (`10a8:0000`) rotated block predicate and eight-corner start/destination footprint gate are now testable with an explicit fast-area range. The sweep's item-iterator rectangle and live candidate query follow inclusive X/Y filtering and Y-then-X block order. The per-item sweep uses 16-unit X/Y extents, 8-unit Z extents with the source zero-height fallback, and six axis-face tests that report one-unit-before-contact points and failed-direction bits. A read-only live collector combines those tests with candidate order, shape solidity and flip flags, and an explicit fast-area range. The host now selects a solid hit in source order when any axis is strictly closer, retains the earlier hit on a tie, and accumulates direction bits across contacts; a live entry point returns the resulting point and first colliding item. Synthetic tests cover both directions on all axes, self-exclusion, non-solid items, chain order, flipped shapes, and candidate selection. It does not handle damaging-only or floor contacts, maintain live fast-area state, or drive gravity movement. The gravity runner still requires an explicit approved sweep callback.
|
||||
The standalone `AreaSearch_SweepTestPt` bounds stage (`10e0:0b39`) clamps X/Y to `0..0x7fff` and Z to `0..0xfa`, reports failed-direction bits `1/2/4`, and distinguishes a horizontal hard failure from Z clamping. The source's `World_MapBlockInFastArea` (`10a8:0000`) rotated block predicate and eight-corner start/destination footprint gate are testable with an explicit fast-area range. `World_CalcFastAreaLimits` (`10a8:0048`) now supplies the source sum ±5 / difference ±3 block window from a world center. The window refreshes a player-centered host range after movement and dispatches any owned gravity processes through its timed scheduler; it still does not create gravity entries or repaint moved map items in the static preview. The sweep's item-iterator rectangle and live candidate query follow inclusive X/Y filtering and Y-then-X block order. The per-item sweep uses 16-unit X/Y extents, 8-unit Z extents with the source zero-height fallback, and six axis-face tests that report one-unit-before-contact points and failed-direction bits. A read-only live collector combines those tests with candidate order, shape solidity and flip flags. The host selects a solid hit in source order when any axis is strictly closer, retains the earlier hit on a tie, and accumulates direction bits across contacts. Damaging-only face contacts are recorded in candidate order without blocking the resolved point. With an explicitly enabled floor-gap limit, the host also identifies the closest solid support beneath the destination footprint for source limits 0 and 9; this support metadata does not change the destination. The resolved sweep now reports fast-area failure at the original point with direction bits 1/2 and clamps out-of-range Z with bit 4; the gravity runner conservatively rejects these unsupported responses before mutation. `runResolvedGravity` moves an owned item to a solid-hit point after its strict process wake, damps and reverses horizontal speed on collision, and sleeps the process again. `scanResolvedGravity` dispatches this bounded runner through the host scheduler; tests verify a wall impact, a later move away, and no repeat within the same tick. The remaining gaps are vertical collision response, item status/cache writes, collision events, stationary fall search, and an actual window gravity producer and moving-item renderer. Original runtime parity remains unverified.
|
||||
|
||||
Original DOS debugging and runtime verification are postponed indefinitely until requested again. The DOSBox-X debugger session has been stopped; do not treat a live trace as a prerequisite for the source-port work below. Keep unverified parity claims labeled as such.
|
||||
|
||||
|
|
@ -339,8 +339,8 @@ Next source-port checks, in call-chain order:
|
|||
1. Keep the `0x23ff/0x2400` process item boundary until source-derived allocation limits support changing it; do not infer a wider live table from staged map IDs.
|
||||
2. Port the remaining scheduler interval/group transitions behind host timing boundaries using static code evidence, with runtime parity explicitly deferred.
|
||||
3. Port free-ID return/reuse and live container transfers while preserving contained parent/child links and process ownership.
|
||||
4. Add damaging-only and mode-dependent floor contacts, then combine the solid-hit result with bounds and fast-area failures before enabling collision-driven movement.
|
||||
5. Port the `GravityProcess_Run` area sweep, collision responses, and item-cache position/status writes to make created gravity entries move real items after their sleep.
|
||||
4. Carry source sweep mode flags through callers and implement vertical collision responses for supported item/status branches; bounds and fast-area failures are now explicit but conservatively rejected by gravity.
|
||||
5. Extend scheduled gravity with item status/cache writes and collision events; add a real window gravity producer and dynamic item renderer before claiming visible gameplay movement.
|
||||
6. Connect the approved-move `Item_Grab` path to a ported `Item_LegalMoveToPointWithCollisionInfo` sweep and item-cache lifecycle, without changing the separate Windows `F` release fixture.
|
||||
7. Lift `EntityVmContext::CreateFromSlotIndex` (`1420:0eec`) and its interpreter initialization; keep release event-body lookup diagnostic until the VM executes it.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue