aorecomp

Anarchy Online classic in the browser

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


commit 9670614d764e77c2f55914c3c0f32ec8fe940571
parent 25965496cb9924c773eda36d02ddd952ce8ab344
Author: anon <anon@example.com>
Date:   Wed, 28 Oct 2026 18:24:54 +0000

Move fixed mission encounter clear of the back wall

Diffstat:
MTODO.md | 23+++++++++++++----------
Adocs/mission-placement.md | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mserver/gamedata/missions.yaml | 2+-
Mserver/mission_encounters_test.go | 2+-
Aserver/mission_placement_test.go | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mserver/mission_progress_test.go | 2+-
6 files changed, 151 insertions(+), 13 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -65,8 +65,11 @@ booth now completes the fixed contract and atomically grants authored cash and a selected-quality equipment reward. The fixed selection is provisional; the fixed mission now has five level-1 Leets using shared combat and loot. Indoor combatants now use shared body/collision probes to plan bounded detours; -native movement timing still needs refinement. Conditional completion token/XP -and historical population/reward generation remain open. +native movement timing still needs refinement. An earned level-2 Enforcer can +now select and defeat all five full-health encounters, collect corpse loot and +return the bound objective; see [mission placement](docs/mission-placement.md). +Conditional completion token/XP and historical population/reward generation +remain open. An ordinarily created Enforcer has now funded a request with corpse cash, entered the fixed mission, collected and returned its exact book, and retained the earned cash/glove across rejected wear, reconnect and cold restart. The same character @@ -1736,14 +1739,14 @@ client rendering fixes and checks are in [nano damage](docs/nano-damage.md). Shared combat visibility now rejects obstructions; broader encounter and navigation coverage remains separate. See [mission encounters](docs/mission-encounters.md). -- [ ] [P0] Verify and fix native targeting of every fixed-mission placement. - The ordinary earned-character run could fight the encounters at Z28, Z36 - and Z43, but could not select the far-wall Z48 encounter through Tab or a - visible-body click. Its native root settled near Z48.26 while the saved root - remained Z48. Diagnose room admission, mesh/body placement and native picking - before changing the placement or visibility rules. Verify every enemy can be - selected and defeated without provisioning; retain negative wall/LOS checks. - Captures are under `local/mission-kill-progress/`. +- [x] Verify and fix native targeting of every fixed-mission placement. + The far encounter now uses authored Z46, clear of the actual back-wall mesh; + room/floor admission alone did not establish a usable spawn. All five native + targets were selected and defeated from full health by the earned character, + with ordinary equipment, a learned buff and purchased healing supplies. + Tests cover every clear approach, back/side-wall rejection, ammunition and + checkpoint/cold recovery. Collision, room visibility and combat LOS rules + retain their shared behavior. See [mission placement](docs/mission-placement.md). - [x] [P0] Route indoor combatants around actual mesh obstructions. A bounded shared search probes candidate steps with the actor's original body, room, floor, wall, slope and gravity handling. Pursuit and exact return-home routes diff --git a/docs/mission-placement.md b/docs/mission-placement.md @@ -0,0 +1,79 @@ +# Fixed mission encounter placement + +The far encounter uses Z46 in the fixed reconstruction's authored positions. +Its Leet body fits inside the actual cave mesh and has a clear combat approach. +The other four placements retain their admitted positions and profiles. This +coordinate is a reconstruction choice, not an original mission-generation rule. + +## Geometry evidence + +The original `llr.dll` SHA256 +`ebb09047f6ead192388f7ddfb4795da5013a60f7c2d1c3933ec02eef58a10132` +implements room admission in `n3Room_t::IsPosInside` at `0x10031910`, with tile +lookup at `0x100326e0`. These check the rotated tile bounds, nonempty tile type, +floor and ceiling heights. They do not test the character's body against the +room mesh. REA/Ghidra evidence is retained as +`ev_4b104d28c92b6f5d53a7c6d27ef53d25ac5f6cc0775c80e06570914ad054cf56` +and `ev_c10492347dc4e670a2642c1cb0f309840ea4cbd7bc4ade90a4bc041ebaeb0058` +under `local/mission-placement/llr-room-*.json`. Static decompilation establishes +that admission boundary, independently of runtime picking. + +At Z48, the accepted root passes the room/floor checks but its original Leet +collision sphere intersects the back-wall mesh. Probing the copied actor through +the shared physical integration settles it at approximately +`[15.010143, .011, 48.260735]`, matching the earlier native WASM observation. +Combat visibility from the reachable Z43 approach is blocked. Z47.5 can miss a +sphere collision while still lying behind the wall; a floor or collision miss +alone therefore does not establish a reachable encounter. + +At Z46, the body has no wall contact and the approach has clear visibility. +The correction changes the authored coordinate. It does not alter physical +collision, native picking, room visibility, or server combat LOS rules. +Accepted instances retain their concrete saved actors rather than re-reading +the recipe; the earlier completed assignment retains its original far-wall +actor until normal retirement. + +## Regression checks + +`server/mission_placement_test.go` enters a real accepted instance and attacks +each of its five full-health enemies through the ordinary ranged combat handler. +Each clear approach produces a nonlethal hit and one ammunition cost; a world +checkpoint and cold load retain those results. Back-wall and side-wall attempts +must preserve health, ammunition and zero kill progress. The pre-fix regression +fails the far-room approach and back-wall distinction. + +The focused server/gamedata run passed 161 roots and 921 results, including +mission acceptance, movement, encounters, kill progress, retirement and combat +visibility. Race checks passed four roots and fifteen results. Vet and the +preview build passed. Logs and the temporary physical probe are retained in +`local/mission-placement/`. + +## Native room-clear check + +The GPU WASM run resumed the earned level-2 Enforcer, cast its learned +Thug's Delight and accepted a fresh fixed assignment. The native far encounter +settled at Z46.01, with no back-wall displacement. Native targeting and ordinary +bat combat defeated all five original 100HP enemies, starting each fight at the +character's full 91HP. Kills awarded 500XP in total; purchased laboratory charges +supplied recovery. No skills, HP, enemies, cash or equipment were provisioned. + +Native opening of two corpses awarded five credits. A drag did not transfer the +first displayed Monster Part, and it expired before the subsequent pick/place +attempt completed. Picking fresh Part68 and placing it into inventory slot71 +succeeded. Normal expiry subsequently removed all five corpse actors while +retaining that exact owned item and all five saved deaths. + +Returning bound book65 to the issuing booth completed assignment64 and awarded +20credits and QL2 Metaplast glove69. Key64/book65 were consumed while Part68 +remained owned. The character finished at level2, 2500 cumulative XP (1050 +within the level), 5139IP, 52credits, full 91HP/24nano and 26 laboratory charges +(13 used). Its two earlier earned QL2 gloves and all issued/equipped instances +remained intact. Completion XP/token eligibility is still a separate P0 task; +this check adds no inferred completion XP or token reward. + +A cold server restart and fresh GPU WASM client retained all eleven owned +instances, including Part68 and reward69, their native template endpoints, +resources and all five deaths. No private corpse actor was recreated. The +previous completed assignment retained its own separate population. Database +integrity/foreign-key checks and native exception/abort checks passed. Owned +test clients were closed, leaving the single default-port preview available. diff --git a/server/gamedata/missions.yaml b/server/gamedata/missions.yaml @@ -29,7 +29,7 @@ - definition: 950/district/2/group/0/authored_point level: 1 positions: - - [15, 0, 48] + - [15, 0, 46] - [15, 0, 43] - [15, 0, 36] - [15, 0, 28] diff --git a/server/mission_encounters_test.go b/server/mission_encounters_test.go @@ -42,7 +42,7 @@ func TestMissionEncounterAcceptanceCommitsConcretePopulationAndRestoresIt(t *tes len(cold.mobileNPCs[65536]) != 5 || !reflect.DeepEqual(mission, cold.characters[1].missions[0]) || len(output.packets) != 2 { t.Fatal("accepted population or contract changed on restart", world.nextNPC, cold.nextNPC, output.packets) } - for index, z := range []float32{48, 43, 36, 28, 20} { + for index, z := range []float32{46, 43, 36, 28, 20} { id := 2000000 + uint32(index) npc, restored := world.characters[id], cold.characters[id] if npc == nil || restored == nil || npc.id != id || npc.playfield != 65536 || npc.level != 1 || npc.monsterData != 17655 || diff --git a/server/mission_placement_test.go b/server/mission_placement_test.go @@ -0,0 +1,56 @@ +package main + +import "testing" + +func TestFixedMissionEncounterPlacementsAdmitClearCombatAndRejectWalls(t *testing.T) { + for _, scenario := range []struct { + name string + npc uint32 + position [3]float32 + blocked bool + }{ + {"far room", 2000000, [3]float32{15, .011, 44.5}, false}, + {"middle room", 2000001, [3]float32{15, .011, 41.5}, false}, + {"near passage", 2000002, [3]float32{15, .011, 34.5}, false}, + {"entrance passage", 2000003, [3]float32{15, .011, 26.5}, false}, + {"raised entrance", 2000004, [3]float32{14.01, 1.5625, 22.01}, false}, + {"back wall", 2000000, [3]float32{15, .011, 48.5}, true}, + {"side wall", 2000000, [3]float32{20, .011, 44.5}, true}, + } { + t.Run(scenario.name, func(t *testing.T) { + world, client, _ := enteredMissionEncounterWorld(t) + player, npc := world.characters[1], world.characters[scenario.npc] + player.position, player.stats = scenario.position, testCharacterStats() + player.inventory.LastID = world.nextItem + 1 + player.inventory.Items = append(player.inventory.Items, ownedItem{ID: player.inventory.LastID, Type: 51018, Template: 123742, Quality: 1, Slot: 6, Count: 1, Ammo: 3}) + if err := world.saveInventory_locked(player, player.inventory); err != nil { + t.Fatal(err) + } + world.combatRoll = func(uint32) uint32 { return 0 } + + if err := world.handleCombat(client, attackPacket(1, npc.id)[20:]); err != nil { + t.Fatal(err) + } + world.advanceCombat(player.nextAttack) + if err := world.flushWorld(); err != nil { + t.Fatal(err) + } + cold := reloadMissionEntranceWorld(t) + + if scenario.blocked { + if npc.health != 100 || cold.characters[npc.id].health != 100 || world.items[player.inventory.LastID].Ammo != 3 || cold.items[player.inventory.LastID].Ammo != 3 { + t.Fatal("a wall allowed damage or an ammunition cost", npc.health) + } + } else if npc.health == 0 || npc.health >= 100 || cold.characters[npc.id].health != npc.health || world.items[player.inventory.LastID].Ammo != 2 || cold.items[player.inventory.LastID].Ammo != 2 { + t.Fatal("accepted encounter could not receive an ordinary clear-path hit", npc.position, npc.health) + } + var kills int + if err := cold.db.QueryRow("SELECT sum(killed) FROM mission_encounters").Scan(&kills); err != nil { + t.Fatal(err) + } + if kills != 0 { + t.Fatal("placement check unexpectedly killed an encounter", kills) + } + }) + } +} diff --git a/server/mission_progress_test.go b/server/mission_progress_test.go @@ -12,7 +12,7 @@ func TestMissionEncounterProgressRetainsEachSelectedLevel(t *testing.T) { world, _ := newMissionEncounterOfferWorld(t) client := world.clients[1] client.missionOffer.definition.Encounters = []gamedata.MissionEncounter{ - {Definition: "950/district/2/group/0/authored_point", Level: 1, Positions: [][3]float32{{15, .011, 48}}}, + {Definition: "950/district/2/group/0/authored_point", Level: 1, Positions: [][3]float32{{15, .011, 46}}}, {Definition: "950/district/2/group/0/authored_point", Level: 2, Positions: [][3]float32{{15, .011, 43}}}, }