aorecomp

Anarchy Online classic in the browser

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


docs/nano-learning.md (16379B)


Learning a nano in 14.9.1

The QL 1 Meta-Physicist startup crystal 43330 has item type 51005. Its OnUse event contains function 53019 with program ID 43324, Lesser Anger Manifestation. Other crystals and arbitrary qualities are not inferred from this endpoint. Acquisition uses the existing fixture grant.

Winter's Bite uses the same upload route for Bureaucrat crystal 29625 and program 29618. Its requirements and supported damage cast are documented in nano damage.

The QL 1 Doctor startup crystal 28778 uploads Improved Healing 28665 through the same atomic path. It requires effective Biological Metamorphosis above 8, Matter Metamorphosis above 6 and Doctor profession 10. Healing casts are still unfinished; catalog and delivery limits are in Doctor healing.

QL 7 Nano Crystal (Strength Boost) 27305 uploads QL 3 program 27169. It requires effective Biological Metamorphosis 128 greater than 34 and Matter Metamorphosis 127 greater than 40, with no profession requirement. Both skills use ability weights [0,0,0,80,0,20]. Sensory Improvement is stat 122 and is not a requirement. The original client's inspection window and skill registration strings independently confirm these labels. The upload action uses {27305,27305,7,1,3,104,sourceSlot,50000,ownerID}: the crystal's authored quality is distinct from its program's quality. Timed buff casting remains separate from learning; see temporary nanos. The other five basic ability Boost crystals and QL 4 Augment Strength now share this upload path. Their exact crystal/program IDs and qualities are tabulated there; each uses its authored LearnNano function and requirements.

Complete-contract admission covers 278 ability, health, skill, critical and regeneration crystals for 279 programs. Shijima's Cloak 31405 has no original ordinary uploader in the decoded catalog; no replacement crystal is invented. Both upload and casting use the shared postfix requirement evaluator, including the authored nano-skill/level thresholds and real or visual profession predicates. The full program, crystal and quality tables are in temporary nanos and skill nanos.

The Soldier startup Body Boost crystal29092/QL1 uploads29091 through this generic path. Its Unique flag variant matches the Doctor/Bureaucrat startup crystals; it requires BM>8, MC>6 and VisualProfession368==1. All eight complete health-buff additions and their original crystal qualities are listed in maximum-health nanos.

Requirements and character data

The Meta-Physicist crystal's Use action requires effective Matter Creation 130 greater than 7, effective Time and Space 131 greater than 7, and VisualProfession 368 equal to 12 (Meta-Physicist). The crystal has no pet-count requirement. That check belongs to casting the learned program. No additional server upload timer is inferred: the crystal has no authored attack, recharge or use-delay override.

The trained skills default to 5. Their shipped ability weights, in STR/AGI/STA/INT/SEN/PSY order, are:

Skill Stat Weights
Matter Creation 130 [0,0,20,80,0,0]
Time and Space 131 [0,20,0,80,0,0]

The native effective-skill calculation truncates weighted abilities multiplied by float32(0.01) * 0.25. With abilities of 10, trained 5/6 gives effective 7/8. The native initializer writes base 5 at 10072898 / 100728a4. First-party registration at 10038af4 / 10038b26 confirms the two names; these stat labels must not be reversed.

Character profiles persist profession, matter_creation and time_and_space. Missing fields retain the existing Soldier profession 1 and native skill starting values. The original twelve professions are accepted. Owner FullCharacter publishes real Profession 60 and VisualProfession 368 explicitly; visual profession defaults to zero in the native initializer, and no fallback to real profession is established. The supported state has no false-profession effect, so both values use the saved profession. Requested observer updates now use InfoPacket; the native reference description's effective-stat lookup discrepancy remains under investigation.

Native upload and consumption

A successful use sends these owner messages in order:

  1. GenericCmd 52526858, success state 1 and the original request sequence.
  2. UseTemplateAction 35505644, DWORDs {43330,43330,1,1,3,104,sourceSlot,50000,ownerID}.
  3. CharacterAction 5e477770, DeleteItem 112 for the source slot/template.

Native quantity helper 1005e790 debits once on the successful acknowledgement. The crystal has Count 26 equal to 1 and Can 30 equal to 0x29, including Eat 0x20. Reaching zero emits an ItemRemoved event; the separate DeleteItem path removes its proxy row. The crystal lacks UseEmptyDestruct flag 0x800.

UseTemplateAction 1005e980 constructs a fresh template, dispatches action 3 through 100902b0 to event 0, and runs function 53019. It does not debit the crystal again. Handler 100be540 checks learned-list helper 10064eb0, adds through 10064dd0 and refreshes the local program UI. A known entry produces native already-known feedback without another insertion. The server rejects duplicates before a successful acknowledgement, preserving the spare crystal. The original server's exact duplicate failure text is not established; no later protocol's upload action is substituted for this verified route.

The program list and crystal removal commit together in the world database. Failure publishes no success and changes neither state; an output failure after commit is recovered through the next FullCharacter. Program learning is private to the owner. Other players receive no learned-entry effect.

Durable learned-program validation

An ignored learned_nanos insert formerly returned SQL success while leaving the program absent. Crystal consumption then committed and all three native success messages were sent. The live owner appeared to know the program, but cold loading retained neither crystal nor learned entry. The controlled native baseline reproduces this with Doctor crystal ID2/program28665 in9.18 seconds; the database query records zero crystals and zero learned programs.

Inventory persistence now reads back the acting player's complete sorted learned-program set inside the transaction and compares it with the intended set. Missing, replaced or unwanted retained entries abort the transaction before item consumption or live state publishes. Comparison sorts a copy and does not reorder the in-memory list. The added check performs reads only; unchanged metadata and routine checkpoint write cadence remain covered by their existing SQL-trigger regressions.

Public Use checks exercise ordinary and contained crystals through an ignored insert, SQL failure, replacement with the wrong program, loss of an existing program and deferred COMMIT failure. Every failed attempt retains the exact crystal, previous program, allocator and cold ownership without a success packet. Retry consumes only its crystal and retains both programs. A control edit also checks ignored program deletion: ownership, credits and learned-set replacement roll back together and retry without changing another player.

The corrected native checkpoint passes in19.05 seconds. Its injected ignored insert retains all three bag children and publishes no success. It uses the existing database-error disconnect/recovery behavior, then page replay and real right-click Use learn Improved Healing once. Duplicate refusal retains the spare crystal, a same-window withdrawal retains the companion, and page replay/cold Go loading retain IDs1/3/4 and the learned program. This is controlled fixture evidence, not earned progression or an original-server failure-policy claim. Five complete native captures have no errors/drops. Independent packet/state audits and logs are under local/nano-learning-write/. Related normal checks pass58 roots/144 results in27.248 seconds, race checks pass17 roots/58 results in104.864 seconds, and maintained-package vet and driver syntax pass.

Learning from carried backpacks

Supported crystals now use the same learning transaction from page107. The source is a known session handle packed above the child slot; its bag must be carried and owned. A known closed bag remains a valid source. Authored upload requirements, exact crystal quality, supported-program admission and duplicate refusal are unchanged. Banked/foreign bags and unknown or out-of-range handles retain the shared owned-Use guards.

Learning clones the affected contents map/slice, consumes only the selected child and commits its removal with the learned program. The bag and other children remain owned. Success, UseTemplateAction and DeleteItem preserve the request's actual page107/packed position; an ordinary source still uses page104. Failed storage publishes no success and leaves the live contents untouched.

Original KKR quantity callback1005e790 explicitly resolves page107 through the Chest handle and debits its child. UseTemplateAction1005e980 executes action3 through the template, and LearnNano53019 handler100be540 updates the actor's program list. These paths establish the native contained upload/consumption contract; they do not provide a recording of every original-server policy. The original DLL hash matches the evidence above. New source-bound REA records are ev_8734c392a58b8613f98a50084dc344d08e0d3f9ca70fcd86c502d226e4f66560, ev_ef16356081561272f7408627ba96c97b766c43ece5c07c1c166debdd17258051 and ev_a13205c5898c003b488c0e79a6039fe235f60643754a667c4cae1cfc99b9b231, retained under local/backpack-nano-learning/.

Public-handler regressions cover Doctor/Meta-Physicist startup and Strength Boost crystals, open/closed bags, first/last/nonzero slots, authored requirements and duplicates. A forced child-placement deletion failure checks independent live map/slice and durable rollback with zero success output, then a one-time retry; both last-child and retained-companion cases cold-load exact ownership.

A controlled Doctor WASM fixture reproduces the former failure2 reply to a real contained-crystal right-click. The final check takes 14.72 seconds, displays "Improved Healing uploaded" and its Medical-tab icon, preserves the spare on a duplicate Use, and withdraws the companion through the same window. Page replay and fresh Go loading retain one learned program, both unconsumed instances and the bag. This verifies the upload protocol with controlled skills/location, separately from earned starting progression. Captures and verification are in local/backpack-nano-learning/. The focused Go and race runs each pass 15 roots and 62 results; vet and driver syntax checks pass. local/backpack-nano-learning/verification.json independently checks the exact packed action/removal, one native program entry before replay, duplicate refusal and final item ledger. The maintained driver also requires that Medical-tab entry before reconnect, so replay cannot hide a missing effect.

Reconnect layout

The native FullCharacter reader 1007f5b0 consumes inventory, an intermediate complex list, then the learned DWORD list at object offset +0x24. Its learned list uses count (N+1)*1009 followed by plain program IDs, not identities. Activation 1007f102 splices it into the actor's learned-program helper. Runtime program identity 53019:43324 is constructed separately by 100b4000. The catalog resource header's type 51051 is not the runtime nano identity type.

The shared-protocol converter inserts the intermediate empty list immediately after the inventory entries, at raw offset 44+32*inventoryCount. Its previous fixed offset included five subsequent list headers and only worked while all were empty. Supplying a learned list now leaves every following list and stat at its native position, including when ordinary inventory remains non-empty.

Evidence and scope

python3 tools/data/extract_nano_learning.py produces local/reports/nano-learning-14.9.1.json with selected records and skill weights. Crystal payload SHA-256: be4420aa89b25161bee7913c3279114e41b15067bf550df04bdc97b372f1f2f4. Program payload SHA-256: 8ededbebfc5cf5ff9e13dadb4fe6c73c629009c969ab0c747ef5bcff27230d56. The selected client/index and DLL hashes match vehicles.

local/nano-learning-research/crystal-native.json and native-program-protocol.json retain original bytes, source procedures, list readers and field names. REA evidence ev_24aa77ca0c925a090a16180a3fc48a2e611ef24c5ff1676599d7f1671f7daffb independently decompiles the original 53019 handler. Its retained snapshot is kkr-handler.rea.json; the native analysis session was closed afterward.

This summon program does not yet have pet creation or casting support. The native cast request and selected summon record are retained for that next step. The exact original PT50 pet definition, lifetime units and server policies remain unresolved in local/pet-research/.

Verification

TestNanoCrystal* reproduces the missing upload and checks atomic learning and crystal consumption across restart, native message ordering, owner-only publication, the learned-list layout, effective skill 7/8, profession, item kind/quality, foreign/stale/loading/dead sessions and save failure. Concurrent uses of two crystals retain the spare and publish one effect; a closed output after commit recovers through reload. TestNanoLearningLoadsDefaultsForOlderProfiles checks missing profession/skill fields.

Two WASM clients verified native rejection at effective Matter Creation 7 and for a Soldier with both skills at 8. After the existing character editor raised the Meta-Physicist's trained Matter Creation to 6, normal right-click use consumed crystal 501, displayed the native upload message and added program 43324 to the Space tab. Read-only native list probes found one entry. A spare crystal's right-click emitted another native use request, which did not consume it or insert another entry. A full server restart restored the same program, profession, skills, remaining crystal and unrelated three-charge First Aid stack. Repeating the spare crystal after restart was also rejected. The observer retained its own crystal and empty program list throughout.

The run passed 34 evidence checks in local/nano-learning-smoke/verification.json, with UI screenshots, packets, profile snapshots and read-only native probes. The program icon and tooltip were inspected after reconnect. Only expected connection refusals during the intentional restart were recorded. No client adapter changes were required. Both clients and the temporary server were closed before the full test runs.

The full go test ./server/... run passed (server 91.831 seconds). Five repeated race runs of the nano-learning, profile-edit persistence and native thirty-slot inventory tests passed in 180.874 seconds. Their logs are retained under local/nano-learning-research/. Restoring the previous converter offset through a temporary Go overlay makes the learned-list regression fail at its neighboring-list assertion, recorded in old-layout-regression.log.

Strength Boost's native check used one fresh Soldier and two authored QL 7 crystals. At effective Matter Metamorphosis 40, then Biological Metamorphosis 34, the client rejected use without a network command or consumption. With both skills at 41/35, ordinary right-click use consumed exactly one crystal and added one Medical program entry. Sensory Improvement remained at its starting base 5. Native inspection showed the authored Bio Metamor 35 and Matt. Metam 41 requirements.

The spare crystal sent a request that the server rejected without consumption. A full server restart restored exactly one program 27169 and the spare QL 7 crystal. A second duplicate request after restart was also rejected. The wire contained one success, two rejections and one QL 7 template action. Read-only native probes and SQLite agreed. There were no page or adapter errors; the test client, character and spare item were cleaned up while preserving every other database row. Captures and assertions are retained in local/strength-upload-smoke/verification.json.