Player terrain and scene geometry
The server's physical height sampler reads all 188 CHGA grids from the selected 14.9.1 resource database. It uses native checkerboard triangle planes and native header bounds, with archive dimensions retained separately for sample storage. This supplies terrain heights to movement, NPC roaming, zoning and controls. Player simulation also uses the shipped outdoor cell surfaces and water for body projection, wall contact, gravity and basic swimming transitions. Indoor transforms, dynamic platforms and the full movement lifecycle remain open.
Selected terrain data
tools/data/extract_terrain.py reads anarchy-vanilla-14.9.1, checks its version,
and decodes type 1000009 through the shared resource reader. The selected index
SHA-256 is 46e5dc54af9358cc9bff05f4358e86af630e497bc677f361c133c88073b84d71.
The export contains 31,467,148 vertex bytes. Shared grids 551,565,585,670,716
change from 11.0; grid 551 changes 4,835 vertices, with a maximum 37-metre altitude
difference. New CHGA identities are 101,105,641,706. Four internal dependency
grids omitted by the old exporter are now retained as data.
All 13,010 selected coarse-corner records have entry length 4. Those corners are separate from the compressed full-height samples. In 641 and 706 all 49 coarse entries are zero despite nonzero full-height corners. Native decompression and physical Height do not substitute or validate against that table. Export validation checks compressed dimensions, collection framing and shared patch edges, while recording coarse discrepancies in the evidence metadata.
The current AOTERR02 format stores both archive dimensions and native header
dimensions. It has one current reader. Regeneration writes data/terrain.bin
and the matching JSON/YAML evidence at
local/reports/terrain-extraction-evidence.json and
server/gamedata/terrain_evidence.yaml. The existing runtime packager copies
the grid into server/assets/terrain.bin.
Physical height query
LLR GetHeightAndNormalAtPos (380385e0) is called directly by the outdoor
CalculateClosestPoint (3803b690). BBR's similarly named InterpolatedHeight has
different weighted interpolation and is not used on that physical path.
For an outdoor cell, even column+row selects diagonal A-C; odd selects B-D.
The server evaluates the corresponding plane. It rejects coordinates outside
0 <= X < headerWidth*spacing, 0 <= Z < headerHeight*spacing, including
nonfinite inputs. The padded archive grid does not extend that query domain.
Far sample indices clamp to headerWidth-1/headerHeight-1 even though corner world coordinates still span one spacing. The final admitted strip therefore repeats its last samples. LLR's exact A-C diagonal tie chooses A-C-D; a directed terrain ray can select the other triangle first and have a different tie normal. This value-returning height method does not reproduce the native input/output alias accident or claim bit-identical floating-point reassociation.
Hardware WASM checks use an owned visitor, normal control-panel teleports and read-only probes. At PF 551 [2840,3432], exported ground 9.6 matches native actor Y=9.61; the old export gave 46.6. At PF 950 [59.5,83.5], the plane gives 15.6 and native actor Y=15.61; bilinear interpolation would give 15.6875. An opposite diagonal sample PF 950 [60.5,81.5] gives 14.8 and native Y=14.81. These match the fixture's native 1 cm body-ground separation. The control tool initially places an actor 0.5 above sampled ground; normal movement messages separately quantize pose. Those offsets are not terrain-interpolation errors.
Static wall fixture
An ordinary 40-second reverse walk in PF 705 starts at [961.625,16.41,510.75]. The native character stops against a building at approximately [971.7014,16.41,519.6436], retaining horizontal velocity and reverse throttle. The terrain-only server previously reached [991.9849,20.175,539.9869], a 28.73-metre horizontal error before the next native pose message. The integrated outdoor body response stops at the shipped wall. A final-build 40-second hold samples owner/server error 0.0126 metres before key release and observer/server error 0.0061 metres during the hold. Both retain horizontal velocity; ordinary wall contact does not Halt the movement controller.
The wall is present in shipped resource 1000013/46203264. Outdoor playfield 705
has 300x300 tiles, spacing 4, zone size 10 and 900 zones. Its native CellSurface
has 30x30 cells, each 40 metres. Position [961.625,510.75] maps to cell 384;
the resource identity is (705 << 16) | 384. Its authored world-space triangle
bounds align with the native stopping point. Collision can use the shipped
surface data instead of reconstructing obstacles from visual model names.
All 155,273 selected type 1000013 records are resource version 4. Source and normal asset parsing validate all 154,023 outdoor records across 188 playfields, including the primary/invisible KD-tree fallback and count-framed portal tails. They contain 150,620 trees, 9,419,782 vertices, 15,017,490 triangles and 1,651,254 KD nodes. Counts include cross-cell duplication. Largest vertex and group counts are 3,477 and 351, so selected outdoor data exercises 8/16-bit vertex and group references but avoids the unreduced native 32-bit triangle-construction branch. Indoor transforms and dynamic platforms remain separate bounds.
Shared archive reader and sphere query foundation
server/game_database.go reads the resource index and uses random access into
the already bundled ResourceDatabase.dat. It checks index framing/cycles,
duplicate identities, record identities and payload bounds. It does not read
the full 557 MB archive into a second buffer or introduce a second geometry
export. These readers and queries are not yet connected to the live movement
loop; completing that integration remains the next task.
server/scene_playfield.go derives outdoor cell dimensions from the playfield's
tilemap and zone size. Native extents truncate tile spacing; cell selection
truncates coordinate division and falls back to cell zero for invalid indices.
The sphere provider queries only the center's cell. It does not expand the
search into neighboring cells by radius.
server/scene_surface.go decodes selected version-4 resource streams. It keeps
both authored trees, promotes invisible geometry when primary is absent, and
validates portal framing without using portals as collision triangles. It
retains separate authored group bounds, ordered vertex triples and preorder KD
nodes. Quantized coordinates round once after the wide base-plus-delta sum.
Every outdoor coordinate matches the independent Python archive decoder: the
ordered identity/tree-count/interleaved-vertex SHA-256 is
22d3412759c061e57a624ce84145118969a5552f704fe7f97b103448d030b257.
server/surface_sphere.go implements the KD-tree query kernel. Ordered unit
edges produce face and edge-plane coefficients. Triangles admit only their
front side, including exact plane equality; the first positive edge plane
selects the edge/vertex calculation. Within a group, the native squared-distance
epsilon is float32(0.0001), with smaller lateral distance resolving near ties.
Across groups, strictly nearer contact wins and traversal order retains exact
ties. KD traversal visits the center's side first, choosing the upper child at
split equality. It prunes against authored bounds and the current distance;
leaf aggregate bounds separately use the original radius. Initial leaf-bound
relaxation admits exact tangency, while the final result still must be within
the requested radius. Returned normals are triangle face normals, including
edge and vertex contacts. Coefficients are built once and shared safely by
concurrent queries.
The kernel preserves these source branch and storage contracts for ordinary finite inputs. It does not claim bit-identical x87 arithmetic. Selecting between an additional invisible tree and primary geometry depends on a native setting whose ownership remains unresolved; the current kernel queries individual trees and does not invent that setting. Likewise, the public native fifth float output is not a reliable contact depth: the ordinary KD wrapper leaves it untouched.
At the captured PF705 native stop, a sphere with the measured model offset and radius is clear of the building. A small step to [971.72,16.41,519.66] contacts the authored wall, with face normal [-1,0,0] and distance approximately 0.24145. The query fixture verifies the authored contact independently of the integrated movement regression above.
Model torso metadata
server/model_sphere.go reads only the collision metadata prefix for the selected
model resource. All 5,128 ordinary meshes use schema 3: keyframe count, 36-byte
keyframe/name entries, then signed packed XYZR. All 198 CIR metadata records
store a 32-byte skeleton name, encoded material count, 44-byte material entries,
then the packed sphere. For every shipped CIR, the native reciprocal count
calculation equals encoded/1009-1.
Each signed byte q decodes to
float32(q*(q*q*float32(0.000006)+float32(0.05))), with wide intermediates and
one final float store. Native collision construction replaces a negative radius
with 0.5 before scale, retains zero radius, discards authored X/Z displacement,
and scales Y/radius separately. Thus ordinary player radius byte 5 gives exactly
0.25075000524520874 without a universal player-radius constant. Authored offsets
are independent: thin Nanomage male 17909 has Y=0; hovertech 20615 has negative Y
and the radius fallback. Tests retain both cases and scaling order.
The reader needs the model identity used when the collision body was constructed. Ordinary character setup initially selects the normal breed/sex CIR. A later thin/fat appearance change uses the render mesh's ChangeMesh and retains the existing collision body. A thin Nanomage male reconnect therefore ends with render stat12=17909 but collision offsetY still 0.2507500052. The thin resource's authored Y=0 is valid metadata; it is not that ordinary player's cached body. Explicit MonsterData first resolves the template, then its stat12 selects the CAT used to construct collision. The earlier ambiguous stat12/stat42 selection path belongs to SimpleItem and does not establish player model precedence.
Character base stat360 assignments clamp to at least20. The extent refresh separately clamps effective scale to at least1; form refresh has its own minimum20. These are different transition rules, so one universal effective-scale clamp would be incorrect. Incremental native scale updates multiply the existing primitive by new/old scale instead of re-decoding metadata. Replacing the CAT through SetCatMesh rebuilds it. Grid form99902 resolves CAT99894, with radius 0.1000479981 and offsetY0.2507500052. Supported vehicle forms and forced human restoration are implemented below; Grid entry/exit and special appearance flag lifecycles remain separate verification work.
Six GPU WASM captures corroborate these contracts through normal control edits and read-only probes. Height1 becomes native base20, visual scale 0.1999999881 and radius/offsetY0.05014999956. Height200 produces visual scale2 and radius/offsetY0.5015000105. Explicit Anvian template17651 gives authored radius0.7702500224 and offsetY0.7164639831, while hovertech template20614 gives fallback radius0.5 and retained negative offsetY-0.05000600219. Their native ground positions match the capped-radius/adjusted-offset formula within 0.000001 metres. The thin render appearance continues to retain its normal collision body across the scale/reconnect checks. No client errors occurred.
The native body interface obtains a scaled model torso sphere. Its radius and offset are model-specific. For this owned visitor, raw radius and offsetY both read 0.2507500052. QQR caps radii above 0.5 and rescales the offset accordingly. Collision uses center=actorPosition+offset. Ordinary sphere contact corrects position without Halting cached horizontal velocity. Ground projection yields actorY=hitY+0.01-offsetY+radius. Long-displacement segment checks, contact retries, steep slopes, falling and deep water have additional branches. Gravity is -20 with independent vertical-speed clamp +/-50. The outdoor simulation now applies these rules. Ordinary jump and landing actions are connected below; fall damage and the combined special-mode lifecycle remain open.
Outdoor collision query provider
The provider lazily shares immutable decoded cells and water geometry from the already bundled database. Directed line and sphere queries include the extra invisible tree; it wins exact distance ties. Floor queries use the embedded primary tree. Segment triangles require the front-facing direction, admit the origin and exclude the exact endpoint. Equal triangle hits retain the first triangle within a group, while later groups can replace equal hits. Vertical KD traversal preserves the native mixed displacement/fraction scalar rather than substituting a generic nearest downward ray.
Cell and terrain traversal share a grid walker with caller-specific float stores, truncation and Z-first crossing ties. Cells query the whole segment but accept a point only within the visited cell's closed bounds. Terrain queries preserve alternating triangle order, directed faces and the unsigned distance gate. Terrain wins exact distance ties against static geometry. World clipping keeps native boundary interpolation and the high-edge 0.1 margin; terrain retains the pre-clipping displacement. Position veto reverts the entire invalid pose before clamping when supplied with a previous position.
Water comes from the type1000001 outdoor playfield extension. The reader keeps authored face or centroid-fan order, odd-kind cubic strips, even-kind recursive subdivision, winding correction, the visual-bucket admission gate and zone-list insertion order, including duplicates. All 188 selected outdoor maps decode to 46,140 volumes and 788,782 zone entries. Five complete geometry and ordered-list digests match an independent Python asset parser. These host reductions preserve explicit float stores but do not claim exact x87 intermediate rounding.
Floor selection first samples terrain and its triangle normal, then queries the current cell's static floor when the origin is at or above terrain. Static must be strictly higher to replace terrain. Water uses that selected floor as its query origin and the original origin height as its clip limit. Strict water bounds and edge tests reject polygon boundaries. The first positive volume either succeeds or vetoes the query; it does not search later volumes after a clip rejection. Water replaces the floor only when its height minus1.2 is strictly higher, while the returned medium retains the raw liquid height. Invalid cell queries leave the caller's floor point and normal unchanged. Misses return explicit height sentinels and zero metadata instead of exposing the native scratch metadata left over from earlier calls.
Outdoor movement integration
The shared player simulation consumes this provider for manual input, following and read-only position predictions used by gameplay ranges. Each outer frame retains one historical position across native force substeps and the five-pass body response. Segment sweeps prevent large admitted displacements from tunnelling through walls. Sphere contact, raised probes, slope feedback and floor selection preserve their native order. Cached horizontal velocity survives ordinary contact. Gravity is independent of longitudinal velocity; ready placement can start an idle fall without a key press. Simulation and rotation remain in memory between normal database checkpoints.
Ordinary body construction selects the normal breed/sex mesh from the appearance catalog, independently of later render fatness. Explicit MonsterData uses the template's mesh. Immutable raw model metadata is shared; each player retains its scaled primitive and updates it incrementally. Hardware owner and observer checks cover scale20, scale200, Anvian and Hovertech, with ground-height differences below 0.000003 metres. Explicit player forms retain the breed/sex mass table rather than copying template stat2; both template fixtures retain Nanomage male mass 0.07500000298. An idle fall from Y80 reaches the same Y16.41 floor in both native client and server; captures include twelve falling frames and final rest.
Deep water selects mode4 and effective Swimming138 through the common skill evaluator, including ability trickle and equipment/nano modifiers. Unlike running, this speed formula has neither the 15 cap nor the low-health multiplier. Water entry clears cached vertical input and applicable strafe input; exit restores the preferred walk/run mode. Raw Swimming reaches observers before the final movement refresh. With trained3000 and abilities6, both owner and late observer read 16.004999. A two-second high-speed swim sample differs by 0.6754 metres between owner and server; input delivery and frame cadence remain comparison bounds. This verifies the formula and replicated limits, not exact swimming trajectories.
Remaining work includes shoreline/shallow-water and smoothing cadence, stairs, corners, narrow passages, blocked interactions, special jump modes and fall damage, internal and nonzero orientation modes, live carried mass/encumbrance, Grid body replacement and full flight lifecycles. Indoor room transforms, dynamic platforms and actor colliders also remain separate work.
Vehicle forms and human restoration
Collision follows the admitted item's ordered OnWear functions, using the same MonsterData catalog as explicit actor templates. ChangeShape53060 selects the form's stat12 CAT rather than retaining the human torso sphere. Kodaik99468 uses CAT99458; Yalmaha99470 uses CAT42370. Both retain the player's breed/sex mass. The in-memory body stores its current form, live base scale and signed modifier balance, so movement predictions copy the actual collision history.
Kodaik applies Shape then ChangeStat360; Yalmaha applies ChangeStat360 then Shape. Removal runs functions in that same authored order. Form setup clamps effective scale to20; an extent refresh clamps it to1. With Modified Pioneer Backpack's -3 scale already worn, accepted Kodaik wear ends at scale0.17, while Yalmaha wear ends at0.2. A later modifier refresh can change the latter to0.17. These are event-specific clamps, not a universal minimum vehicle size.
Form0 restoration forces the current human CAT to be reconstructed even when its identity matches a previous CAT. The catalog retains all21 ordinary breed/sex/fatness meshes. This differs from initial login: a slim Nanomage male initially retains the normal5921 collision body despite render mesh17909; after vehicle removal its new17909 body has authored offsetY0. Scale changes multiply the existing primitive by new/old rather than decoding it again. Repeated ticks and unrelated inventory changes preserve that restored body. A fresh owner construction starts with the normal collision CAT again.
FullCharacter installs its plain-counted saved-stat map before initial OnWear,
then applies its four live stat lists afterward. While driving, live360 is20;
the saved map carries the original profile height. Sending only the profile
height as live360 overrides the vehicle's earlier ChangeStat and makes owner
and observer scales disagree. The native tail for saved height150 is
[1,360,150,0,1009,1009]: map count/pair, optional-section presence, empty
encoded list and empty encoded effect list. The protocol adapter preserves
the variable-length saved map. Neither the stored profile height nor ownership
is replaced by the temporary scale20.
Durable equipment moves finish before any live collision effects or success packets. Pending, rejected and failed moves retain the previous body. Initial reconstruction applies implants32..47, then ordinary worn slots0..31 in native slot order, followed by the live base-scale refresh. Body changes themselves do not force ground alignment; changed pose or simulation reconciles contact. Position remains in memory until the usual checkpoint.
The final full suite passes1,288 top-level tests and14,251 total test results; the affected race cohort passes201 top-level tests and788 results. Data checks and vet pass. The final-build Kodaik cold-load/removal round trip has maximum position error0.03989 metres and height error below0.000001 metres across the two native clients. Four earlier and one final native FullCharacter captures verify the live20/saved150 fields. Nine earlier paired states additionally verify Yalmaha, signed Pioneer effects and their distinct manual/cold scales. No WASM page errors occurred. Six owned visitors and four fixture items were removed; database checks and hashes preserve all unrelated rows. The sole HTTPS preview remains on8443.
This does not complete Grid replacement, special appearance flags, arbitrary concurrent forms or indoor vehicle policy. Ordinary flight activation/removal, mode4 orientation and in-flight gravity now use the shared simulation; see flight movement. Other forms, nonzero ground orientation modes and the wider lifecycle matrix remain TODOs.
Ordinary outdoor jumps and landing
Movement action13 follows the native helper admission and secondary-state rules. Swimming4 and sitting8 reject it. An accepted jump sets secondary4 and keeps the longitudinal, lateral and angular controls. As with other accepted actions, the helper snapshot copies its previous lateral-state field from the old lateral state. Repeating jump while secondary4 normally rejects; the separate physical jump-height guard also prevents an early helper14 from permitting another impulse.
The height request is float32(1+.005*(rawStrength16+rawAgility17)), retaining the native coefficient and stores. It does not use effective ability modifiers, trickle, Adventuring or the extra movement packet scalar. An upward segment from the actor to Y+100 checks the shared scene provider without world clipping. A hit limits the height to max(.1,hitY-actorY-2*visualScale), capped by the original request. This clearance uses visual scale rather than the torso sphere radius.
StartJump enables falling and stores a float32 vertical impulse masssqrt(2abs(gravity)*height), then adds impulse/mass to independent vertical velocity. The intermediate impulse store is retained instead of cancelling the mass algebraically. Existing gravity and contact projection produce the arc. A first jump during an ordinary fall is allowed by this recovered client path; it adds to the existing vertical velocity. No grounded-only policy is invented.
Physical landing clears vertical velocity, recalculates horizontal speed and locally submits helper14, then clears jump height and records the callback's supplied height before clearing falling. Horizontal velocity and controls remain active. A received movement14 only changes helper state/presentation; it is not a physical landing. Missing surface providers still perform the native landing callback after alignment, while complete indoor jump trajectories await indoor geometry support.
The extra compact movement scalar is an action20 yaw offset, not a jump parameter. Its application and placement ordering are described in movement. The retained native standing jump sends one action13 and no action14. Neither OnStartFalling nor OnLand constructs a packet or calculates fall damage. The original server's damage threshold, formula and immunities remain unknown; absence of a dedicated packet in these paths does not establish absence of a generic action elsewhere.
Evidence
local/player-geometry-research/ retains runtime captures, the 28.73-metre wall
failure, selected-archive comparisons and source ledgers:
terrain/: 41 complete maintained bodies, initializer bindings, full grid and coarse-corner censuses, equations and a source-only verifier.scene/: 61 complete bodies, cell/resource ownership, KD-tree and portal framing, per-resource hashes and selected 465-resource parser validation.vehicle/: 47 complete bodies, body-interface bindings, contact ordering, projection/gravity rules and explicit unreduced branches.sphere-query/: 31 complete bodies and two initialized-data sources; ordered primitive, group ranking, KD traversal, cell dispatch and resource wrappers.body-model/: 43 complete bodies and four initialized-data sources; all model metadata, scale/fallback ordering and explicit model-selection gaps.contact-response/: 12 complete bodies; segment/contact/raised-probe routing, five-pass retries, strict ground comparisons, water separation and Halt bounds.model-selection/: 46 complete bodies; character/item class bindings, ordinary cached bodies, template/form replacements and transition-specific scale rules.ground-query/: 20 complete bodies; terrain/static/liquid floor selection, vertical KD traversal, normals, miss outputs and outdoor position veto.segment-query/: 33 complete bodies; cell/terrain DDA, directed triangle intersections, KD ordering and the normally enabled invisible-surface switch.water-data/: 39 complete bodies; outdoor polygon framing, curved strips, subdivision, collision volumes and exact zone-list construction, with all 188 selected resources and five complete geometry/order samples.integrator-contact/: 23 complete bodies; outer-frame alignment, fixed previous pose, slope-normal feedback, steep guards and falling callbacks.water-transition/: 40 complete bodies; helper transitions, retained controls, Swimming speed and landing callbacks.grid-body/: 25 complete bodies; Grid form/model selection and extent clamps.body-lifecycle/: 42 complete bodies; construction, compact observer clamps and direct placement through surface alignment.template-mass/: 16 complete bodies; player form selection versus NPC template stat application, raw breed/sex mass and the zero-mass fallback.jump-control/: 51 complete bodies; jump/landing admission and callbacks, ceiling/impulse math, helper snapshot copying and action20 scalar semantics.fall-notification/: 51 complete bodies; movement publication/serialization, local landing, retained outbound packets and bounded fall-damage searches.
These counts overlap; they are not unique additional procedures. Source checks
establish maintained-code contracts and evidence integrity. Runtime probes
read state without calling native methods or modifying guest memory. Regression
tests cover selected data hashes, both diagonals, edge clamps, invalid/outside
coordinates, the current binary framing and affected gameplay consumers.
The terrain milestone passed all 1,213 top-level server tests (13,998 results),
18 data tests, 256 focused race results and go vet. Its export verification
compares every grid against the independent selected-archive decoder. Owned
player 120 is removed after testing; unrelated SQLite rows hash unchanged and
integrity and foreign-key checks pass.
The collision-query foundation passes all 1,229 top-level server tests (14,060
results), 62 focused race results, the data packages and go vet.
local/player-collision-query/ retains test logs and the manifest binding every
Go source and relevant bundled archive to that exact test binary. The independent
coordinate comparison covers every outdoor cell. That foundation milestone
added no live movement behavior or additional test clients/servers.
The subsequent six body captures are under
local/player-collision-integration/runtime/body/. Their verifier records the
cached-body, scale, template and ground-formula checks. Owned visitor121 was
removed after closing the browser; unrelated rows hash unchanged, foreign-key
and integrity checks pass, and the same single preview build was restarted.
The outdoor provider milestone passes all 1,254 top-level server tests (14,158
results), 163 focused results both normally and under the race detector, the data
packages and go vet. local/player-collision-provider/ retains the exact-source
suite manifest, independent water digests, source checks and preview verification.
It starts no additional preview, creates no players and changes no live movement.
The movement integration passes all 1,264 top-level server tests (14,179 results),
327 focused results normally and under the race detector, the data packages and
go vet. local/player-collision-movement/ retains the exact-source manifest,
native owner/observer captures, final binary hashes and verification summary.
Both headed Chromium clients use the GPU and report no WASM page errors.
Owned visitors122/123 are removed after closing the browsers; unrelated SQLite
rows hash unchanged, with foreign-key and integrity checks passing. The single
shared HTTPS8443 preview runs the verified integrated build.
The jump milestone passes all 1,273 top-level server tests (14,194 results),
342 focused race results, the data packages and go vet. Nine new regressions
exercise public movement/ready handlers. local/player-jump-movement/ binds the
exact source, binaries, source verifiers and paired GPU WASM captures. Normal
and repeated Space inputs peak near Y17.414 from floor16.41, then owner, observer
and server all settle at16.41. Raw abilities100/100 produce the expected larger
arc, with native peaks near18.335. Swimming remains mode4 with zero vertical
impulse after Space. Both clients report no WASM page errors.
The normal jump's largest sampled owner/server vertical difference is0.1352 m; the high-jump repeat has an observer/server sample difference0.3546 m. Native heap probes and the HTTP prediction are sequential: that latter sample's map response arrives29 ms after the observer probe, while owner/observer vertical velocities differ by0.68 m/s. Network delivery and frame phase therefore remain comparison bounds; these captures establish the arc, state and final floor rather than bit-identical trajectories. Owned visitors124/125 and both browser contexts are removed after testing, with unrelated SQLite rows unchanged and integrity and foreign-key checks passing. One shared HTTPS8443 preview retains this jump build.