aorecomp

Anarchy Online classic in the browser

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


docs/native-picking.md (7740B)


Native picking and gameplay probes

The gameplay harness waits for a completed native selection query at the probe's pixel and the matching engine hover identity. A consumed mouse motion and one render frame can still expose the preceding pixel's cached result.

Original selection timing

The 14.9.1 client separates pointer delivery, collision selection and hover:

  1. KKR n3EngineClientAnarchy_t::N3Msg_SetMousePos at 10020f20 stores normalized pointer coordinates, updates the camera ray and copies the camera's cached identity into engine fields +d8/+dc.
  2. LLR n3Camera_t::SetMousePos at 100076e0 computes the ray. GetObjectUnderColLine at 10007bb0 returns the existing +f0/+f4 identity.
  3. LLR n3Playfield_t::Run at 1002acf0 adds frame delta to its selection accumulator. When that sum is strictly greater than 0.1 seconds and the ray is nonzero, it tests world candidates and updates the camera identity. A subsequent pointer update copies that result into engine hover.

The real query begins at original 1002ae31; shared exit 1002aed7 also handles timer/ray bypasses. The WASM test observer marks query entry and records completion only for an entered query. Tracing activates on the first snapshot request. The observer records a sequence, pixel and final identity without changing the accumulator, candidate tests or selection result.

CCR's mode-2 MouseDetectorButton_t::CheckHotSpot at 10016810 normalizes pixels against its own rectangle using integer half-width/half-height. The observer inverts that transform through the actual ActionView detector. Its rectangle can exclude the bottom toolbar and side panel, so the render dimensions alone cannot recover the queried pixel. Snapshot calls preserve the query sequence until another native query completes; camera removal hides the previous camera's result.

Original KKR SHA-256 is a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0; LLR is ebb09047f6ead192388f7ddfb4795da5013a60f7c2d1c3933ec02eef58a10132. REA evidence includes ev_9c669687c8a64bb60efe8a845349c2db870f72878b1f01f9c54d088e92729e0a (engine copy), ev_7269c1855c0fe39deaf86833e2f41630a250d1f382676b52b1dd43cfa8c5d84f (periodic selection) and ev_a95fa030788ce39fe2a8d22df6dea9264ed1c6f35e395f2a64cf9ccf89769791 (pixel transform). Complete records, original DDR export observations and coverage limits are retained in docs/research-notes/picker-timing-research/ledger.md.

Verification

The public-driver regression supplies a stale matching hover while the current pixel's collision query is pending. The old helper returns that wrong pixel; the corrected helper waits for its miss and then probes a valid pixel. The moving-projection regression continues to pass. Offscreen pixels are skipped before waiting for a query that cannot receive that pointer; the next visible probe can still select an entity whose projected origin is below the canvas.

The C fixture verifies inactive tracing, exact query pixels for an offset, odd-sized world rectangle, separate cached hover, unchanged generation across snapshots, camera removal and preserved guest registers. All nine focused driver checks and all 13 JavaScript test files pass.

The rebuilt published bundle passes the focused Go asset/resource/client checks and both real browser harnesses in 65.061 seconds. Native movement, posture, world selection, resizing, reload, ordinary backyard travel and booth Use pass. The recorded query at frame 288 identifies the creature while engine hover still reports ground; frame 290 has the matching hover. Selection sequences advance every six frames in that sample. Captures: local/game-tests/20261030-120530/ and local/game-tests/mission-targets-20261030-120547/. The final rerun passes all 16 focused Go roots, including both browser harnesses in 18.01s and 40.11s. Its captures are local/game-tests/20261030-123012/ and local/game-tests/mission-targets-20261030-123030/.

Ordinary overlapping corpse and book

The same earned two-client character accepted mission 88 at level 3, entered its private field and defeated three full-health level-5 Leets without fixture combat rolls or granted stats, items, cash or positions. Its third corpse 1068660 rests at [15.01,0.01,34.75], beside the still-bound book 89 at [15,0.011,35.001]. The character stood at approximately z39.21 facing them.

Running the old helper against that unchanged scene returned [518.346191,594.507324] with cached corpse hover, while query 4671 still described the earlier pixel [510,586]. The later completed query 4678 at rounded pixel [518,595] selected book 89. The corrected helper then returned [498.346191,594.456848], backed by query 4692 at [498,594] and matching corpse hover. World positions and camera were unchanged; small projected vertical differences reflect native animation rather than an identical frozen image.

A separate corrected pick and real right click opened that corpse's native loot window and changed the wallet from 80 to 82, zeroing its cash while the book remained in the world. Part 90, QL6, remained corpse-owned at this observation; opening the window alone is not item-transfer evidence. Ordinary book pickup subsequently succeeded. Returning before corpse expiry reopened it without another cash award and transferred that exact QL6 part into the owner's inventory. Captures are in local/todo-progression-play/runtime-level23/overlap-compare-repeat*/ and mission88-third-corpse-open/. The independent verifier and exact comparison records are local/picker-timing-research/tmp_verify_overlap.py and overlap-verified.json.

GUI-covered probes

World queries do not run for pointers captured by native UI hotspots, including the transparent chat history. A fresh starter's roaming Leet projected into that history and left the query describing an earlier pointer position for the whole wait. A close booth approach also placed its first on-canvas probe on the bottom toolbar. Captures are local/game-tests/starter-20261030-201953/ and local/game-tests/mission-targets-20261030-195448/. In local/game-tests/mission-targets-20261030-202715/, chat covers the booth's origin at approximately [379,673], while its upper model remains visible.

The driver now consults client/browser/index.html:touchRegion, the existing lookup over native hotspots in hit order, before moving to each candidate. GUI-covered candidates are skipped; world candidates still require a fresh completed query at their exact pixel and matching hover. Probes extend up to 200 pixels above the origin for nearby tall statels. Fully covered targets can still require ordinary camera or movement input to expose them. The public driver regression reproduces transparent chat covering an otherwise on-canvas probe and verifies selection from the next visible world candidate. Blocked pixels share one snapshot per probe row, avoiding a separate frame wait for every covered pixel. The focused test includes a model that leaves view if too many observations are needed; the stale-hover and moving-projection checks also pass. All 126 JavaScript tests pass. Native movement, picking and reload pass in 16.84 seconds, with ordinary backyard booth Use passing in 41.88 seconds. Captures: local/game-tests/20261030-205203/ and local/game-tests/mission-targets-20261030-205412/. The maintained starter uses native Tab targeting for a moving combatant and observed right-mouse camera input to expose stationary remains on uneven terrain. Its item-bearing run retains strict mouse picking for the corpse and verifies the generated item transfer.