aorecomp

Anarchy Online classic in the browser

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


docs/nano-weapon-timing.md (7038B)


Nano execution and ordinary weapon timing

Ordinary nano casting can interrupt a weapon attack that has not landed. The interrupted windup restarts from its full attack delay. If the weapon is already recharging, its remaining recharge is suspended rather than spent by the cast. Nano recharge itself permits ordinary weapon attacks.

These rules use the shared casting and combat paths for all admitted programs; there are no program-ID scheduling branches. A successful reservation publishes one preemption. Repeated cast requests, target changes, and stopping/restarting combat cannot spend the suspended recharge or preserve partial windup.

Evidence and boundaries

The matching original client controller uses actor+184. Nano admission through 100650f0 allocates a category 3 timer with10052630 and preempts the active timer through100529a0. A preempted attack loses its partial progress. Controller tick 100527c0 returns before its recharge scan while another attack timer remains active, preserving the weapon's remaining recharge. Abort108 removes the owned nano timer through10066690 ->10065420 ->100526a0. Queued weapon results remain independent server-supplied damage;10079250 can drain results already received. A visible impact during casting therefore does not establish a new server shot.

The retained original Evidence IDs include ev_54c8e5911c3ccf91ab6ce87b5b2df8506f06ab9850e3ae78da5b0cb38fc13d7c (controller operations), ev_9081c9ee969a3f64c9cfb5aec6a5d90477aa638090d6ed38e5791a3d0d58eeda (nano queue), and ev_839516fbf9737749e969200bc7698259fa6decf43f39b3025dc440c60acd95f3 (weapon stop). The ledger and 38 checked source/extract hashes are under local/cast-weapon-research/controller/. Original KKR SHA256 is a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. No new binary session or export was used.

The public native request path10022180 ->100646a0 has no ordinary weapon-phase veto. Its busy test1006473f reads casting/activity state10071ad0, not the weapon attack/recharge timer. This supports admitting casts during weapon windup rather than imposing a recharge-only gate. A March 2002 player report on the official forum describes a new nuke interrupting an unfinished weapon shot. October 2002 discussion distinguishes actions during recharge; a May 2003 report corroborates that NanoC Init changes execution but not nano recharge. These are contemporary player reports, not Funcom server specifications. Retained web extracts and their retrieval/date limitations are in local/cast-weapon-research/period/.

Server reconstruction

The server suspends weapon timing for the admitted execution window, clamped at zero for instant nanos. It adds that duration to any remaining weapon recharge, then schedules a full attack. A new fight started during execution uses the same window. An early successful cancellation removes only the unused pause. Cancellation after that window leaves the already resumed weapon clock alone. No additional attack or recharge starts merely because nano completion or a cancellation was processed late.

Admission prepares weapon clocks on the detached caster and publishes them only after its durable nano reservation succeeds. A failed or ignored update or a failed COMMIT changes no weapon clock and sends no admission. A failed refund retains its reservation and cancellation state. Its retry deadline may move; its original weapon window does not. This keeps stopping/restarting combat from accidentally substituting a refund-retry deadline for cast execution.

The native temporary controller and nano queue are distinct clocks. Its integer controller duration omits the queue's AggDef subtraction. Queue completion107 releases an effect gate but does not itself remove the controller; queue expiry or abort can remove it later. The server execution-window policy above does not claim to reproduce every resulting animation-timer discrepancy. Exact original server scheduling across AggDef, short nano recharge, late107, simultaneous reload/other controllers and failure timing remains open. The retained client controller alone cannot establish authoritative packet timing. Specials and incoming-hit interruption probabilities remain separate unfinished contracts.

The queue also requests base AggDef51 in getter mode2, then applies signed integer division by100. Weapon timing requests effective51 in mode0, including worn modifiers. Those modifiers do not change the nano queue duration. See AggDef timing modifiers for the maintained source paths and complete weapon catalog checks.

Verification

server/nano_weapon_test.go exercises windup preemption, remaining recharge, duplicate requests, stop/restart attempts, early/late cancellation, reservation FAIL/IGNORE/deferred-COMMIT failures, failed-refund retry, instant execution and ordinary attacks during nano recharge. Existing casting, reservation, outcome, reload and special regressions also run against the shared paths.

The full server/data-exporter run passed 8,064 tests/subtests in 1226.964 seconds. The focused combat run passed 213 checks; 208 race checks across two repetitions, vet and the preview build also passed. Assets and the exporter have no tests.

Two headed GPU WASM clients uploaded the original crystals and used the native program window during ordinary pistol combat. Read-only samples show partial 224cs weapon windup resetting to 224cs at category3 preemption. The first shot arrived 4.569 seconds after admission, after execution and a full windup. A recharge cast lengthened the shot interval to 6.278 seconds. Movement cancelled another cast after 0.667 seconds, restored exactly 44 nano in the native samples, removed its temporary timer and shortened the shot interval to 4.744 seconds. Both observers then showed the same 59 HP NPC and the unchanged existing buff. Ice Flechette supplied the longer recharge check: a pistol shot arrived 1.754 seconds after completion, 742ms before the committed recharge deadline, while the native nano queue remained in phase2 with its finish gate released. Both clients also installed its authored initiative child. No WASM errors occurred.

Snapshots also expose the native held-recharge flag0x20 and its dependence on supplied results/animation. These samples support the phase rules and the server's measured cadence; they do not establish every original animation or packet-delivery boundary. The corresponding fidelity TODO stays open. Captures, complete packet streams, native/SQLite snapshots and the assertion script are retained under local/cast-weapon-smoke/. Gameplay used GUI input; no gameplay request injection, native calls or heap writes were used.