aorecomp

Anarchy Online classic in the browser

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


docs/first-aid.md (18971B)


First Aid research for 14.9.1

Regular health stims and the startup health/nano kit are enabled. The maintained client prevents an absolute HealthDamage snapshot from double-applying already queued weapon damage at impact. The startup kit uses the shipped client's own 20ms item-use action and restores both resources together. Original-server healing publication cadence remains unresolved.

Item and skill evidence

QL 1 Simple First-Aid Kit 23314 is native type 51005. Its shipped record in server/gamedata/items/items_000.yaml specifies 25 charges (212), range 3 (287), attack delay 0 (294), HasEnergy and UseEmptyDestruct. Its Can flags include Use, Eat, Stackable and ApplyFriendly. CannotSplit is absent in the selected client; an older 14.2.1 record included it and must not be used here. The 14.7.8 parsed record corroborates the shipped fields.

The use requirements are FirstAid123 > 7 AND (SelectedTarget431 & 35) != 0. The authored use functions are selected-target Health27 endpoints 10..12 (Hit53002), selected-target graphics 13600 (53030), and a 40-second FirstAid lock on the user (SkillTime53033). The item metadata initialization function AddSkill53028 changes the item's skill list; it is not a character skill buff. The endpoints do not establish the original server's random distribution.

Client base FirstAid is 5 (0x10072760, store 0x10072848). Resource 1000204/123 gives ability weights [0,30,0,30,40,0] in STR/AGI/STA/INT/SEN/PSY order. Its payload SHA-256 is dd9911abddaac369fc9d56c3ac2ff44e4c7a324f68a1c54b92ca94c4201137b5. Use range 0x1008fda0 accepts 3D center distance up to item range plus both actors' physical extents, including equality: 7 meters for default players. ApplyFriendly consults the inverse of attack permission (0x10079880); faction equality alone does not define every valid friendly target.

Shipped cd_image/text/tips/LookatStartupFirstAidKit.txt explicitly permits use during combat and directs F1 self-targeting. The item description permits self or friend. Neither source establishes universal friendly NPC, dead target or PvP rules. Full-health consumption, historical lock persistence and the heal roll remain unresolved.

Native charge and feedback protocol

The target is shipped kkr.dll, SHA-256 a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. Addresses below use its original 0x10000000 base; generated C uses 0x36000000. The retained REA bundle is local/reports/first-aid-protocol-1491-evidence.json.

The immediate use path does not itself apply this health delta locally. Common apply 0x10002370 sends Hit53002 with count 1 and interval 0 directly to 0x100be8e0; its gate 0x100bfb40 rejects the effect before dispatch. This is a negative result for that specific path, not every possible message. Evidence: ev_21b6bf56ea3b01fefafecdb673e392142538e12a995ac4070c4b8a8f1a26f59b in local/reports/combat-client-pass2-decompiles-9.json, and executor/gate ev_f28cc89d25d840908ea753e766d4e2d1a718ef5138b04f190e82062755593b1d in local/reports/combat-client-decompiles-19.json.

Maintained client reconciliation

client/game/kkr.dll/weapon_health.c records the pending ring slots for each attacker targeting a HealthDamage recipient. The snapshot already includes these received outcomes. At impact, sub_360AB5A0 consumes the original result, feedback and damage amount but omits its second HP debit. Later outcomes debit HP normally. Append, construction and destruction clear obsolete slot records. No result, animation state, native timer or ammunition value is synthesized or rewritten. The server publishes a quiet absolute HP update for accepted health stims during combat, after committing restoration, charge and user cooldown.

The red native regression reproduced 205 dropping to198 after a queued7 hit. The corrected regression covers repeated snapshots, another target, wraparound, a later real hit and immediate mixed-backlog drain. The read-only browser snapshot exposes real weapon queues without a separate memory probe. TestBrowserFirstAidQueuedHit and tools/client/test_first_aid.mjs create a controlled two-client scenario, right-click kit23314 or116629 while a real Leet result is pending, require healed HP before impact on both clients, then require both to retain authoritative HP after impact. They also check one charge, native lock rejection, no extra weapon result and unchanged server attack deadlines. Artifacts are retained under local/first-aid-queued-hit/; the final fixture uses level10 and raw Body Development55. This is controlled verification, not earned progression. The client correction does not establish historical server publication timing or close the broader HP prediction/observer audit.

Run the focused hardware-browser check with the normal desktop environment:

AO_GAME_TEST=1 go test ./server -run '^TestBrowserFirstAidQueuedHit$' -count=1 -timeout=10m -v

Startup delay and dual restoration

The complete original record116629 has ItemDelay294=2, Health27 and Nano214 endpoints5..7, user FirstAid123 lock40s and strict FirstAid>5. The full-catalog admission test finds exactly one additional supported definition when the nonzero-ItemDelay rejection is removed: this startup kit. Other unknown or partial effect contracts remain rejected.

Original KKR1004d780 reads ItemDelay294 and RechargeDelay210 and constructs an item-use action of type4 through10052630/10052550. The counter stores the integer centisecond amount and exposes seconds with a0.01 multiplier. Native100527c0 advances the action and sets completion bit0x20;1004d880 waits for that bit before executing the local use-completion callback. Thus value2 represents a20ms native action. These client observations leave original server publication cadence unresolved. Shipped-binary SHA-256 remains a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. REA evidence IDs are ev_c4b58f1606fdd6b1cc3fc8d61c4a44ca9f48697ffa8c964fd7364dc4d778e4a9, ev_e6916067edd620682135cb54f936ed6c60e177c4cb0a0d98d1bc5e503c6e9a87 and local/startup-first-aid/completion.json; complete inline records are retained in that directory.

The controlled startup WASM run in local/first-aid-queued-hit/20261102-093202-116629/ records a real8-damage result pending on both clients. Use heals authoritative192->197 and nano1->6, debits charges3->2 and sets the user's40s lock. Both clients observe197 with the unchanged result still pending and retain197 when it drains. The native damage text still reports8; attack deadlines and combat targets remain unchanged. Native repeat use is blocked and both trace error lists are empty. The case completes in21.41s. Go tests additionally cover self/friend use, strict skill equality, maxima, last-charge removal, exact charge/lock/resource persistence before success, and rollback/retry when any of the four significant writes fails.

Earlier prototype checks and delivery research

A native UI-consumer audit confirms that the discrepancy reaches both health displays. Local StatView100424d0 reads Health27 through the mode2 skill getter. Target indicators10062fd0/10065960 read the actor's HP mirror at+0x1b0, but ordinary setter1006e030 synchronizes that mirror with Health27 on each write. The retained combat samples show both157->149 after a queued8-damage impact; there is no independent authoritative health bar protecting the display. Native death entry instead checks Flags0 bit0x10, normally supplied by CharacterAction99. An incorrect zero alone does not establish false death. Full DDR/KKR evidence, exact consumers and a reproducible trace extraction are under local/starter-consumable-research/health-consumers/.

Startup First-Aid Kit116629 has the same delivery dependency. Its authored effects restore both Health27 and Nano214 by5..7, lock the user's FirstAid123 for40 seconds, require FirstAid>5 and explicitly permit combat. Supporting only its nano half or adding an out-of-combat restriction would change the item's contract. Its complete record was reverified against the original DB; see medical consumables.

The local prototype stores charge debit and a 40-second deadline in one atomic inventory write, restores the remaining lock on login, and supports ordinary living connected friendly players. Its uniform inclusive heal roll, full-health success and absolute lock persistence are reconstruction choices. Focused Go checks passed for skill and target rejection, replay, lock expiry, last-charge removal, clamping, failed-save atomicity, concurrent uses, friendly use during combat, mixed-template stack rejection and persistence. These are prototype checks, not completion of native integration.

Actual WASM right-click use reduced 25 charges to 24 and showed the native healing text. A second quiet use changed both server and native HP from 234 to 246 while charges fell from 24 to 23. An immediate repeat during the lock left quantity unchanged and sent no new GenericCmd; the client blocked it. No adapter crash or page exception occurred.

In a controlled combat use, the Leet already had an 8-damage result queued for the player. The server healed 145 to 157 and charges fell 22 to 21. The silent HealthDamage snapshot set native HP to 157 while that result remained queued. At impact native HP became 149: the same 8 damage was subtracted again. A server regeneration tick separately raised authoritative HP to 163. The queue and flat Health27 array were sampled read-only every 50 milliseconds; the earlier tree-based HP probe was invalid and is not health-verification evidence. See local/first-aid-smoke/combat-heal-trace.json and self-heal-verified-trace.json.

HealthDamage and StatIIR assign absolute HP. NanoAttack adds a signed delta, but announces nanobot damage rather than healing. StopFight drains queues while also clearing combat state and timers; it is not a neutral heal synchronization operation. No suitable additive healing message or coherent alternative delivery has yet been established.

A further bounded native pass checked base HP setters, snapshot loaders, attackable-item damage, maximum-health recalculation and the generic ActionIIR existing-effect route. That route handles poison-roll bookkeeping, without an HP write. Damage type 474 selects fall-damage text, so it supplies no healing exception to NanoAttack. The source audit and retained evidence are in local/reports/first-aid-health-write-source-audit.json and first-aid-health-delivery-1491-evidence.json in the same directory. Dynamic stat IDs and ActionIIR dispatch to a live SimpleItem's virtual method remain outside this negative result.

A subsequent bounded pass covered those two leads. SkillIIR 0x3e205660 activation at 0x10083d80 applies its dynamic stat/value pairs through the ordinary absolute setter. ActionIIR's live SimpleItem dispatch uses virtual +0x44, then 0x10097c30 -> 0x1009ed70, for lock, close, repair, trap and removal handling. The inspected base callbacks supply no new healing primitive. Twenty-two bounded activation call sites and 58 wider syntactic candidates also yielded no established additive health message. Complete data-flow coverage remains open. The ledger and 22 complete REA records are under local/healing-delivery-research/; SkillIIR evidence includes ev_f78b8b0e8d641d2187061bd6824639eb2e2872cdce64bffbb2f74cbdec9b5246.

A further original RTTI-backed audit accounts for all six distinct ActionIIR +0x44 callbacks across 18 primary SimpleItem-derived vtables in this KKR. The four additional targets handle corpses, mines, traps and weapon-item explosions; none establishes an additive HP writer or neutral weapon-result reconciliation. Their authored effects still use the common executor. The vtable identity is corrected: 10171fec belongs to Book_t, while SimpleItem_t's primary table is 10173d14. Full raw RTTI, exact evidence IDs and callback coverage are retained under local/combat-heal-derived-item-research/. This closes that enumerated override lead, while imported/missing-RTTI classes, other protocol routes and the historical server's timing remain unresolved.

The original AttackInfo/queued-impact timing contract and a correlated original-server combat-heal capture remain useful evidence. The authored combat-use rule still applies; this result does not justify delaying First Aid until incoming combat stops.

A controlled follow-up tested the weapon receiver's backlog branch rather than assuming every result waits for an animation. 0x1007a660 samples ring presence before appending; when a result was already pending, it immediately drains the whole ring through 0x1007a2e0 -> 0x100ab5a0. The native contract in client/tests/critical_result.c covers two real results, ring wraparound, and one/two zero results from empty and nonempty active rings.

Synthetic zero-damage results are not a neutral healing barrier. One zero drains existing damage but can itself remain queued when the ring was empty. Two zeros leave one zero when the first message drained an existing result. No fixed count guarantees an empty ring for both initial states. A queued zero counts as an ordinary outcome for animation/weapon effects, can release the player's recharge hold, and makes a later real result drain immediately. Zero-damage text suppression does not suppress these paths.

Two published WASM clients reproduced the baseline: a pending 7-damage result survived an absolute heal to 205, then reduced native HP to 198 while server HP remained 205. One zero removed an existing real result before healing; two zeros left a zero on both replicas. Starting in active combat with an empty ring, one zero remained queued and the next real 8-damage result applied immediately on receipt. Server attack deadlines and native targets stayed unchanged, but the damage-presentation timing changed. This rejects the candidate despite the narrow HP improvement; it is not enabled in production. Read-only samples, wire captures, screenshots and assertions are retained in local/weapon-impact-smoke/verification.json; full static evidence and the corrected candidate analysis are in local/weapon-impact-research/. The test browsers, temporary server and two owned characters were cleaned up, and the ordinary preview was restored on the default ports.

A further pass traced common message scheduling in the original llr.dll. AttackInfo and HealthDamage both use an immediately ready base PollStatus; their activations run in FIFO order before the frame's root update. The common remote-info base carries no execution clock or weapon-impact barrier. The Anarchy input throttle handles bulk snapshots, without waiting for weapon results. Batching messages cannot supply the missing ordering against future animation callbacks. Exact targets, procedures, evidence and limitations are in docs/research-notes/weapon-impact-research/common-dispatch.md; both owned sessions were closed. This excludes that specific lead, not every possible healing route.

Public implementation comparisons also leave delivery unresolved. CellAO's 2016 Hit implementation changes the base health stat and relies on an absolute dirty-stat flush; the inspected snapshot contains no weapon AttackInfo implementation to compare. AORebirth's 2026 heal path sends positive-change HealthDamage and suppresses a duplicate Stat update, without compensating for pending weapon animation results. These are emulator designs, not 14.9.1 server evidence. Pinned source details are retained in local/first-aid-smoke/protocol-source-followup.json; no correlated original stim/AttackInfo capture was recovered.

A contemporary October 2002 discussion describes using First Aid during weapon recharge and other actions being unavailable during attack. It does not establish queuing versus rejection, and concerns the user's own action cycle. It cannot justify waiting for an incoming opponent's animation to complete. Native ACK scheduling instead activates the item timer immediately and does not drain incoming queues.

The implementation patch, fixture, source ledger, timing follow-up, packets, screenshots and traces are retained under local/first-aid-smoke/. prototype.patch is preserved against range commit 06830a6, before the nano kit's shared First Aid stat, charge and lock support. Further work must resolve combat HP delivery and then verify friendly use, restart lock restoration and last-charge deletion in the actual WASM client before checking off the First Aid milestone. All test-owned processes were closed. The nano kit checks now provide a native team fixture for an eligible friendly recipient; an unteamed ordinary player is rejected locally by this client's ApplyFriendly gate.

The additional-module and capture audit covers seven IIR classes outside the original KKR name catalog, including JJR's inert Heal export, and the bounded historical-capture/period-footage search. It found no new usable delivery primitive or established original update cadence. The retained inventories and exact native evidence prevent repeating those specific leads; they do not establish complete protocol coverage.