aorecomp

Anarchy Online classic in the browser

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


docs/remote-combat-stats.md (7074B)


Remote player combat foundations

Player snapshots send six raw abilities 16..21, trained initiatives 118/119/120/149 and base AggDef 51 after the compact actor spawn. These are the same foundations as the owner's FullCharacter. The native getters add ability trickle and the separate equipment/nano modifier map. Sending effective values here would count those contributions twice.

World entry includes server/world.go:playerCombatStatPackets for an existing peer that has finished loading. New, replacement and still-loading players publish these foundations after CharacterReady, before their equipment and active-nano replay. Sending them immediately after a replacement compact spawn can leave the loaded native actor with default foundations. The owner still receives its FullCharacter; the NPC interest path retains its separate combat-profile packet. Replacing an existing visible actor still removes the old actor before spawning its replacement, and repeated ready notifications do not replay the foundations or equipment modifiers.

Accepted slider changes publish one ordinary StatIIR 51 to every ready client in the player's playfield, including its owner. Ready loading observers already have the actor snapshot queued, so they also receive subsequent changes. Other playfields and sessions without a queued world snapshot receive nothing. The signed slider foundation remains within -100..100; equipment/nano modifiers remain separate and can take the effective sum outside those bounds.

Accepted skill training already broadcasts all 75 raw ability/skill foundations through SkillIIR, including the four initiatives. It needs no additional copy of these eleven spawn updates. Training rejection and unchanged batches continue to correct only the requester.

Native receiver evidence

The maintained client/game/kkr.dll/lifted-0053.c:sub_360B2E60 StatIIR receiver resolves the actor and calls lifted-0034.c:sub_36075DB0. That helper immediately invokes the raw setter before its optional training-draft snapshot bookkeeping. It preserves the additive modifier map. Draft cancellation through 741E0 is not an incoming-stat delivery gate.

SkillIIR's lifted-0038.c:sub_36083D80 applies every map entry through the raw setter before its local Skills UI guard. Compact player spawn cannot supply all eleven foundations: its physical abilities do not replace Intelligence/Sense/Psychic, the initiatives or AggDef. AttackIIR carries a target and mode; attack results carry damage, ammunition and result data rather than these foundations.

These receiver capabilities and the reconstruction's observed divergence support the current snapshot design. They do not establish the original 14.9.1 server's recipient, packet-order or scheduling policy. Retained source blocks, original evidence references, hashes and bounded searches are in local/remote-combat-timing-research/, including training-followup/.

Active timer discrepancy remains open

Two headed GPU WASM clients with deliberately distinct abilities 31/37/41/43/47/53 and trained initiatives 73/0/91/0 agree on all eleven raw foundations and Tium 124210's separate worn modifiers. A fresh fight at slider 0 produces 190/196cs in both clients; a fresh fight at slider -100 produces 290/296cs.

Changing the slider during an existing fight exposes a separate native cache problem. Across 250 read-only samples per client, both receive raw 51=-100 and retain modifier 51=5. The owner adopts 290/296cs while the observer keeps 190/196cs. Receiving the correct stat does not establish that the running observer timer has adopted it.

A second 250-sample capture per client uses the final readiness order, trained RangedInitiative 2 and a fresh magazine. A delivered hit confirms combat before the slider moves from -100 to 100. Both clients retain raw 51=100 and modifier 51=5; the owner's running timer becomes 100/100cs while the observer still runs at 289/295cs. Cold restoration, owner reconnect and a fresh defensive fight all agree on the foundations and 289/295cs before this live change.

An active-update check must confirm a delivered weapon hit and a running controller after the slider change. An empty magazine can stop combat while leaving cached durations visible; those idle samples do not reproduce the live issue.

The complete maintained raw setter lifted-0033.c:sub_3606E030 calls 7AB10 for nonidle stat 51 before storing the new foundation. Its recalculation therefore reads the old value. Common refresh 714A0 and the subsequent stat-notification receiver 04180 have local-actor guards. Ordinary StatIIR returns after 75DB0 with no later remote refresh. The bounded direct-call audit found no neutral remote packet that stages updated durations for the existing timer.

Genuine additive 51/118/119/120 application/removal recalculates active duration fields after changing the modifier map. Effect 53153, equipment binding changes and AttackIIR can initialize remote timers, but also reset remaining time, registration, flags or weapon state. They are not interchangeable with a stat update. The server does not synthesize effects, duplicate stat assignments or restart attacks to force this animation cache to change.

Original-server evidence is still needed to choose the correct active-update contract. The full direct-call census, 45 selected maintained function blocks and the captured discrepancy are retained in local/remote-combat-timing-research/active-refresh/. Native captures and read-only probes driven only by normal GUI gameplay are in local/remote-combat-stats-smoke/.

Verification

The focused Go regressions cover raw values with separate modifiers, zero trained initiative, signed/invalid sliders, loading/new/replacement observers, readiness and effect order, repeated readiness and different playfields. Real browser expiry, native dialogue and movement tests consume and verify the new snapshot before asserting subsequent session messages. Resurrection reconnect checks distinguish the other player's snapshot from changes to the dead player's stats and still reject premature resurrection.

Two headed GPU clients verify 18 final-build foundation/modifier states, 1,000 valid active-timer samples and 23 matching shot pairs. Native training accepts RangedInitiative 2 for 6 IP; cancellation preserves that accepted state. Cold restoration retains the same rifle and its four remaining rounds. Removal returns that instance to ordinary inventory, clears its three worn modifiers and retains Strength Boost; reconnect and rewear preserve identity without duplicating effects. Wire checks establish ready-before-foundations and foundations-before-effects across replacement. Owned shot damage agrees with the NPC's durable HP and contribution total.

The verification excludes a failed trace-collection expression and an idle exhausted-magazine sample. Test clients and owned fixtures are removed; cleanup preserves unrelated rows and passes SQLite foreign-key/integrity checks. The single shared HTTPS 8443 preview remains available.