aorecomp

Anarchy Online classic in the browser

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


docs/research-notes/picker-timing-research/ledger.md (8484B)


Native mouse picking timing

Question: why can moving to a new pixel and reading one complete-frame snapshot return the target picked at the previous pixel?

Artifact identity and retained evidence

All inspected artifacts are the local original 14.9.1 Windows DLLs, statically analyzed with REA 6.5.0 / Ghidra 12.1.2. Original image base is 0x10000000. Maintained lifted KKR/LLR/CCR image bases are 0x36000000, 0x38000000, 0x27000000. Address rebasing changes only the image base in the cited examples.

Module SHA-256 Retained bundle
kkr.dll a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0 kkr-evidence.json
llr.dll ebb09047f6ead192388f7ddfb4795da5013a60f7c2d1c3933ec02eef58a10132 llr-evidence.json
ccr.dll 4c6d8dfc7eaa39044935d94e678ee4ead922decad36ed616a7843dcb51e7c55a ccr-complete-evidence.json
aar.dll fbe6545e65d9c77d85cb199323732a0c1c63b1edb01bc53b48da35892a0f88c6 aar-evidence.json

Matching provider-neutral snapshots are retained beside the bundles. All owned native sessions were closed after export. No target was executed or modified.

Observed native dataflow

  1. KKR n3EngineClientAnarchy_t::N3Msg_SetMousePos, original 0x10020f20, lifted client/game/kkr.dll/lifted-0014.c:799, writes normalized mouse floats into engine +0xd0/+0xd4. It calls camera.SetMousePos, then copies the current camera.GetObjectUnderColLine identity into engine +0xd8/+0xdc. There is no world-object selection pass inside this method. Evidence: ev_9c669687c8a64bb60efe8a845349c2db870f72878b1f01f9c54d088e92729e0a.

  2. LLR n3Camera_t::SetMousePos, original 0x100076e0, stores normalized floats into camera +0x108/+0x10c, derives the ray at +0x11c/+0x120/+0x124 and ground position at +0x110/+0x114/+0x118. It does not update the selected-object CollInfo_t. GetObjectUnderColLine at 0x10007bb0 simply returns camera+0xf0. Evidence: ev_7bf86d731b6d4d346d0d979ecc4f22cd616dcbaf43720d6340be0b4a579dd17f, ev_fd5068649d7445b9aed68b12e25db714f2775fb6aa501df9a3c9c678361d7fa6.

  3. LLR n3Playfield_t::Run, original 0x1002acf0, performs world selection periodically. When the active camera exists, it adds engine+0x64 (delta time) to the float global 0x1006ee70 (lifted 0x3806ee70). Only when the sum is strictly greater than 0.1 does it reset the accumulator to zero and consider selection. A zero global collision ray bypasses selection even then. Evidence: ev_7269c1855c0fe39deaf86833e2f41630a250d1f382676b52b1dd43cfa8c5d84f.

  4. The actual selection path begins at original 0x1002ae31 / lifted 0x3802ae31. It obtains world candidates, sorts them, initializes camera+0xf0 to ground identity (40007,0), then checks visible visual dynels in order. CheckSelectionCollision at 0x100082f0 excludes the local actor in first person and invisible objects. A hit copies five dwords of collision data to camera+0xf0 and terminates the candidate loop. Empty candidate lists and no hits retain the ground identity. Evidence: ev_526bc64f5d1b55be709a0f6ab085e262e7a39a2101d74266fb7a5dd172681b06, ev_fa3d7fd29f2e07f25e7cc3f4dcffd9cff86058283d0a90fd5fcc17ddcfb36d76, and the Run dossier above.

  5. Original 0x1002aed7 / lifted 0x3802aed7 is the shared exit from selection. It is also reached when the timer has not elapsed and when the ray is zero. An unconditional generation increment there would falsely label bypassed frames as new picks. A passive observer needs a query-began marker at 0x3802ae31 and completion handling only when that marker was set.

  6. CCR InputConverterModule_t::InputGameSubmodeActionViewONMessage, original 0x10005790, receives a Vector3_t from AFCM, invokes EER's SetMousePos wrapper, then updates InputConfig mouse world position and object-under-mouse state. It sets global 0x10048b58 / lifted 0x27048b58 to 1 and skips a repeated call while this flag remains set. InputConverterModule_t::FrameProcess at 0x10005860 resets that flag to 0 before InputConfig::FrameProcess. Evidence: ev_f2da41d2f181251fc7393e966e5fd7f3de72a434a02897a4f22fc5466405fb76, ev_10c5fd8d46dec16337964d9a66529746d4b4a805bc277cbf12c466515424903c.

  7. CCR InputConfig_t::FramePreProcess, original 0x10003f00, processes queued input, converts mouse coordinates to client coordinates and stores the processed pixel into InputConfig+0x108/+0x10c. The public GetCurrentMousePos at 0x10022080 reads those same fields. InputConfig instance global is lifted 0x27048b44, returned by lifted sub_27021EC0. Evidence: ev_5dcc74c185496306de28fdc60a5cd1af6cf232b7f74c96a242951fc66f993e0d, ev_7fc0547043f2eb0ee5b718d1dc6dd96bef93baf2a5e89ecc5f6b687d47376e1a, ev_b31f525c7deff6a9bcad58d9a10fec12f5bdc5671ca30fc588ee07cf536cb15e.

Exact pixel transform

CCR MouseDetectorButton_t::CheckHotSpot, original 0x10016810, mode 2 sends:

x = (pixel_x - rect.left) / float((rect.right - rect.left) / 2) - 1
y = 1 - (pixel_y - rect.top) / float((rect.bottom - rect.top) / 2)

The half-size division is integer division before conversion to float. The rectangle is hotspot +0x2c/+0x30/+0x34/+0x38. The method checks containment first, sends its message and returns false, allowing the detector to observe input without itself becoming the top consuming hotspot. Evidence: ev_a95fa030788ce39fe2a8d22df6dea9264ed1c6f35e395f2a64cf9ccf89769791.

For a verified rectangle (0,0,width,height), inversion is x=(norm_x+1)* integer(width/2), y=(1-norm_y)*integer(height/2), rounded to the original pixel. The active world detector rectangle is reachable through the native ActionView singleton: MEM32(MEM32(0x2b0ee640) + 0x10), then hotspot offsets above. The original DDR PE export table identifies ActionView constructor RVA 0x11d0, GetInstance RVA 0x12e0, and the singleton data RVA 0xee640. Maintained client/game/ddr.dll/lifted-0000.c constructor sub_2B0011D0 creates the mode-2 MouseDetectorButton and stores it in ActionView+0x10. sub_2B0012E0 stores the singleton at 0x2b0ee640. sub_2B0013A0 sets the height to display height minus 20; sub_2B001440 adjusts the width when the side panel is shown. Thus the world viewport need not equal the display dimensions. Original DDR SHA-256 is 3c937161de8f690351c3c08e158431417cee9ced77a41b677e7123b61a8c9883; ddr-original-pe-exports.txt retains its objdump export observations. These DDR observations use original PE exports plus maintained lifted assembly comments, not an additional REA dossier or runtime observation.

UI bypass and probe completion

HotspotModule::CheckHotSpotList at original 0x10010770 tracks a blocking flag. The first hit can block lower pass-through hotspots; the actual top hotspot is copied into InputConfig+0xc8. Evidence: ev_fb4b6a4c6d412dac8d812e95cd229823e847873816bf4941d0b549aa5ffa2ab0.

Derived candidate UI-bypass observation: a complete-frame processed mouse pixel equal to the probe together with ActionViewON flag 0 indicates no world mouse message was processed in that frame. Runtime validation of the AFCM callback ordering is still needed before relying on this as a finished skip condition.

No monotonic pick generation or last-evaluated pixel field was found in the inspected selection dataflow. This is a bounded static result, not a claim that no such field exists anywhere in the whole client. Accumulator rollover alone can alias when snapshots skip frames or frame delta exceeds the selection interval, so it is insufficient as the sole completion fence.

A minimal passive test observer can record query generation and camera mouse coordinates only when 0x3802ae31 is reached, capture final camera identity at 0x3802aed7 only for that query, and expose this in complete-frame snapshots. It must not call SetMousePos, force selection, change the timer or synthesize identities. The public driver can require a newer query for the desired pixel and a later/current engine hover matching that query's identity. Waiting for the engine copy matters because the engine hover cache is copied by a separate SetMousePos call and can lag the camera collision result.

The exact ordering of whole AFCM input callbacks relative to n3Playfield::Run has not been proven statically here. A generation plus captured result avoids depending on that ordering. The retained real trace has compatible staggered hover transitions, but static analysis alone does not establish runtime timing.