aorecomp

Anarchy Online classic in the browser

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


commit e808063439b9aa8d6995e5952af3a4c65c34d83e
parent 3dfbb52a1a52521421914ae66554aeb3b67804d3
Author: anon <anon@example.com>
Date:   Tue, 10 Nov 2026 07:35:57 +0000

Dress female officers and audit NPC outfit coverage

Diffstat:
Mdocs/npc-appearances.md | 69++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
Mserver/browser_npc_outfits_test.go | 1+
Mserver/gamedata/npc_visuals_test.go | 43+++++++++++++++++++++++++++++++++++++++----
Mserver/gamedata/zones/zone_625.yaml | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mserver/gamedata/zones/zone_650.yaml | 14++++++++++++++
Mserver/gamedata/zones/zone_655.yaml | 14++++++++++++++
Mserver/gamedata/zones/zone_670.yaml | 28++++++++++++++++++++++++++++
Mserver/gamedata/zones/zone_695.yaml | 28++++++++++++++++++++++++++++
Mserver/gamedata/zones/zone_705.yaml | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mserver/gamedata/zones/zone_710.yaml | 14++++++++++++++
Mserver/gamedata/zones/zone_735.yaml | 28++++++++++++++++++++++++++++
Mserver/gamedata/zones/zone_740.yaml | 28++++++++++++++++++++++++++++
Mserver/npc_visuals_test.go | 120+++++++++++++++++++++++++++++++++++++++++++------------------------------------
Atools/data/audit_npc_outfits/main.go | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtools/data/test_npc_assignments.py | 21+++++++++++++++++++++
15 files changed, 580 insertions(+), 69 deletions(-)

diff --git a/docs/npc-appearances.md b/docs/npc-appearances.md @@ -3,18 +3,20 @@ ## Recovered visible equipment The November 6 captain report reopened A3 for missing armor and weapons. The -maintained zone YAMLs now contain a `visual` list on 107 NPC definitions across -20 zones. These are direct appearance resources, not invented inventory items: +maintained zone YAMLs now contain a `visual` list on 130 NPC definitions across +22 zones. These are direct appearance resources, not invented inventory items: `head` is the head mesh; `textures` rows are `[category, texture]`; `meshes` rows are `[attachment slot, mesh, texture override, layer]`. Texture categories are hands, body, feet, arms and legs (0 through 4). Every entry carries a source -comment and distinguishes an original-post match from a cross-zone inference. +comment distinguishing original-post matches, cross-zone and cross-role inferences. The population generator preserves these fields from the maintained YAMLs. | Original population code | Assigned NPCs | Appearance | | --- | ---: | --- | | MACA | 35 | Nanomage male captain, Elite armor, helmet and plasma weapon | | MALI | 52 | Solitus male lieutenant, Elite armor, helmet and plasma weapon | +| FECA | 8 | Opifex female captain, matching Elite uniform and weapon; female head and helmet | +| FELI | 15 | Solitus female lieutenant, matching Elite uniform and weapon; female head and helmet | | CSBI | 3 | Container supplier clothing and pistol | | BQAU | 4 | Basic armor merchant clothing and pistol | | BQPW | 3 | Basic nano merchant clothing and pistol | @@ -23,16 +25,17 @@ The population generator preserves these fields from the maintained YAMLs. | TAIL | 4 | Tailor clothing and pistol | Fifteen records match original posts: one captain and eight lieutenants in -Rome Blue, plus six merchants in the subway. The other 92 assignments require +Rome Blue, plus six merchants in the subway. Another 92 assignments require the same original population code and body, and are explicitly inferred across -zones. Similar names alone were insufficient. Female captains, modern -Arete-only roles, and ambiguous guard replacements remain unassigned. +zones. The 23 female officers use the corresponding male role's uniform as an +explicit cross-role inference. Modern Arete-only roles and ambiguous guard +replacements remain outside these recovered visual assignments. The armor textures are original resources 15805 through 15809. Male captain head/helmet meshes are 40171/20038; lieutenant meshes are 40687/20106. Their weapon mesh is 35566 (`plasmaburster_heavy.abiff`). The merchants use original textures 30862, 40903, 30839 and 30886, body-specific heads, and pistol mesh -7777 (`weapon_projectilesmall01.abiff`). All 20 distinct referenced resources +7777 (`weapon_projectilesmall01.abiff`). The initial 20 distinct referenced resources were checked against the original 14.9.1 resource database. Mesh 35566 occurs in both Supernova Mk VI and Westinghouse IM-50 item families, so it cannot identify the equipped item or its quality level. These visual lists add no @@ -82,11 +85,11 @@ the original translated consumers at runtime. `TestRecoveredNPCVisualsSurviveReloadWithoutEquipment` checks the captain's exact packet resources and unchanged gameplay state before and after cold load. `TestRecoveredNPCVisualsHaveBoundedPopulationAssignments` checks the -107 assignments and exclusions. `test_population_regeneration_preserves_recovered_visuals` +130 assignments and exclusions. `test_population_regeneration_preserves_recovered_visuals` checks that regenerating population data retains the YAML resources. -`TestBrowserNPCRecoveredAppearances` covers three representative profiles: -captain, lieutenant and weapons dealer. It checks two observers, native picking, -reconnect, and native heading comparisons. These are controlled appearance +`TestBrowserNPCRecoveredAppearances` covers five representative profiles: +male and female captains and lieutenants, and a weapons dealer. It checks two +observers, native picking, reconnect, and native heading comparisons. These are controlled appearance fixtures: unrelated NPCs are removed to avoid occlusion, while the selected NPC retains its authored position and facing. @@ -100,6 +103,50 @@ Focused Go regressions, `go vet ./server/...`, the four Python assignment tests and the complete 11,965-entry assignment catalog check passed. A broad server suite was not rerun for this change. +### Female officer omission and coverage audit + +The Female Captain report exposed an assignment-policy gap: the recovered +outfit pass required identical population code and body, so it excluded FECA +and FELI despite dressed male counterparts. The bounded-assignment test even +required an undressed Female Captain. Name/body completeness and successful +male-only browser fixtures did not establish uniform coverage. + +All eight FECA and fifteen FELI posts now use their counterpart's five Elite +armor textures and plasma weapon mesh. The existing female bodies remain: +MonsterData 26137 supplies head 40209, and 26076 supplies head 40635 in +`server/gamedata/monsters.yaml`. Item 22250 in +`server/gamedata/items/items_000.yaml` selects helmet 20055 for Opifex female +(breed 2, sex 3) and 20089 for Solitus female (breed 1, sex 3). These are +original resources with inferred role assignments, not recovered female +equipment lists. They add no combat stats or inventory items. + +`TestOfficerUniformsCoverBothSexesAtEveryPost` checks all four officer codes, +including exact body-specific heads, helmets, textures and weapons. Packet/cold +reload and population-regeneration regressions cover both female profiles. +The packet test excludes transport padding before parsing the appearance tail; +the previous male-only case happened to need no padding. + +Both female browser fixtures passed with two observers and reconnect; inspected +captures show their Elite armor, female helmets and plasma weapons. Artifacts +are under `local/npc-appearances/20261109-233343/`. Focused Go regressions, +all six Python assignment tests, the 11,965-entry catalog check and +`go vet ./server/... ./tools/data/audit_npc_outfits` passed. + +Run `go run ./tools/data/audit_npc_outfits` to audit explicit outfit coverage +independently of name/body confidence. It groups by code, body and appearance, +shows partially assigned profiles first, and gives an unassigned example for +each profile. It counts authored placements, not just currently loaded actors. +After this fix, 157 of 6,232 human placements have explicit outfits. Absence of +an assignment does not prove a base mesh has no clothing. + +The next bounded review candidates are 29 additional MAEL/FEEL Elite Guards +and nine OFPO Food Providers: each shares a code and body with an already +outfitted population. Guides also have 130 unassigned same-body placements +(60 OTGD, 48 CLGD, 22 NEGD). Review those roles' existing provisional outfit +and gameplay effects before expanding them; a shared body alone cannot assign +an outfit to unrelated roles. Female Corporals have no dressed counterpart in +the current data and need a separate uniform decision. + ## Provisional early-route outfits The A3 implementation equips the seven Omni Trade Elite Guards, both Food diff --git a/server/browser_npc_outfits_test.go b/server/browser_npc_outfits_test.go @@ -20,6 +20,7 @@ import ( func TestBrowserNPCRecoveredAppearances(t *testing.T) { testBrowserNPCAppearances(t, []string{ "705/district/0/fixed/15", "710/district/0/fixed/0", + "705/district/0/fixed/9", "705/district/0/fixed/13", "127/district/0/fixed/1", }) } diff --git a/server/gamedata/npc_visuals_test.go b/server/gamedata/npc_visuals_test.go @@ -1,6 +1,41 @@ package gamedata -import "testing" +import ( + "reflect" + "testing" +) + +func TestOfficerUniformsCoverBothSexesAtEveryPost(t *testing.T) { + profiles := map[string]struct { + monster, head, helmet uint32 + }{ + "MACA": {26151, 40171, 20038}, + "FECA": {26137, 40209, 20055}, + "MALI": {26088, 40687, 20106}, + "FELI": {26076, 40635, 20089}, + } + + counts := make(map[string]int) + for id, group := range NPCGroups { + profile, officer := profiles[group.TemplateCode] + if !officer { + continue + } + counts[group.TemplateCode]++ + want := NPCVisual{ + Head: profile.head, + Textures: [][2]uint32{{0, 15806}, {1, 15809}, {2, 15807}, {3, 15808}, {4, 15805}}, + Meshes: [][4]uint32{{0, profile.helmet, 0, 2}, {0, profile.head, 0, 4}, {1, 35566, 0, 2}}, + } + + if group.MonsterData != profile.monster || !reflect.DeepEqual(group.Visual, want) { + t.Errorf("officer %s (%s) lacks its body-specific uniform: %+v", id, group.TemplateCode, group.Visual) + } + } + if !reflect.DeepEqual(counts, map[string]int{"MACA": 35, "FECA": 8, "MALI": 52, "FELI": 15}) { + t.Fatal("officer population changed", counts) + } +} func TestRecoveredNPCVisualsHaveBoundedPopulationAssignments(t *testing.T) { counts := make(map[string]int) @@ -15,11 +50,11 @@ func TestRecoveredNPCVisualsHaveBoundedPopulationAssignments(t *testing.T) { } } - if len(counts) != 8 || counts["MACA"] != 35 || counts["MALI"] != 52 || counts["CSBI"] != 3 || + if len(counts) != 10 || counts["MACA"] != 35 || counts["MALI"] != 52 || counts["FECA"] != 8 || counts["FELI"] != 15 || counts["CSBI"] != 3 || counts["BQAU"] != 4 || counts["BQPW"] != 3 || counts["BQWR"] != 5 || counts["BTMV"] != 1 || counts["TAIL"] != 4 { t.Fatal("appearance coverage differs from the original-post and population-code matches", counts) } - if NPCGroups["705/district/0/fixed/9"].Visual.Head != 0 || NPCGroups["950/district/1/fixed/0"].Visual.Head != 0 { - t.Fatal("male captain or modern vendor appearance was assigned without matching evidence") + if NPCGroups["950/district/1/fixed/0"].Visual.Head != 0 { + t.Fatal("modern vendor appearance was assigned without matching evidence") } } diff --git a/server/gamedata/zones/zone_625.yaml b/server/gamedata/zones/zone_625.yaml @@ -1456,6 +1456,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [1320, 24.9001, 592.5] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 625/district/5/fixed/0 source_index: 0 - template_code: FMSE @@ -2496,6 +2510,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [2571.4238, 38.00484, 1253.846] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 625/district/7/fixed/0 source_index: 0 - template_code: MASR @@ -5380,6 +5408,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [1818.4918, 68.7001, 2181.932] + # Uniform inferred from MACA; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40209 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20055, 0, 2] + - [0, 40209, 0, 4] + - [1, 35566, 0, 2] id: 625/district/19/fixed/1 source_index: 1 - template_code: FECO @@ -5488,6 +5530,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [2792.9, 71.7001, 484.90002] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 625/district/19/fixed/7 source_index: 7 - template_code: MACA @@ -5835,6 +5891,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [2377.2256, 54.000103, 1065.2645] + # Uniform inferred from MACA; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40209 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20055, 0, 2] + - [0, 40209, 0, 4] + - [1, 35566, 0, 2] id: 625/district/19/fixed/25 source_index: 25 - template_code: MACA @@ -6671,6 +6741,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [2375.5, 51.000103, 1085] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 625/district/22/fixed/0 source_index: 0 - template_code: FMSE diff --git a/server/gamedata/zones/zone_650.yaml b/server/gamedata/zones/zone_650.yaml @@ -1116,6 +1116,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [906.745, 15.13735, 2314.7073] + # Uniform inferred from MACA; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40209 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20055, 0, 2] + - [0, 40209, 0, 4] + - [1, 35566, 0, 2] id: 650/district/7/fixed/0 source_index: 0 source_index: 7 diff --git a/server/gamedata/zones/zone_655.yaml b/server/gamedata/zones/zone_655.yaml @@ -1761,6 +1761,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [1834.521, 6, 2452.1697] + # Uniform inferred from MACA; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40209 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20055, 0, 2] + - [0, 40209, 0, 4] + - [1, 35566, 0, 2] id: 655/district/16/fixed/7 source_index: 7 - template_code: MAGU diff --git a/server/gamedata/zones/zone_670.yaml b/server/gamedata/zones/zone_670.yaml @@ -1705,6 +1705,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [1248.6997, 15.400001, 4116.0776] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 670/district/10/fixed/6 source_index: 6 - template_code: FELI @@ -1721,6 +1735,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [1258.4086, 15.400001, 4115.9004] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 670/district/10/fixed/7 source_index: 7 - template_code: MACO diff --git a/server/gamedata/zones/zone_695.yaml b/server/gamedata/zones/zone_695.yaml @@ -2259,6 +2259,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [1581, 14.9501, 754] + # Uniform inferred from MACA; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40209 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20055, 0, 2] + - [0, 40209, 0, 4] + - [1, 35566, 0, 2] id: 695/district/4/fixed/0 source_index: 0 - template_code: MACA @@ -2321,6 +2335,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [1452, 37.6001, 678.00006] + # Uniform inferred from MACA; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40209 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20055, 0, 2] + - [0, 40209, 0, 4] + - [1, 35566, 0, 2] id: 695/district/4/fixed/3 source_index: 3 - template_code: MACA diff --git a/server/gamedata/zones/zone_705.yaml b/server/gamedata/zones/zone_705.yaml @@ -449,6 +449,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [884, 16.4, 464] + # Uniform inferred from MACA; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40209 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20055, 0, 2] + - [0, 40209, 0, 4] + - [1, 35566, 0, 2] id: 705/district/0/fixed/9 source_index: 9 - template_code: FECO @@ -512,6 +526,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [980, 16.4, 512] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 705/district/0/fixed/13 source_index: 13 - template_code: FELI @@ -528,6 +556,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [980, 16.4, 648] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 705/district/0/fixed/14 source_index: 14 - template_code: MACA @@ -651,6 +693,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [888, 16.4, 496] + # Uniform inferred from MACA; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40209 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20055, 0, 2] + - [0, 40209, 0, 4] + - [1, 35566, 0, 2] id: 705/district/0/fixed/19 source_index: 19 - template_code: FELI @@ -667,6 +723,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [978.47754, 16.41, 514.5739] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 705/district/0/fixed/20 source_index: 20 - template_code: FELI @@ -683,6 +753,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [978.3423, 16.41, 501.53336] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 705/district/0/fixed/21 source_index: 21 - template_code: MACA diff --git a/server/gamedata/zones/zone_710.yaml b/server/gamedata/zones/zone_710.yaml @@ -249,6 +249,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [395, 17.000101, 391] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 710/district/0/fixed/1 source_index: 1 - template_code: FECO diff --git a/server/gamedata/zones/zone_735.yaml b/server/gamedata/zones/zone_735.yaml @@ -319,6 +319,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [731.6996, 17.4, 251.64337] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 735/district/0/fixed/2 source_index: 2 - template_code: FELI @@ -335,6 +349,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [720.40674, 17.400095, 361.3393] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 735/district/0/fixed/3 source_index: 3 - template_code: MALI diff --git a/server/gamedata/zones/zone_740.yaml b/server/gamedata/zones/zone_740.yaml @@ -411,6 +411,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [227.41136, 17.4, 376.86572] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 740/district/0/fixed/4 source_index: 4 - template_code: FELI @@ -427,6 +441,20 @@ districts: Source: tools/data/npc_assignments.json' positions: - [238.70341, 17.400095, 267.16974] + # Uniform inferred from MALI; retain the female body and its original default head. + # Helmet variant from item 22250; appearance-only assignment. See docs/npc-appearances.md. + visual: + head: 40635 + textures: + - [0, 15806] + - [1, 15809] + - [2, 15807] + - [3, 15808] + - [4, 15805] + meshes: + - [0, 20089, 0, 2] + - [0, 40635, 0, 4] + - [1, 35566, 0, 2] id: 740/district/0/fixed/5 source_index: 5 - template_code: MALI diff --git a/server/npc_visuals_test.go b/server/npc_visuals_test.go @@ -8,63 +8,75 @@ import ( ) func TestRecoveredNPCVisualsSurviveReloadWithoutEquipment(t *testing.T) { - data := testNPCData() - data.Playfields[0].Districts[0].Groups[0] = *gamedata.NPCGroups["705/district/0/fixed/15"] - useNPCData(t, data) - world := newTestServer(t) + for _, test := range []struct { + definition string + head, helmet uint32 + }{ + {"705/district/0/fixed/15", 40171, 20038}, + {"705/district/0/fixed/9", 40209, 20055}, + {"705/district/0/fixed/13", 40635, 20089}, + } { + t.Run(test.definition, func(t *testing.T) { + data := testNPCData() + data.Playfields[0].Districts[0].Groups[0] = *gamedata.NPCGroups[test.definition] + useNPCData(t, data) + world := newTestServer(t) - if err := world.flushWorld(); err != nil { - t.Fatal(err) - } - cold := newTestInventoryServer(t) - - for _, current := range []*server{world, cold} { - npc := current.characters[1000000] - if len(npc.inventory.Items) != 0 || npc.combatProfile != nil || npc.attackableNPC() || npc.equipmentBonus(90) != 0 { - t.Fatal("visual reconstruction invented equipment or combat stats") - } - packet := targetPacket(characterPacket(npc)) - if binary.BigEndian.Uint32(packet[30:34])&0x4000b != 0x4000a { - t.Fatal("recovered human appearance lost humanoid NPC initialization or clothing") - } - // Original 14.9.1 clothing layers, mesh attachments and implicit attack row. - reader := bytes.NewReader(packet[len(packet)-122:]) - count, _ := reader.ReadByte() - if count != 5 { - t.Fatal("captain has no five-part armor texture list", count) - } - for index, texture := range []uint32{15806, 15809, 15807, 15808, 15805} { - slot, _ := reader.ReadByte() - var row [3]uint32 - if err := binary.Read(reader, binary.BigEndian, &row); err != nil { + if err := world.flushWorld(); err != nil { t.Fatal(err) } - if slot != byte(index) || row != [3]uint32{uint32(index), texture, 1} { - t.Fatalf("wrong armor part: slot=%d row=%v", slot, row) - } - } - var layers [2]byte - var meshCount uint32 - binary.Read(reader, binary.BigEndian, &layers) - binary.Read(reader, binary.BigEndian, &meshCount) - if layers != [2]byte{} || meshCount != 4036 { - t.Fatal("clothing layer and mesh list boundaries changed", layers, meshCount) - } - for _, want := range [][4]uint32{{0, 20038, 0, 2}, {0, 40171, 0, 4}, {1, 35566, 0, 2}} { - slot, _ := reader.ReadByte() - var row [2]uint32 - binary.Read(reader, binary.BigEndian, &row) - layer, _ := reader.ReadByte() - if [4]uint32{uint32(slot), row[0], row[1], uint32(layer)} != want { - t.Fatalf("missing helmet, head or gun: %d %v %d", slot, row, layer) + cold := newTestInventoryServer(t) + + for _, current := range []*server{world, cold} { + npc := current.characters[1000000] + if len(npc.inventory.Items) != 0 || npc.combatProfile != nil || npc.attackableNPC() || npc.equipmentBonus(90) != 0 { + t.Fatal("visual reconstruction invented equipment or combat stats") + } + packet := targetPacket(characterPacket(npc)) + packet = packet[:binary.BigEndian.Uint16(packet[6:8])] + if binary.BigEndian.Uint32(packet[30:34])&0x4000b != 0x4000a { + t.Fatal("recovered human appearance lost humanoid NPC initialization or clothing") + } + // Original 14.9.1 clothing layers, mesh attachments and implicit attack row. + reader := bytes.NewReader(packet[len(packet)-122:]) + count, _ := reader.ReadByte() + if count != 5 { + t.Fatal("officer has no five-part armor texture list", count) + } + for index, texture := range []uint32{15806, 15809, 15807, 15808, 15805} { + slot, _ := reader.ReadByte() + var row [3]uint32 + if err := binary.Read(reader, binary.BigEndian, &row); err != nil { + t.Fatal(err) + } + if slot != byte(index) || row != [3]uint32{uint32(index), texture, 1} { + t.Fatalf("wrong armor part: slot=%d row=%v", slot, row) + } + } + var layers [2]byte + var meshCount uint32 + binary.Read(reader, binary.BigEndian, &layers) + binary.Read(reader, binary.BigEndian, &meshCount) + if layers != [2]byte{} || meshCount != 4036 { + t.Fatal("clothing layer and mesh list boundaries changed", layers, meshCount) + } + for _, want := range [][4]uint32{{0, test.helmet, 0, 2}, {0, test.head, 0, 4}, {1, 35566, 0, 2}} { + slot, _ := reader.ReadByte() + var row [2]uint32 + binary.Read(reader, binary.BigEndian, &row) + layer, _ := reader.ReadByte() + if [4]uint32{uint32(slot), row[0], row[1], uint32(layer)} != want { + t.Fatalf("missing helmet, head or gun: %d %v %d", slot, row, layer) + } + } + var weapon [5]uint32 + if err := binary.Read(reader, binary.BigEndian, &weapon); err != nil { + t.Fatal(err) + } + if weapon != [5]uint32{2018, 43712, 43713, 100, 1} || reader.Len() != 0 { + t.Fatal("visual gun changed the attack template or packet alignment", weapon, reader.Len()) + } } - } - var weapon [5]uint32 - if err := binary.Read(reader, binary.BigEndian, &weapon); err != nil { - t.Fatal(err) - } - if weapon != [5]uint32{2018, 43712, 43713, 100, 1} || reader.Len() != 0 { - t.Fatal("visual gun changed the attack template or packet alignment", weapon, reader.Len()) - } + }) } } diff --git a/tools/data/audit_npc_outfits/main.go b/tools/data/audit_npc_outfits/main.go @@ -0,0 +1,73 @@ +package main + +import ( + "ao/server/gamedata" + "fmt" + "os" + "sort" + "text/tabwriter" +) + +func main() { + // Separate body variants: shared names and codes do not establish compatible meshes. + type profile struct { + code string + monster uint32 + appearance uint16 + } + type coverage struct { + name, firstMissing string + assigned, unassigned int + } + profiles := make(map[profile]*coverage) + assigned, unassigned := 0, 0 + for id, group := range gamedata.NPCGroups { + if group.StaticMesh != 0 || group.Appearance>>4&7 >= 6 { + continue + } + key := profile{group.TemplateCode, group.MonsterData, group.Appearance} + if profiles[key] == nil { + profiles[key] = &coverage{name: group.Name} + } + entry := profiles[key] + if len(group.Visual.Textures) != 0 || len(group.Visual.Meshes) != 0 || len(gamedata.NPCOutfits[id]) != 0 { + entry.assigned += len(group.Positions) + assigned += len(group.Positions) + } else { + entry.unassigned += len(group.Positions) + unassigned += len(group.Positions) + if entry.firstMissing == "" || id < entry.firstMissing { + entry.firstMissing = id + } + } + } + + // Show partial coverage first, then rank by affected authored placements. + var missing []profile + for key, entry := range profiles { + if entry.unassigned != 0 { + missing = append(missing, key) + } + } + sort.Slice(missing, func(i, j int) bool { + a, b := profiles[missing[i]], profiles[missing[j]] + if (a.assigned > 0) != (b.assigned > 0) { + return a.assigned > 0 + } + if a.unassigned != b.unassigned { + return a.unassigned > b.unassigned + } + return a.firstMissing < b.firstMissing + }) + fmt.Printf("Human placements: %d assigned, %d without explicit outfits. Base meshes may include clothing.\n", assigned, unassigned) + output := tabwriter.NewWriter(os.Stdout, 0, 4, 2, ' ', 0) + fmt.Fprintln(output, "Code\tBody\tAppearance\tAssigned\tUnassigned\tExample\tName") + for _, key := range missing { + entry := profiles[key] + fmt.Fprintf(output, "%s\t%d\t%d\t%d\t%d\t%s\t%s\n", key.code, key.monster, key.appearance, + entry.assigned, entry.unassigned, entry.firstMissing, entry.name) + } + if err := output.Flush(); err != nil { + panic(err) + } +} diff --git a/tools/data/test_npc_assignments.py b/tools/data/test_npc_assignments.py @@ -30,6 +30,27 @@ class NPCAssignmentTests(unittest.TestCase): 'meshes': [[0, 20038, 0, 2], [0, 40171, 0, 4], [1, 35566, 0, 2]], }) + def test_population_regeneration_preserves_female_officer_uniforms(self): + assignments = npc_assignments.load_reviewed_groups() + groups = [ + {'id': '705/district/0/fixed/9', 'template_code': 'FECA'}, + {'id': '705/district/0/fixed/13', 'template_code': 'FELI'}, + ] + population = {'playfields': [{'districts': [{'groups': groups}]}]} + + npc_assignments.apply_to_population(population, assignments) + + self.assertEqual(groups[0]['visual'], { + 'head': 40209, + 'textures': [[0, 15806], [1, 15809], [2, 15807], [3, 15808], [4, 15805]], + 'meshes': [[0, 20055, 0, 2], [0, 40209, 0, 4], [1, 35566, 0, 2]], + }) + self.assertEqual(groups[1]['visual'], { + 'head': 40635, + 'textures': [[0, 15806], [1, 15809], [2, 15807], [3, 15808], [4, 15805]], + 'meshes': [[0, 20089, 0, 2], [0, 40635, 0, 4], [1, 35566, 0, 2]], + }) + def test_context_variants_keep_their_own_choice_and_evidence(self): # Define two context choices for the same template code. catalog = {'TEST': {'scope': 'maintained_population', 'selected': {'name': 'Common'}, 'variants': [