aorecomp

Anarchy Online classic in the browser

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


docs/npc-placement.md (5002B)


Generated NPC placement

Initial district-center fallbacks for admitted ground combatants use distinct dry terrain samples inside their original district cells. The shared path runs only during initial population creation. Authored and fixed points, unreviewed combat contracts, raw source coordinates, population counts, identities and level ranges remain unchanged. Existing saved worlds retain their saved state; no migration or per-tick placement writes are added.

The selected 14.9.1 Omni Training population source has SHA-256 12bf3d50785c8a40983fd6842054d46b4a8e995b1d780f2efdaddb97a2c57344. Source district 5 has center [140,10.8,100], four LEET and two ML01 entries, and no spawn points. Its original 36-entry zone map assigns it the cell at X120..160/Z80..120 in the shipped 6-by-6 grid. The center is in the pond. It does not provide six individual underwater spawn coordinates.

The old generated Leet point [138,10.8,98] lies below the terrain at Y11 and water near Y13.5166. The native floor query's Y12.3166 contact includes its water-minus-1.2 clamp; treating this as a static floor was incorrect. A controlled WASM trial at that raised underwater point still cannot start ordinary melee while the player swims. Raising only Y does not repair this placement.

The replacement samples terrain-tile centers inside cells assigned to the source district. It uses the existing scene floor/water query, excludes points below water, and assigns the closest unused sample in stable population order. The first Leet now starts at [130,14,98]. Its motion home uses the same point, so cold recovery and ordinary replacement preserve the selected initial home. Missing source/geometry and exhausted dry samples retain the existing generated placement; this does not establish support for those unresolved cases.

This deterministic sampling is a reconstruction, not the original random spawn algorithm or a recovered aquatic/flying NPC policy. All 23 actors admitted on November 2 fallback combatants pass the production census: distinct positions, dry contact, original district membership and matching home. The focused fixture checks all six placements, immutable raw points, untouched fixed/unreviewed entries, respawn and cold recovery.

The two-client WASM check uses controlled default level-1 players and holds idle roaming while isolating initial placement. Real first-person camera input selects the downhill Leet; ordinary walking enters range and Q starts/stops combat. The single five-point hit leaves both native replicas and the server at 95/100 HP. This isolates initial placement from wandering and earned progression. The related Go selection passes in 15.004s; focused race checks pass in 107.346s; vet and Node syntax checks pass. The final native run takes 25.46s, or 33.086s including Go. Reviewed screenshots, complete traces, independent verification and earlier failed trials are under local/fallback-placement/; the successful capture is 20261102-152355/.

A follow-up through advanceNPCs gives the first Leet an ordinary four-metre idle destination [134,14,98]. The terrain-offset shortcut formerly reached approximately [133.01001,11.892994,98] under water at Y13.520653. Outdoor NPC motion now uses the same body, floor, gravity and water alignment as the native vehicle. Swimming mode 4 selects the existing Swimming-based speed and rejects walk/run toggles until water exit. This repairs both roaming and pursuit without introducing a species water ban. See surface motion.

Three focused Go regressions reproduce submerged roaming/pursuit before the change and verify surface contact, retained encounter state and cold return without observers afterward. A two-client WASM fixture selects that one idle destination and holds subsequent idle choices; it does not teleport the NPC. Both players are controlled level-10 characters with default skills, permitting the ordinary encounter to continue without a survival grind. The Leet stops at [133.00801,13.480606,98] in swimming mode. Both page reloads retain that contact and mode. Return leaves water in walking mode near the unchanged home; real mouse selection, walking and Q then deliver a five-point hit. The living NPC pursues the player into the pond, with both native replicas retaining 95/100 HP and matching the server's swimming mode and surface contact.

The selected phase comparisons are within .146 metres; asynchronous intermediate samples reach .338 metres and do not establish identical frame-by-frame paths. Both complete traces have empty error lists and zero dropped events. Screenshots, source evidence, independent verification and failed trials are retained under local/npc-water-motion/, with final capture 20261102-154544/. The placement/interaction defect is resolved; original random sampling and outdoor destination eligibility, including aquatic/flying distinctions, remain a separate historical-policy TODO.