aorecomp

Anarchy Online classic in the browser

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


commit d34d4f7ab9bdbe1fa7b139fc353aa27f9b04e299
parent ff73d4ae361cd95a1371cd77a806ffe1b31eb75b
Author: anon <anon@example.com>
Date:   Thu, 22 Oct 2026 22:07:01 +0000

Supply the authored Kodaik material mappings

Diffstat:
MTODO.md | 4+++-
Mdocs/vehicles.md | 62+++++++++++++++++++++++++++++++++++++++++++++++++++-----------
Mserver/appearance_test.go | 27+++++++++++++++++++++++++++
Mserver/main_test.go | 2+-
Mserver/target_protocol.go | 5+++--
Mserver/world.go | 19++++++++++++++++++-
6 files changed, 103 insertions(+), 16 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -344,8 +344,10 @@ checks are recorded in [treatment kits](docs/treatment-kit.md). destination are correct and the character remains usable after reconnect. - [x] Use one ground vehicle. Check: equipping/using it changes movement speed under the applicable requirements and ending use restores ordinary movement. -- [ ] Restore the Kodaik's shipped materials in the WASM client. Check: its two +- [x] Restore the Kodaik's shipped materials in the WASM client. Check: its two textured surfaces render for the driver and observer after equip and reconnect. +- [ ] Re-equip the Kodaik after removing it without reconnecting. Check: using + the returned inventory item emits a native wear request and restores the car. - [ ] Use one flying vehicle. Check: altitude and movement modes replicate to an observer and zoning does not leave the character stuck in the wrong mode. - [x] Resolve one currently unmapped door. Check: source evidence identifies its diff --git a/docs/vehicles.md b/docs/vehicles.md @@ -140,17 +140,57 @@ read-only probes and 24 checks are retained in `local/vehicle-smoke/verification.json`. All temporary clients and the server were closed before the full test runs. -The vehicle renders as a bright-white body in these WASM captures. This does -not match the shipped material art: mesh 99458, resource 1010002, references -Material #2b / `light_sportscraft1b.png` (30043) and Material #2a / -`light_sportscraft1a.png` (30044). The extracted 256x256 RGB textures show metal, -glass and engine details. The item has no missing authored texture effect. -The port implements normal normalization, but its reached state for the car -has not been captured. `local/vehicle-smoke/material-source-audit.json` retains -the CIR and texture provenance. The remaining renderer task needs the car -draw's bound textures, material/lighting values and normalization flag; the -current evidence does not justify a speculative graphics fix. - The maintained full server suite passed in 119.538 seconds. Five race-enabled passes over the ground vehicle, shared equipment publication, whom-pah and Grid return paths passed in 96.863 seconds. + +## Named vehicle materials + +Mesh 99458, resource 1010002, references Material #2b / +`light_sportscraft1b.png` (30043) and Material #2a / +`light_sportscraft1a.png` (30044). Both shipped textures are 256x256 RGB PNGs +with metal, glass and engine details. The item needs no additional texture +effect. + +The server supplies these two mappings alongside the five human mappings in +each player's initial TextureDataList. The native client retains that list +across form changes. `llr.dll` SetTextureDataList (`1003df50`) only accepts +the first assignment; SetCatMesh (`1003dbe0`) passes it into VisualCATMesh. +For a supplied list, `bbr.dll` VisualCATMesh (`10094d10`) matches material +names exactly through `10095b50`. Unmatched rows are ignored. A human-only +list therefore leaves the vehicle materials without textures. A null list +would instead copy the mesh's default mappings, but would lose our explicit +human skin selection. The combined list preserves both supported forms; +it is a reconstruction using shipped mappings, not an original server capture. + +Seven rows use encoded count 8072, `(7+1)*1009`. The 14.9.1 readers in +`kkr.dll` (`1015b580`, `1015b540`) consume that count and fixed 32-byte material +names followed by three DWORDs. The shared-protocol converter honors the +count when padding names. Human NPCs retain their five-entry list. + +Read-only WASM captures found the white car already using scale 0.2 and +NORMALIZENORMALS=1, with no texture bound and no RTexture installed in either +named material. After supplying both mappings, native CATText replacements +hold the two texture objects and the car displays its shipped surface detail. +The renderer and item effects require no changes. Original-byte audits, +material captures and the isolated fixture are retained under +`local/vehicle-material-smoke/`. + +Two WASM clients verified the textured car after native equip and reconnect. +Read-only probes resolved both named replacements to ready 256x256 textures +in the driver and observer. Removing the car restored human skin and worn +Metaplast chest armor; equipping that armor through the ordinary inventory UI +still changed its appearance. A server restart retained both item identities, +HUD1/chest placement, health, cash and the single speed bonus. The isolated +run passed 23 evidence checks in `local/vehicle-material-smoke/verification.json`. +Only expected connection-refused messages during deliberate restarts were +recorded. All test clients and the temporary server were closed afterward. + +Live re-equip after removal remains a separate TODO: in this run the returned +inventory item emitted no new native wear request until the driver reconnected. +The reconnected driver could equip it normally, and the observer rendered its +textured form. The cause of that repeat-use UI behavior is not established. + +The maintained full server suite passed in 91.528 seconds. Five race-enabled +passes over vehicle lifecycle, material initialization, native character +conversion and clothing flags passed in 96.323 seconds. diff --git a/server/appearance_test.go b/server/appearance_test.go @@ -1,10 +1,37 @@ package main import ( + "bytes" "encoding/binary" "testing" ) +func TestPlayerAppearanceIncludesKodaikMaterials(t *testing.T) { + player := &character{id: 1, name: "Driver", appearance: 0x515, level: 1} + + packet := targetPacket(characterPacket(player)) + + start := bytes.Index(packet, []byte("arms\x00")) + if start < 4 || binary.BigEndian.Uint32(packet[start-4:start]) != 8072 { + t.Fatal("player texture list does not contain seven materials") + } + for _, material := range []struct { + name string + texture uint32 + }{{"Material #2b", 30043}, {"Material #2a", 30044}} { + name := make([]byte, 32) + copy(name, material.name) + start := bytes.Index(packet, name) + if start < 0 { + t.Fatalf("missing vehicle material %s", material.name) + } + values := packet[start+32:] + if binary.BigEndian.Uint32(values) != material.texture || binary.BigEndian.Uint32(values[4:]) != 0 || binary.BigEndian.Uint32(values[8:]) != 0 { + t.Fatalf("incorrect vehicle texture for %s: %x", material.name, values[:12]) + } + } +} + func TestSolitusAppearanceUsesMatchingOriginalAssets(t *testing.T) { for _, appearance := range []struct { packed uint16 diff --git a/server/main_test.go b/server/main_test.go @@ -363,7 +363,7 @@ func TestWorldCookieThenPing(t *testing.T) { if hex.EncodeToString(updates[1][37:41]) != "000002d8" || hex.EncodeToString(updates[1][154:158]) != "00009eea" { t.Fatalf("player head mesh: %x", updates[1]) } - if hex.EncodeToString(updates[1][159:163]) != "000017a6" || hex.EncodeToString(updates[1][197:215]) != "68616e647300000022450000000000000000" { + if hex.EncodeToString(updates[1][159:163]) != "00001f88" || hex.EncodeToString(updates[1][197:215]) != "68616e647300000022450000000000000000" { t.Fatalf("original named hand texture: %x", updates[1][159:215]) } var leet []byte diff --git a/server/target_protocol.go b/server/target_protocol.go @@ -39,14 +39,15 @@ func targetPacket(packet []byte) []byte { nameEnd += 20 } if flags&0x90 != 0 { - // kkr.dll 0x10142350: five fixed 32-byte material names after the vehicle. + // kkr.dll 0x1015b580: encoded count, then fixed 32-byte material names. vehicle := nameEnd + 1 + 14 if flags&0x1000 != 0 { vehicle++ } cursor := vehicle + 4 + int(binary.BigEndian.Uint32(packet[vehicle:])) + 9 + count := int(binary.BigEndian.Uint32(packet[cursor-4:])/1009 - 1) converted := append([]byte(nil), packet[:cursor]...) - for range 5 { + for range count { end := cursor + bytes.IndexByte(packet[cursor:], 0) + 1 material := make([]byte, 32) copy(material, packet[cursor:end-1]) diff --git a/server/world.go b/server/world.go @@ -127,7 +127,11 @@ func characterPacket(character *character) []byte { body = append(body, 100) if human { // Keep the body materials and replace the hand material with original skin. - body = binary.BigEndian.AppendUint32(body, 6054) + if character.npc { + body = binary.BigEndian.AppendUint32(body, 6054) + } else { + body = binary.BigEndian.AppendUint32(body, 8072) + } textures := [5]uint32{8714, 8710, 8773, 8713, 8709} if character.appearance>>4&7 == 1 && character.appearance>>7&3 == 3 { textures = [5]uint32{8849, 8850, 8865, 8853, 8848} @@ -139,6 +143,19 @@ func characterPacket(character *character) []byte { body = binary.BigEndian.AppendUint32(body, value) } } + // The native texture list persists across player form changes. + if !character.npc { + for _, material := range []struct { + name string + texture uint32 + }{{"Material #2b", 30043}, {"Material #2a", 30044}} { + body = append(body, material.name...) + body = append(body, 0) + for _, value := range []uint32{material.texture, 0, 0} { + body = binary.BigEndian.AppendUint32(body, value) + } + } + } } body = binary.BigEndian.AppendUint32(body, 1009) body = binary.BigEndian.AppendUint32(body, 1009)