aorecomp

Anarchy Online classic in the browser

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


commit 4c434ca116c897d665acb6cefc7aeff616082f25
parent 92ecad46f08d54f8fd179eacb516e0190090a284
Author: anon <anon@example.com>
Date:   Thu, 22 Oct 2026 07:37:19 +0000

Document native XP updates and progression protocol evidence

Diffstat:
MTODO.md | 3+++
Adocs/character-progression.md | 121+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdocs/combat-client-reconstruction.md | 1+
3 files changed, 125 insertions(+), 0 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -173,6 +173,9 @@ current policy limits are recorded in [corpse and loot protocol](docs/corpse-loo - [ ] Enforce one skill/title cap boundary. Check: the final permitted increase succeeds and the next is rejected without spending IP. +The recovered XP update and level-up handler, controlled WASM checks and +remaining reward-rule gaps are recorded in [character progression](docs/character-progression.md). + ## Usable items - [ ] Use one First Aid item. Check: it restores the expected health, consumes diff --git a/docs/character-progression.md b/docs/character-progression.md @@ -0,0 +1,121 @@ +# Character progression: 14.9.1 protocol evidence + +Kill XP, level advancement and IP spending remain unimplemented. This report +recovers the native presentation contract; the replay values below are test +inputs, not historical creature rewards. + +## Absolute XP updates + +The 14.9.1 `kkr.dll` stat reader `sub_360B2E10` reads two network-order +integers: stat ID, then absolute value. `sub_360B2E60` applies the update and, +for the local character's XP stat 52, computes the difference from the existing +value. It sends that signed difference to `sub_3601D0B0` as event 35. A positive +difference produces the native XP-gained text and yellow floating number; +a negative difference produces the XP-lost text. A zero difference produces +neither. Repeating an absolute total therefore does not repeat its XP gain. + +The existing server `0x2b333d6e` stat packet reaches this handler. Its N3 owner +identity is 50000/character ID, and the body contains exactly two uint32s. +For example, `00000034 00000032` sets XP to 50. An additional server-generated +chat message would duplicate the native notification. + +The relevant native stat IDs are: + +| ID | Native name | Meaning established here | +| --- | --- | --- | +| 52 | XP | Current XP total supplied by the server | +| 53 | IP | Available improvement points | +| 54 | Level | Character level | +| 57 | LastXP | Separate value supplied by the level-up handler | +| 275 | XPKillRange | Separate value supplied by the level-up handler | +| 350 | NextXP | Denominator displayed by the native EXP bar | + +`FullCharacter` already supports stat-list entries, so initial XP belongs in +the character initialization as well as later absolute updates. The current +server supplies none of these progression values except Level. Live stat +updates used for this research do not persist through reconnect. + +## Level-up handler + +`sub_3607FE30` reads eight uint32s. `sub_3607FF00` applies them in this order: + +| Payload offset | Destination | +| --- | --- | +| 0 | Level 54 | +| 4 | IP 53 | +| 8 | XP 52 | +| 12 | LastXP 57 | +| 16 | NextXP 350 | +| 20 | TitleLevel 37, when positive | +| 24 | XPKillRange 275 | +| 28 | Signed XP notification delta | + +For the local character it refreshes the XP/IP state, displays the new level +and invokes the native level effect. Its effect reference at object offset +0x40 is initialized by `sub_3607FD90`; it is not a ninth wire integer. +The handler alone does not establish the message key, level threshold table, +resource refill policy, XP cap, or original reward calculation. Those require +further evidence before implementation. + +## Controlled WASM verification + +The normal published WASM client received these packets from an isolated +temporary server. Setting NextXP to 1450 supplied a known denominator; Ctrl+9 +opened the native Stats window for visual checks. + +| Absolute XP sequence | Native result | +| --- | --- | +| 0 to 50 | One 50 XP gain; EXP 50/1450 | +| 50 to 50 | No additional gain; EXP remains 50/1450 | +| 50 to 25 | One 25 XP loss; EXP 25/1450 | +| 25 to 100 | One 75 XP gain; EXP 100/1450 | +| 100 to 1000 | One 900 XP gain; EXP 1000/1450 | + +Page reconnect returned EXP to 0/0 because the production initializer has no +XP or NextXP entries. Supplying NextXP 2000 and XP 1000 then displayed +1000/2000. The denominator is server-supplied, not recovered from a client +level table by this path. + +Screenshots, packet logs, the isolated fixture and the REA evidence bundle are +retained under `local/progression-smoke/`. This checks native packet activation, +text, floating feedback and bar state. It does not prove a combat award, +eligibility policy, durable XP, or a level transition. + +## Historical rules and remaining implementation + +The shipped `cd_image/text/help/combat.txt` says combat awards XP toward the +current level and a level grants IP. `Improving skills and abilities.txt` gives +4000 IP at level 2 and 20000 at level 50. These are direct 14.9.1 help resources. +They do not specify a creature reward or the full level-threshold table. + +The local wiki scrape has no Experience or Level Parameters page. Its Leets +page gives weapon leads but no XP reward; see [NPC balance evidence](combat-npc-balance.md). +The later CellAO `XPTable.TableRKXP` starts with 1450 and 2600 XP requirements, +but a later emulator table is insufficient to establish a 14.9.1 rule. + +Next implementation needs an explicit creature reward and eligibility policy, +atomic persistence before publishing the award, and a single death transition +that cannot award twice. Tests must cover competing attackers, dead or departed +players, failed saves, repeat ticks, initialization, reconnect and restart. +Level advancement must coordinate XP, IP, level, title and derived resources +in one durable change rather than leaving the native bar above its threshold. + +## Retained evidence + +The selected relocated `kkr.dll` has SHA-256 +`241b2e665dcd127399b7686cddda8a5b0876d9cde9b3af7a73940dd0b86ecaa7`. +Addresses above match the maintained C; the original image uses base 0x10000000. +The retained REA records include: + +- `ev_71de25ca97028cbe39246931e9796ac1611d0f0ef2af8cb2273a2cb0e6ec3d1b`: + native XP text and floating-number dispatch. +- `ev_c6f3c07ad85e3320e8c3470983fd7013fbd6e63efcf372dce38cbed5f5b2e15c`: + level-up handler and its stat destinations. +- `ev_ab7d10f59d50dc04cc9963ad3caa75ba4cd59700fa653ca0af8772e1ba6ba72f`: + absolute stat handler, including the XP difference calculation. +- `ev_0f7196988995b41fc8562c622169040afd8288fc6e0f700820d1aa83abf8f2fa`: + stat-name registration, including XP/IP and the named progression stats. + +Other handler decompilations are included in the same local bundle. Static +analysis establishes branches and field use; the controlled browser replay +separately establishes activation of the absolute-XP path. diff --git a/docs/combat-client-reconstruction.md b/docs/combat-client-reconstruction.md @@ -65,6 +65,7 @@ unknowns for each area: | Current server | Implemented behavior versus recovered rules and unresolved authority | Coverage ledger below | | Resource synchronization and editable stats | Persistent base stats, derived resources, posture, recovery and safe correction timing | [Regeneration implementation](combat-regeneration.md) | | Creature balance research | Local wiki search, shipped Leet Bite endpoints and historical HP gaps | [NPC balance evidence](combat-npc-balance.md) | +| XP and progression | Absolute XP updates, level-up handler fields and unresolved reward rules | [Character progression](character-progression.md) | ## Current server coverage