136 lines
9.0 KiB
Markdown
136 lines
9.0 KiB
Markdown
# Input dispatch belongs to the viewport game-object pass
|
|
|
|
Static recovery, 2026-10-25. This follow-up resolves the input/world-logic bridge
|
|
left open in [loop-motion.md](loop-motion.md). Originals were read, never executed
|
|
or changed. SHA256: Neutron.exe
|
|
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`;
|
|
OMT2.dll `3ec41ead011adf56387a6dbd4580e5b5a9721b5f8020c8a56420f42824354943`.
|
|
The helper maps original bytes through PE sections and verifies30 decisive
|
|
anchors, direct calls and vtable entries. File offsets below are hexadecimal.
|
|
|
|
## Recovered dispatch bridge
|
|
|
|
The level game receives input dispatch during the same viewport callback that
|
|
integrates physics. It is **not** called by the engine world's OMT logic update.
|
|
There are two distinct update interfaces, with different ownership and clocks.
|
|
|
|
| Step | Module VA / file offset | Evidence |
|
|
|---|---|---|
|
|
| Viewport first integrates physics | EXE47E554 /7E554 →479BC0 | Direct call before game-object pass |
|
|
| Viewport updates registry | EXE47E582 /7E582 →473740 | Registry50999C, node+8 payload, slot10 call at473758 /73758 |
|
|
| Lab game interface enters normal update | EXE4C387C /C387C =470280;4C3C30 /C3C30 =44DF80 | CLevel01BGame interface vtable4C386C: slot10 wrapper; slot3C4 actual callback |
|
|
| Base game has identical dispatch | EXE4C2C94 /C2C94 =470280;4C3048 /C3048 =44DF80 | CJimmyGame interface vtable4C2C84 |
|
|
| Wrapper supplies frame argument | EXE47028E /7028E;4702C5 /702C5 | Stores dt at interface+294; calls slot3C4 unless supervisor+8C selects3C8 |
|
|
| Game updates timer/event records first | EXE44DF89 /4DF89 →45F510 | Direct call before input;45F5BF..D3 advances record float+10 by dt*owner+8 |
|
|
| Game dispatches input | EXE44DF94 /4DF94 →475A70 | Same dt argument propagated |
|
|
| Dispatcher obtains controlled object | EXE475A9C /75A9C;475AA9 /75AA9 | Global5099E4 null skips input; nonnull calls its interface slot3CC |
|
|
| Jimmy receives input | EXE4A3B08 /A3B08 =426030;426084 /26084 →438A60 | Jimmy vtable4A373C slot3CC; guards precede base movement input |
|
|
| Later logical objects update | EXE4A3B00 /A3B00 =424600 | Jimmy slot3C4 eventually calls437940 at424C34 /24C34 |
|
|
| Entire registry synchronizes transforms | EXE47E587 /7E587 →473770 | Separate traversal after all ordinary callbacks |
|
|
| Base viewport draws | EXE47E6DF /7E6DF imports48D304 | Named import OMediaViewPort::render_viewport |
|
|
|
|
**Pointer coordinates:** CJimmyGame and CLevel01BGame game-interface pointers
|
|
are **complete+8C**, whereas C3DJimmy is **complete+C0**. RTTI locators
|
|
EXE4E0768 /E0768 (base game) and4E08F0 /E08F0 (lab game) hold displacement8C.
|
|
Instruction475A8A /75A8A explicitly reads the complete vptr from interface-8C
|
|
and475A90 forms that complete pointer. Do not apply Jimmy's-C0 conversion here.
|
|
For the game, interface+294 is complete+320; for Jimmy it is complete+354.
|
|
|
|
The registry constructor appends to the tail, so input relative to Jimmy's
|
|
ordinary update depends on insertion order. The recovered guarantee is:
|
|
|
|
```text
|
|
physics of registered bodies
|
|
-> game-object registry traversal in insertion order
|
|
game object: event timers -> controlled object's input callback
|
|
Jimmy object: base/rotation -> movement/jump/jetpack controller
|
|
other objects/effects in their actual registered positions
|
|
-> whole-registry logical-to-visual synchronization -> draw
|
|
```
|
|
|
|
Game-before-Jimmy ordering for an actual loaded lab still requires a bounded
|
|
construction trace, including constructor-created shadow/fire objects. The
|
|
diagram deliberately does not assert that relative order. Even without it,
|
|
Jimmy's current controller cannot change the physics pass that already ran.
|
|
Queued jump impulses are consumed by a later physics invocation. A separate
|
|
class-specific collision query/update during an object callback must not be
|
|
mistaken for replaying the earlier global physics pass.
|
|
|
|
## Engine OMT logic is separate, and runs before render broadcast
|
|
|
|
DLL100215C0 /215C0 sends logic message-604 at100215D4 /215D4 when global
|
|
1013D6DC is zero, then sends render message-605 at100215E8 /215E8, passing
|
|
that global as the render-message argument. These are synchronous virtual
|
|
broadcaster calls. World listener100F9C40 /F9C40 converts its listener pointer
|
|
by-30 and calls complete world slot30, update_logic100F9B10 /F9B10.
|
|
World update_elements100F9C80 /F9C80 invokes complete OMT element slot3C,
|
|
parent before descendants, preserving its pre-callback next-node pointer.
|
|
|
|
For CLevel01BGame, complete OMT vtable4C3CD0 slot3C at4C3D0C /C3D0C is
|
|
4747A0; this forwards through IAT48D230 at4747A5 /747A5 to
|
|
OMediaElement::update_logic, DLL100EFF20 /EFF20, a `ret4` no-op. Thus this
|
|
path does not dispatch44DF80 or player input. For Jimmy, complete vtable4A3BDC
|
|
slot3C at4A3C18 /A3C18 is462260; it forwards at462265 /62265 through48D244
|
|
to OMedia3DMorphAnim::update_logic10002DB0 /2DB0. That calls
|
|
OMediaAnim::update_logic10020CF0 /20CF0 with the morph subobject at complete+90.
|
|
Eligible animation updates therefore run through OMT logic before the ensuing
|
|
render message's game callbacks select/change poses. Logic can be skipped by the
|
|
periodical flag, world pause or timer gate. Exact displayed first-frame and
|
|
completion effects still require analysis of animation flags and listener order.
|
|
|
|
The render message reaches engine listener1006BCB0 /6BCB0, which converts its
|
|
listener by-10 and calls engine slot14 at1006BCCA /6BCCA. The full renderer
|
|
backend/surface/viewport route remains a separately bounded follow-up; the
|
|
viewport's own physics→registry→draw order is already established independently.
|
|
|
|
## Timer units, defaults and limits
|
|
|
|
| Owner/field | Source VA / file offset | Recovered value or transition |
|
|
|---|---|---|
|
|
| World pause count+44 | DLL100F9B18 /F9B18 | Nonzero returns without world logic |
|
|
| Timer begins world+48 | DLL100F9B26 /F9B26 | Elapsed obtained by100FA0A0 /FA0A0 unless timer byte+0D is set |
|
|
| Timer mode world+58 | DLL100F989D /F989D | Constructor writes1 |
|
|
| Timer period world+5C | DLL100F98A0 /F98A0 | Constructor writes40 |
|
|
| Maximum elapsed world+60 | DLL100F98A7 /F98A7 | Constructor writes500;100F9B42..47 clamps larger elapsed if max nonzero |
|
|
| Minimum elapsed world+64 | DLL100F98AE /F98AE | Constructor writes1;100F9B51..5B skips below this if timer is running |
|
|
| Engine clock | DLL100F8D18 /F8D18 | GetTickCount import1011410C, minus global epoch1017A308 in ordinary path; optional override/pause branches exist |
|
|
| Engine elapsed passed to elements | DLL100F9BCC..E6 /F9BCC | Unsigned integer elapsed converted to float, no seconds division before world slot3C traversal |
|
|
| Viewport game clock | EXE47E490 /7E490;47E502 /7E502 | QPC delta/frequency float seconds stored696030; accepted only0<dt<1 |
|
|
|
|
The **engine elapsed units are milliseconds** in the ordinary GetTickCount path.
|
|
These constructor values are defaults, not proof no game/setup writes replace
|
|
them. Mode1 passes the elapsed value when it reaches the minimum. Mode0 and2
|
|
also compare elapsed with period; mode2 invokes100FA120 /FA120 to adjust period
|
|
using accumulated elapsed samples (initial/reset40). Neither establishes a60Hz
|
|
gameplay cadence. World max/min elapsed govern the OMT logic/animation route;
|
|
they do not directly clamp the QPC seconds consumed by viewport physics and input.
|
|
No recovered fixed1/60 accumulator or Sleep-based frame limiter exists in the
|
|
bounded application/periodical/viewport routines inspected here. Presentation,
|
|
backend blocking and driver synchronization can still constrain actual cadence.
|
|
|
|
## Current implementation, verification and concrete C3 next action
|
|
|
|
Baseline69d0187 samples SDL keys and runs grouped fixed60Hz simulation with
|
|
controller before physics; Program then updates mechanisms, patrols, director,
|
|
objective state and poses. This is an implementation policy and differs from
|
|
the directly recovered order above. Do not describe the source world timer's
|
|
1ms minimum or40ms period default as the port's intended fixed rate.
|
|
|
|
`python3 tools/binary/checkpoint_input_frame.py` and
|
|
`python3 -m unittest discover -s tests -p test_checkpoint_input_frame.py -v`
|
|
check immutable module hashes, fresh source bytes, direct calls and virtual
|
|
slots. They provide static verification only. No original gameplay cadence,
|
|
native Windows timing, or source input latency was runtime-verified here.
|
|
|
|
C3 can now define a traceable frame interface with separate **engine animation**,
|
|
**body integration**, **insertion-order object callbacks**, and **visual sync**
|
|
phases. Before changing the playable controller, recover the lab construction
|
|
sequence through object registration46FF4A..7F, and list game/Jimmy/shadow/fire/
|
|
Goddard registry positions. Replay that list with a trace asserting physics
|
|
precedes all input/controller callbacks and input uses current5099E4. Then split
|
|
LabSimulation's input/velocity production from body integration in one bounded
|
|
change, preserving the existing route as a regression. Keep fixed60Hz explicitly
|
|
chosen until original timing observation or a recovered game frame-cap mechanism
|
|
supports replacing it. Also trace event-pump ordering/focus transitions and
|
|
pause/invalid-dt boundaries before claiming end-to-end source equivalence.
|