aorecomp

Anarchy Online classic in the browser

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


docs/research-notes/nano-dot-research/native/README.md (10701B)


Original 14.9.1 periodic functions and action177

TickInterval is in centiseconds; TickCount is an execution count. The original client does not execute periodic Hit53002, including hostile DoTs, through action177. The generic admitted-function queue provides evidence for delayed first execution, but cannot establish the original server's DoT first tick, phase, recast rules or scheduling precision.

This is bounded REA skill Step 6 static work using matching retained Evidence and maintained instruction lifts. No new binary open/export, runtime, DB, production edit or REA session occurred. The earlier automatic approval rejection of a fresh binary open was respected without retry or workaround.

Identity and complete records

The original target is anarchy-vanilla-14.9.1/kkr.dll, SHA-256 a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. Every record in retained-evidence.json identifies that hash. Original addresses use base10000000; generated C uses base36000000. Generated C is an instruction lift, not original source. sources.json gives source ranges, exact file hashes and complete function-extract hashes. provenance.json links the 25 complete reused records to their retained bundles and bundle hashes. Address-named text files are conveniences; the complete Evidence records retain provider limits.

Contract / original procedure Complete reused Evidence ID
Common apply10002370; queue insert100027e0 ev_21b6bf56ea3b01fefafecdb673e392142538e12a995ac4070c4b8a8f1a26f59b
Queue visitor100021f0 ev_700456d500ded1b651bc8f770dbe843118f6c6286ca349ae445f40ef86a4e8c5
Gate100bfb40; execution100be8e0 ev_f28cc89d25d840908ea753e766d4e2d1a718ef5138b04f190e82062755593b1d
Unreachable Hit handler1010def0 is ret4 ev_b36e6b8b14d9f960dd1705c8d5cd0779c3be3306d575aa456b07008bdb956f40
SimpleChar update1006ea50 ev_9df66de8d0f05217a69046147043bfd7e0d2bd2483793a59a51bb25b74be2ca0
GameTime1000c3c0 ev_b222a29a2449ed800e75228fac8a9ad597f8c73dce740b461b7fae780389796b
Action177/65 dispatch1006fa30; add10066010; inverse10065b90 ev_a760dfc116df1dd38b0619334130d916b7706ee29c64a535cdef16ed448295a6
Add10066010 original assembly ev_86e17289b115cdde8ecfc9574a926b958c070428196b47bcdbcb9a1a17d21144
Active record10065ac0, remaining100662c0, replacement10066c80/10066d40 ev_c3c599190c5c536182443fd9804afc7109d4a067408ab38953ed2717671edb89
Duration record10065ac0 original assembly ev_dbbcdc0a8339f2423c88e365d0d4a0e709e4f08cb2695c26780e6f053d3aa907
Remove10064ee0 ev_fd418e8113e0801a8672f3678b360186cf1bfd74a85b261dce39b79eade66941
Inverse/remover direct caller inventories ev_d51d296485f8cb2f637924d0bd58366a4d1ec5972e8a77f413b881bbfae02da6, ev_6fa92665eac5d5221da07f3c081a969bc0fcc1b8b81a7c0390f6f2b342e8b435

Generic ordinary-function scheduler

The following is the ordinary positive-count path. TimedEffect53014 has a separate duration/flag branch and is outside this ordinary DoT contract.

  1. Common apply10002370 clones each authored function using100bfc30, assigns source/caster identity and addition/removal mode, then initializes100bd340. Initializer100bd349..350 loads argument3 into instance+8 (unless already-1); 100bd359 clears elapsed float+0xc. Argument lookup100bd190 follows resource instance+18, argument map+c, returning the value or-1 if absent.
  2. Count>1, interval argument4>0, or TimedEffect selects category9 queue insertion100027e0. This appends the clone and does not execute it inline. Otherwise common apply invokes100be8e0 immediately. The iterator visits the whole authored list; there is no one-function-only restriction here.
  3. Visitor100021f0 visits the character Beholder's queue at+20 and invokes 100be8e0 on each clone. It then releases/erases clones whose count+8 is0.
  4. Executor100be8e0 first gates the function ID. For admitted IDs with nonzero count, failed criteria decrement count once and return before timing. Passed criteria add200.0 to elapsed+0xc and compare argument4 <= truncated elapsed. When qualified, ordinary execution resets elapsed to0, decrements a positive count once and dispatches once. Overshoot is discarded; there is no interval-subtraction or catch-up loop.

Complete maintained ranges: lifted-0000.c:6323..6744 (common apply), :8669..8694 (insert), :6063..6282 (visitor), and lifted-0056.c:2057..2176 (argument getter), :2388..2422 (initializer), :11528..11586 (clone), :6086..11321 (executor).

The count is dimensionless. Interval units are established from actual timing operations, rather than names: SimpleChar1006ea50 at1006f0ff..1006f109 enters a block only on GameTime+1d and calls visitor100021f0 at1006f74c. GameTime1000c3c0 accumulates the normal unscaled frame delta, advances its one-second pulse at+30+1.0 <=+28, and alternates+1d/+1e on successive pulses. The character queue thus nominally advances every2s by200 interval units: 100 units/s. This is client-wide clock phase, not a per-program clock. Under lag the clock does not loop to replay every missed pulse. Sources: lifted-0033.c:4962..7001, lifted-0004.c:470..767.

For an admitted ordinary function, interval500 means elapsed200,400,600, execution on the third visitor, reset0; interval750 qualifies on the fourth visitor at800. No execution occurs at insertion. First elapsed wall time also depends on the shared visitor phase, so this is not a general exact-interval or exact-first-delay timer. These examples are consequences of the client queue, not historical server DoT schedules.

Field terminology is corroborated by retained original resource85232 Insurance Hack: count40, interval500, TimeExist20000, Hit53002 [27,26,63,0], flags10002. authored-heals-original.json preserves the complete decoded record and payload hash486dbf898d2287dc7cb683aecc7d5d77a7dd10fd57a9294e78b946f1309f8059. The resource decoder reads count/interval words in tools/data/extract_items.py:134..135. This is generated catalog evidence; the original resource parser/factory's serialized-word-to-map insertion was not independently recovered in this bounded pass. Runtime argument3/count and argument4/comparator mapping are established directly above.

Why hostile177 does not run periodic HP damage

Gate100bfb40 switches on function ID alone. Hit53002/cf0a returnsfalse for all polarities, endpoints, tick counts, source identities and local/remote victims. Executor100be8e0 then clears remainingCount+8 and returns before criteria, elapsed accumulation or dispatch. A queued hostile Hit is discarded on its first visitor. Even the unreachable subsequent cf0a dispatch calls 1010def0, an empty ret4 stub. No first or later damage tick can occur here.

Action177 is nevertheless more than an icon operation for admitted functions:

recipient envelope = (50000, targetCharacterID)
action = 177
A = (53019, programID)
B = (casterCharacterID, durationCs)

1006fa30 constructs caster identity50000:B.type and calls 10066010(A,B.instance,1,1,casterIdentity,1). Zero duration returns. Nonzero duration loads the original program. BuffNano10000 admits its action4/action0 containers through common apply10002370, plus active record/visual and local icon work. Hostile8000 suppresses used-NCU180 accounting, not execution of admitted functions. NPC and remote-player representations still receive the effects; the local-character byte gates icon work. Thus a server must deliver HP results separately; sending177 alone is insufficient for a DoT.

Refresh, countdown and removal

177's add path obtains effective strain75 and NCUcost54.10066c80 finds an existing same-strain record with cost<=incoming and removes it before applying the new one. Equal same-program replay consequently removes/reapplies and restarts the active record's time.10066d40 is the separate stronger-program test used by ordinary casting;177 does not itself invoke that rejection test. These are native consumers, not a proof of original server recast admission.

Active record10065ac0 stores identity+0/+4, start+8 as trunc(normalTimeSeconds)*100, effective duration+c/+10 as trunc(durationCs * actorStat464 * .01), visual handle+14. Remaining getter 100662c0 returnsmax(0,start+duration-trunc(nowSeconds)*100): it is quantized to one second despite centisecond units. Visual duration uses durationCs/100 whole seconds. Duration zero is not defaulted from authored TimeExist by177.

Countdown reaching0 does not establish automatic active-program removal. The inspected full SimpleChar update has no active-record expiry; retained direct callers route inverse10065b90 through10064ee0, called by replacement or CharacterAction dispatch. This is bounded coverage, not a complete indirect-call proof. Use action65 for explicit removal of the installed record, with victim envelope and A=(0,0), B=(casterCharacterID,programID). Membership guards inverse effects and NCU reversal, so duplicate removal does not inverse twice.

Removal also clears generic queued function clones before inverse application. Original retained vtable bytes inoriginal-instruction-windows.json establish Beholder vtable1017139c+2c =10002ca0 and+34 =10002370. Maintained complete 10002ca0 (lifted-0000.c:9436..9656) gets category9, iterates authored functions, and releases/erases queue clones whose instance+4 equals the authored function's +4. This is a key comparison, not source-caster matching.10065b90 calls+2c for action4/action0 before reapplying their inverse via+34. Refreshed admitted periodic functions therefore receive fresh initialized counts/elapsed; the shared GameTime phase continues. A periodic inverse is forced to count1 by common apply and remains queued. None of this resets an original server's Hit scheduler, which this client does not implement.

Reconstruction boundary

Supported: parse ordinary count/interval; interval750 =7.5s;177 installs the native active record/visual; explicit65 removes it; separate server HP delivery is required for each Hit result. Do not add a second local HP execution for177.

Unproven: original server's first tick immediate/delayed, rounding or shared phase, ordering of final tick/removal, refresh preserving/resetting damage phase, recast resistance/stack policy, offline progression and death persistence. Implementing descriptor-sized intervals with first tick after one interval is a defensible explicit reconstruction inference; the generic queued-first path supports that choice only weakly because actual Hit cannot enter its timer. No canonical server scheduling change follows from this native convenience.