aorecomp

Anarchy Online classic in the browser

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


docs/character-creation.md (19787B)


Character creation

Native browser flow

Options' "Create character from scratch" starts an unnamed creation attempt and launches the original translated ddr.dll creator with character ID zero. Its breed, appearance, profession and naming scenes use the original models, controls and camera paths. At the native naming step, an HTML modal collects the character's login name and password, with a second password field to confirm the entry. Its only button is OK; mismatched passwords stay in the dialog without a server request. The modal makes the game controls inert, including Randomize, and captures keyboard events before they reach the game. POST /browser-create validates the name and attaches a salted password hash to that same creation attempt in memory. The packaged CharCreateCamera.dat is exposed in the browser's game directory alongside the other root assets. The guest CRT implements ungetc for the native C++ camera-file parser, including buffered pushback, EOF reset and text positions. The guest CRT also supplies the ASCII case conversion and classification used by breed selection and the original name validator.

The creator retains a 1024x768 backing surface and fits that 4:3 image inside the browser viewport. Its original ddr.dll::sub_2B037910 constructor caches screen dimensions in each scene, and sub_2B032DA0 scales creator sprites against 1024x768. Resizing only the shared framebuffer leaves those cached scene layouts stale. The creator renderer remains alive after ddr.dll::sub_2B02DF70 clears its current scene for the ending animation. The 4:3 lifetime therefore follows the renderer through sub_2B02DE30 shutdown; normal responsive world rendering resumes afterward.

The canonical name comes back in the credentials response. On OK, browser_resolution.c sets the original TextInput_t and invokes NameScene::StartServerCreation (sub_2B033CB0), the same path as Finish button 101 in sub_2B0338B0. The modal stays open until the native naming controls are disabled, preserving the input block during that handoff. Native validation and the ending animation remain intact. The server rejects a different final name and returns the prepared name for any native random-name request.

tests/e2e/mobile-creation.test.mjs exercises touch selection in a phone-sized Chromium context, enters credentials at the naming step, checks that native clicks and keys are blocked, rotates between portrait and landscape, and checks the created name and starter inventory on the server. It also checks refresh before/after creation and that world rendering returns to the full phone resolution. Browser emulation verifies focus and text delivery; the physical phone keyboard still needs device testing.

The browser routes the creator's login connection to browser-create, using the existing browser cookie for authorization. server/native_creation.go handles the native challenge/login exchange (0x22/0x24, 0x25/0x0e), random names (0x55/0x56), creation (0x0f with success 0x11 or refusal 0x10), and character selection/world redirect (0x16/0x17). Version-4 character data supplies the name, breed, sex, profession, build, height and head ordinal. The server resolves that ordinal within the selected breed/sex catalog, then uses the shared creation validation and starter-item backend. The decoder accepts the native variable-length area and ban-reason strings before the head/height/build fields; a captured creator packet is retained as a protocol regression.

One transaction saves the new character, password credentials, starter items, identity counters and browser ownership transfer. Only a successful commit publishes the new player and acknowledges creation. Repeated submission on that connection returns the same identity; a competing connection cannot reuse the previous credential to create another character. Refused names and failed commits preserve the previous session. A normal page launch cancels unfinished preparation under the same server lock used for finalization. Refresh before commit returns to the previous character and rejects an old creator socket; refresh after commit opens the new character. The one-time ?create=1 flag is removed before asynchronous client loading, so refresh never repeats the creation launch. Unfinished preparation is discarded on server restart. Save an unsaved visitor first to make it accessible after creating another character.

Successful creation places a neutral character in Arrival Hall 4604. The original creator's final world handoff remains in the same client instance. At the frame boundary after ffr.dll's s_nCharID changes, the browser mounts the new character's persistent preferences directory and seeds first-run settings before world entry. Inventory layout and other native preferences therefore persist from the initial session. When browser storage is denied, the same directory layout uses the existing temporary storage fallback. Faction selection, deferred maps/gifts and the training-ground departure are described in Arrival Hall.

The chosen name and password enable login as soon as native creation commits; there is no separate Save step. Passwords are not kept in browser storage or URLs. Cancellation does not delete an existing saved character or change its password.

Starting attributes and appearance

Creation reads the six ability baselines directly from the original 14.9.1 breed training data in server/gamedata/ip_training.yaml. Resource type 1000027, identities 1 through 4, contains the breed ID followed by six starting values and six breed maxima. tools/data/extract_ip_training.py retains the payloads and hashes in local/ip-training-research/resources.json.

Breed Strength Agility Stamina Intelligence Sense Psychic
Solitus 6 6 6 6 6 6
Opifex 3 15 6 6 10 3
Nanomage 3 3 3 15 6 10
Atrox 15 6 10 3 3 3

The local Fandom mirror's Abilities page agrees for Solitus and Atrox but differs on four entries: it lists Opifex Stamina/Psychic as 3/6 and Nanomage Sense/Psychic as 4/15. Creation uses the original resource values above. That page was touched in 2015 and includes later content; it does not establish every original-server creation rule. The snapshot and comparison script are in local/character-creation-research/abilities.json and tmp_verify.py. The player-authored Metaphysicist FAQ v0.31 lists the original resource's Opifex and Nanomage starting values. Its level-220 tables are expansion-era corroboration, rather than an exact 14.9.1 server capture.

Anonymous browser visitors use Solitus Soldiers with the complete original Solitus head catalog and matching skin race. The native creator offers four breeds, seven breed/sex templates, all 255 original heads, three builds, gameplay heights 90/100/110 and twelve professions. The Arrival Hall offers the three sides. The server derives breed, sex and skin from the selected head, rejecting unknown meshes and unsupported choices. See player appearance. Profiles with explicitly supplied stats retain those values.

All raw skills start at 5 and unspent IP at 1500. Those remain reconstruction choices pending historical profession-specific creation evidence. In particular, the client's Run Speed fallback of 100 exceeds level-1 training caps and is unsuitable as a fresh player's raw skill. Run Speed uses the common raw seed of 5. This permits native training while keeping every initial skill within its training cap; it does not prove the historical Run Speed seed.

Starting health comes from the existing breed/profession formula and effective Body Development. At level 1, the four breed baselines give Soldier maximum health/nano of 34/32, 38/31, 25/48 and 59/20 respectively. Creation starts at full health and retains the current zero-nano policy. Historical starting resources, equipment and action choices still need a complete creation audit.

Original creation research

The original creator in ddr.dll offers the four breeds, twelve professions, three builds and three heights. Its seven breed/sex templates and full head catalog are documented in player appearance. cd_image/data/launcher/Professions.txt maps the original profession IDs.

NameScene_t::StartServerCreation normalizes the nickname, then validates it with the helper at 0x10038c10: length 4-12, at least four initial ASCII letters, and optional trailing digits. Letters cannot follow digits. The normalizer at 0x10038d00 removes other characters and uses first-uppercase, remaining-lowercase spelling. Browser creation, adoption and login apply these rules. Original server profanity and reserved-name policy remains unknown.

The selected version includes Arrival Hall playfield 4604 and cd_image/text/tips/OnEnteringArrivalHall.txt. Final faction selection leads to Omni Training 950, Clan Training 952 or Neutral Training 954. These original 1000026 door records identify their backyard entrances:

Playfield Door Authored XYZ Quaternion XYZW
950 0xc00003b6 52.597332, 15.870241, 55.136177 0, 0, 0, 1
952 0xc00103b8 40.237694, 14.859026, 70.091904 0, 0.707108, 0, 0.70710546
954 0xc00003ba 239.886292, 5.964665, 69.931137 0, 0, 0, 1

Clan/Neutral map-center spawn coordinates in the exploration catalog are not historical creation positions. Original-server final offsets, clearance and backyard-instance allocation remain unproven. Raw door bytes, hashes and terrain measurements are retained in local/browser-creation-research/training-door-locations.json.

Departure from the Arrival Hall enters the chosen side's training ground. It moves 2.5 meters forward from the authored entrance door, retains its facing and uses terrain height +0.75m, matching the existing zoning clearance policy. This is a usable reconstruction policy, not a recovered original-server spawn offset. The Hall's remaining historical dialogue, exit-trigger and entry-camera gaps are documented in Arrival Hall.

The shipped startup crystal tips instruct manual upload from inventory. They identify the following original QL1 crystal items and resulting nanos:

Profession ID/name Crystal item -> nano
1 Soldier 29092 -> 29091
2 Martial Artist 43382 -> 43369
3 Engineer 43329 -> 43325; 29194 -> 29188
4 Fixer 43380 -> 43370
5 Agent 43383 -> 43367; 29191 -> 29153
6 Adventurer 28742 -> 26695
7 Trader 43378 -> 43374; 78417 -> 76742
8 Bureaucrat 43381 -> 43368; 29625 -> 29618
9 Enforcer 43379 -> 43371
10 Doctor 28778 -> 28665; 43384 -> 43376
11 Nano-Technician 28815 -> 28612; 42111 -> 42110
12 Meta-Physicist 43330 -> 43324; 29193 -> 29114

cd_image/text/tips/tipheader.txt names these startup crystals; the original item records retain their skill requirements. Their presence does not justify automatically learning nanos or granting extra trained skills.

Original descriptions/tutorials identify startup Soldier assault rifle 121569, Agent rifle 121568, Fixer SMG 121571, Trader shotgun 121570, Enforcer bat 121564, MP shield 121566 and MA attack Jab of the Snake 117610. Solar pistol 121567 is a starter weapon. An older local Engineer Guide explicitly lists it for an Engineer starting on Rubi-Ka; that guide's 2012 touched date does not prove exact 14.9.1 allocation. Creation currently assigns one pistol to Engineer, Adventurer, Bureaucrat, Doctor and Nano-Technician. The latter four assignments are provisional reconstruction choices and need period corroboration. Tutorials instruct manually equipping the weapons. The mere existence of MA Oak Bo 121565 does not establish a creation grant.

The original startup laboratory 116628 has capacity 200 and restores 15 health and 15 nano; first-aid kit 116629 has capacity 300 and restores 5-7 of each. Capacity metadata does not prove the original server's issued charge counts. The February 2002 first-hand walkthrough and its arrival inventory screenshot show laboratory/first-aid counters reading 25/03; original extracted icons match. Creation issues 25/3, using that observation as a provisional policy: prior use cannot be excluded. Stackability comes from the catalog's Can stat 30, bit 9, rather than an item whitelist.

Startup maps are 116693 Omni, 116696 Clan and 116697 Neutral. The same period walkthrough supports a map, one Engineer robot shell (original QL1 identity 43328), Clan board 96358 or Omni board 99719, and Omni shirt 29426. Creation grants the profession's crystals above and its weapon/action in ordinary inventory. Native creation defers the faction map and gifts until Hall departure. Nothing is pre-equipped or prelearned. Original resources and the bounded source search are retained in docs/research-notes/browser-creation-flow-research/loadout-ledger.md.

Allocation/persistence does not complete the starter items' gameplay support. Most solar weapons, startup crystals, the two startup healing items, maps, Engineer shell, boards and shirt still need their equipment/use/effect audits. Existing raw-skill seeds do not automatically satisfy every crystal's original requirements. Do not bypass those requirements to make the loadout usable. These gaps, exact pistol/MA allocation and original credits/resource seeds remain tracked in feature backlog.

Verification

Complete native browser journey

tests/e2e/native-creation.test.mjs passes with real Chromium/WASM input. It cancels the original creator back to an existing saved character, rejects a short name in the native UI and a duplicate name through the native server response, then creates a tall/heavy Atrox Enforcer with a selected head. The character walks from the Hall spawn through the queue barriers to the Omni representative and enters training through the native conversation. Server assertions establish four profession items in the Hall and exactly three additional faction items after departure.

The same test moves an inventory icon, saves login credentials through Options, and reloads to verify the first-session native preference write. A cold server restart preserves the new character and its complete inventory. Password login recovers both the old and new characters without changed item identities. The passing run and captures are in local/e2e/1793999672484-native-creation/. The reusable native path in tools/client/create_starter.mjs also replaces the deleted Options-form setup in the starter equipment and mission-target tests; their extended earned-gameplay portions were not rerun for this change.

Native integration fixtures

server/native_creation_test.go checks the public creation WebSocket protocol, duplicate submission, refusal and failed-commit rollback, competing connections, cookie authorization, cold persistence and explicit save before password login. client/tests/browser_storage.c checks creation-ID transitions followed by reloads and separate character preferences. client/tests/browser_loop.c checks the frame-boundary identity notification, while client/tests/stdio_input.c covers the camera parser's pushback dependency. These focused fixtures complement the real-input journey above; wire fixtures alone do not establish native UI behavior.

The focused creation, Hall, launch, asset and catalog Go checks pass, as do the browser account/control/loading/network and guest CRT checks and the WASM build. The broader Go suite has eleven unrelated failures, all reproduced against unchanged c5638cf3 source and assets; see local/native-creation/go-suite.log and local/native-creation/baseline-failures.log. They were left outside this change.

Prior HTTP creation and browser evidence

The following creation matrix and browser results exercised the previous Options form and direct training-ground entry. They remain evidence for the shared validation, starter kits and persistence, not for the native creator UI.

server/browser_creation_test.go exercises public HTTP creation for all 255 heads, then checks cold loading. A separate matrix checks complete issued inventories for every profession/side/body template combination. SQL failure injection checks each insert table, identity counters, old credential and deferred COMMIT; none can publish partial state, and retry succeeds. Concurrent creation with one old cookie commits once. Existing named characters retain their password, equipped item and credits when creating another character.

Hardware Chromium/WASM checks created all twelve professions, covering all seven body templates, all builds/heights and the three training grounds. Native memory snapshots agree with SQLite on each item instance, template, slot and count. Each training-ground entry allowed movement away from the door. Cancellation retained the visitor; invalid naming and wrong passwords retained the active session. Desktop keyboard Tab advanced between account inputs, and mobile creation/adoption/login worked at 390x844 and 390x500. A rejected starter shotgun equip retained its native inventory row and item identity. Captures and assertions are in local/browser-creation-flow-smoke/.

The two-client checks exposed an independent compact-appearance packing bug: nearby clients interpreted skin race as faction. The corrected 14.9.1 layout keeps Side at bits 0-2 and skin Race at 10-11; see the native field trace. After the correction, all nine faction/skin combinations matched Side33 and Race89 in the local and observing WASM clients, with the exact selected meshes in the observer's captured packets. Cold password login restored the adopted visitor's 200 XP and the earlier Soldier; all twelve professions' item rows matched the pre-restart database exactly. No browser/worker errors occurred. The final full Go suite and focused creation race repetitions passed, alongside 85 browser control/account cases and the two issued-kit split/rejoin/restart regressions. Cleanup removed only the owned fifteen characters and 88 items; every unrelated stopped-world row retained its hash, with SQLite foreign-key and integrity checks passing.

server/character_initialization_test.go checks all four breed baselines and every raw ability/skill against its native level-1 cap. Browser-launch tests exercise durable creation, accepted training, rejected increases beyond the cap, and reconnect persistence. A fresh player's rejected nano-kit use retains all charges and creates no cooldown; sufficient First Aid training makes the same use succeed and persist its charge, resource gain and cooldown together.

Combat arithmetic fixtures explicitly supply their all-10 abilities and raw Run Speed 100. Their established numeric checks remain controlled inputs, independent of character creation defaults.

Hardware Chromium/WASM checks used two fresh players on the single shared HTTPS preview. Both started with six abilities of 6, raw Run Speed 5 and 1500 IP. Native ACCEPT raised Strength 6 to 8 for 26 IP, then Run Speed 5 to 7 for 22 IP. A subsequent cancelled draft left 1452 IP and both trained values unchanged. A server restart and native reconnect retained those purchases; the second player retained its original abilities, skills and IP. Native snapshots and screenshots are in local/character-creation-research/.