aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


docs/research-notes/player-follow-research/mass/cache/target-loss.md (9901B)


Follow target loss and explicit stopping

Source-only maintained KKR/LLR/QQR investigation. No original binary, engine, native export, runtime call, heap access, client/server process or tracked source edit was used. Complete bodies and hashes are in functions.json, individual sub_ADDRESS.c files and function-ledger.md. Source-instruction projections are comments already present in the maintained C, not newly acquired disassembly.

Result

Clearing a FollowTarget pointer does not stop a moving PlayerVehicle. For the positive-direction moving state, an admitted ordinary CharDCMove action2 clears following and also performs the native stop transition. If the server cannot know which direction subtype the client currently holds, admitted ordinary CharDCMove actions2 and4 cover the two moving direction states: one transition matches and the other is rejected. Neither changes the walk/run primary mode or preferred mode. No additional null FollowTarget is required for this path.

This is a source-supported packet contract, not a runtime test of that packet pair. CharDCMove admission and pose handling still apply; the source does not establish that an arbitrary stale or otherwise inadmissible packet will work.

Evidence ledger

ID Complete symbols and initializer linkage Observed result
L01 KKR3607e690 and36048260 Null resolved target skips helper control dispatch. Installer removes an old non-self target listener, stores NULL at vehicle+160 and returns without Halt or clearing +324.
L02 KKR360476e0, listener vtable36170db8,36048f90; LLR38042810,38042b00,38042bf0 The target event listener is vehicle+13c. Dispatch calls listener virtual+4, which is48f90; it only writes zero at listener+24, meaning vehicle+160.
L03 LLR38018990 and overlapping retained entry38018ba3 With actor+94 nonzero and decremented actor+98 no longer positive, source broadcasts an event containing source actor+20 and integer1 before calling1e8b0 and returning false. Exact packet-to-removal scheduling was not traced.
L04 KKR3604ba20 Once following is false, nonzero automatic forward control+324 selects forward/backward seeking. Nulling the pointer leaves this control available.
L05 KKR360439e0,36043c50,36049130,360447b0,36049830,360447c0,360495c0; callbacks455d0/45910; QQR42011bc0 Non20 CharDCMove first clears following, then submits its movement event. Events2/4 select the matching stop callback, clear +324, Halt and refresh parameters while preserving primary/preferred modes.

tables.json binds the listener's actual two slots: offset0 ->36049420 (destructor adjustor), offset4 ->36048f90 (event callback). The DWORD immediately after these two slots is the next vtable's RTTI locator3617b078, not a third listener method. The whole maintained initializer hashes are verified in verification.json; the current source ledger contains98 complete bodies.

Installer and listener contract (L01-L03)

FollowTarget activation3607e690 resolves the payload identity. When the result is NULL it jumps to7e784, skipping the helper control dispatch entirely, then calls 36048260 with the null target. Thus changing the control byte on a null-target packet does not obtain a stopping transition through this receiver path.

Installer36048260 compares old and new pointers. If the old nonnull target is not the owner, it calls imported RemoveListener at3616fc60 with target+20 and vehicle+13c. At482ba it stores the new pointer at vehicle+160. If that pointer is NULL,482c0 immediately branches to the return at48421. There is no Halt call, velocity write, +324 write or helper event in that branch. If old and new are already both NULL, its separate shared path still has no stopping action.

Constructor360476e0 installs listener vtable36170db8 at vehicle+13c. LLR event source constructor38042810 stores dispatcher38042bf0 in its listener list+14. BroadcastEvent38042b00 walks listener pointers and calls that dispatcher, which tail-calls listener virtual+4. The bound KKR callback36048f90 consists only of MEM32(ecx+0x24)=0; ret4. With this adjusted listener pointer it clears the vehicle's +160 target and ignores the event argument. It does not halt, clear automatic controls or change helper state.

LLR38018990 has a deferred terminal branch: if actor+94 is nonzero, it decrements actor+98; when the counter is no longer positive it broadcasts an event whose first DWORD is actor+20 and second DWORD is1, invokes actor+2c helper3801e8b0, then returns false. This binds a concrete native publication to the event-source dispatch above. The meaning and scheduling of the two actor fields, and the precise network-removal caller, remain bounded gaps; no deletion-specific stop behavior is inferred from their names. Regardless of which event invokes this listener, its complete callback has only the target-clear write.

CharVehicle destructor36047910 calls48260(NULL,2.0,NULL) as cleanup before destroying helper/base state. Destroying the follower is a separate path from stopping an otherwise live follower when its target disappears.

Stop response and preference preservation (L04-L05)

PlayerVehicle3604ba20 tests following first. If false, its ordinary steering path reads +324. Positive values call imported SeekForward at361702d0; negative values select the backward helper. A previously installed automatic +324=1 can therefore keep moving after either the null-target installer or listener merely clears +160.

CharDCMove activation360439e0 first invokes admission/pose handling36043c50. After success, every action except20 clears an existing follow pointer by calling48260(NULL,2.0,NULL), then forwards the action to49130. Rotation action20 has its separate branch and does not perform this follow cancellation.

The event transition builder447c0 accepts event2 when helper+8=3 and helper+c=1; it selects helper+8=1, helper+c=0 and callback vtable36170d48 ->455d0. Event4 requires helper+8=3 and helper+c=2; it selects the same stationary values and vtable36170d30 ->45910. A mismatched stop event is rejected. The transition driver49830 installs the new helper fields before invoking the callback.

Both callbacks test vehicle virtual+80 (Player implementation360c6b20 returns true), call4bca0(0), which clears vehicle+324, then call imported QQR Halt at 36170344. For the moving vehicle, Halt42011bc0 clears velocity+60/+64/+68 and cached speed+d8, and calls the vehicle halt callback. Since CharDCMove already cleared following, Player callback4bc80 does not recursively submit another follow stop. Both stop callbacks also call47e60 to refresh vehicle parameters. Callback45910 additionally restores direction+1; callback455d0 contains other animation/strafe handling, retained in full, which is not needed to establish the longitudinal stop contract.

For these event2/4 branches, builder447c0 preserves the copied helper primary mode+4 and preferred mode+30. It changes only the specified locomotion/direction fields. There is no control22/23 mode toggle in the stop response. A single action2 is sufficient for the task's explicitly positive-direction moving case; the pair2/4 handles either ordinary direction subtype without inventing a universal-stop meaning for an unrelated event number.

Manual turn or mode change after a moving follow

ID Complete symbols and initializer linkage Observed result
L06 Builder360447c0 table36045220 event9 ->36044c57, callback36170cdc+4 ->360459f0, setter3604bcb0 Turn changes turn control+32c; it does not clear forward control+324 or Halt.
L07 Builder360447c0 events22/23 ->36044ec4/36044e6f, callbacks46270/46080, setter4bd20 Ordinary walk/run callbacks refresh parameters and change primary/preferred mode while retaining automatic forward control+324.

The non20 CharDCMove cancellation sequence in L05 applies before events9,22 and23 are submitted, so these commands clear following. Installer48260 leaves the automatic forward control intact. Event9 selects turn callback459f0, which reads the locomotion helper and calls4bcb0 with a turn-rate constant. Complete setter 4bcb0 only stores its argument at PlayerVehicle+32c. No forward-control write or Halt occurs in this callback; the direction subtype is preserved by this event's builder branch.

Walk22 and run23 select callbacks46270 and46080. They begin by refreshing47e60 and explicitly set preferred mode+30 to2 or3 respectively. In the ordinary ground path with previous primary mode2/3, neither callback calls4bca0 or Halt, nor does either clear longitudinal control+324 or direction subtype. Their special old-primary-mode7 path clears vertical control using4bd20(0), whose complete body writes only PlayerVehicle+330. Other animation/camera handling is retained in the full bodies; this investigation does not extend the ordinary ground conclusion to every flight, swimming or exceptional mode interaction.

Therefore a positive-direction follow that physically started and installed automatic forward control1 continues ordinary forward steering after a manual turn or walk/run change cancels the follow target. It does not become stopped merely because the follow originally started while the character was at rest. For that bounded case, the server should reanchor to the accepted manual packet pose, preserve the already-active forward control1, and then apply the manual action: explicit forward/backward commands1/3 replace it, matching stops2/4 clear it, while9/22/23 retain it. Actual native state is the source of this conclusion; testing nonzero server follow velocity is an implementation proxy for the already-started positive-direction native state. A settled follow must not be silently assigned forward1 solely because it once had a follow target. Negative-direction steering remains outside this implementation scope.