aorecomp

Anarchy Online classic in the browser

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


commit a35d2946d6e5b5d6df04c1676bdc6f3dd9837af7
parent a3b3b4ac2d5ca75f29ac1d9569d8da43fffdf8e9
Author: anon <anon@example.com>
Date:   Thu, 22 Oct 2026 08:26:35 +0000

Correct quiet health without phantom damage feedback

Diffstat:
MTODO.md | 2+-
Mdocs/combat-npc-balance.md | 4++--
Mdocs/combat-regeneration.md | 21+++++++++++++++++++++
Mserver/regeneration.go | 9++++++---
Mserver/regeneration_test.go | 5++++-
5 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -84,7 +84,7 @@ recorded in [inventory behavior](docs/inventory.md). positions and sizes are accepted or rejected at the recovered range boundary. - [ ] Reject attacks through one solid obstruction. Check: the same stationary encounter works in the open and fails with a wall between the actors. -- [ ] Reconcile quiet health without phantom damage feedback. Check: after a +- [x] Reconcile quiet health without phantom damage feedback. Check: after a long native fight, prediction drift is corrected to server HP without extra nanobot-damage chat or floating damage, including for an observer. diff --git a/docs/combat-npc-balance.md b/docs/combat-npc-balance.md @@ -98,8 +98,8 @@ template 120910/120910, QL 1 and holder slot 100 in both native heaps. A real intervals under the world tick. Both clients displayed matching damage and the fallen Leet, then reconnected after a server restart with the profile still selected and fresh NPC health. Evidence is retained in `local/npc-profile-smoke/`. -The long fight also exposed phantom nanobot-damage text from existing quiet -health corrections; that synchronization issue is recorded separately in TODO. +Quiet health corrections use the native zero-feedback message described in +[combat regeneration](combat-regeneration.md), including after a long fight. ## Online search and limits diff --git a/docs/combat-regeneration.md b/docs/combat-regeneration.md @@ -122,6 +122,27 @@ During combat, recovered regeneration advances authoritatively and the client predicts it; native animation timing and prediction phase can still temporarily differ from server state. The next quiet correction reconciles the display. +Quiet health uses `HealthDamage` (`0x3710256c`) with four uint32 fields: +absolute HP, zero signed change, zero damage type and zero death reason. +The native reader `client/game/kkr.dll/lifted-0052.c` `sub_360B09C0` reads +those fields; `sub_360B0A50` assigns absolute health and uses the separate +change field for feedback. Zero change makes `sub_3601D0B0` return before +chat or floating text. This corrects prediction drift without announcing a +new hit or heal. The reader and handler are retained in REA record +`ev_8687fd6e603c302e4ab3fee7b405ea3e5c9a615e0f56bff18dd20ff949da8d4c`. +The generic `0x2b333d6e` stat handler derives HP feedback from the local +difference and is unsuitable for quiet reconciliation. Nano retains its +existing private absolute-stat update. + +Two published WASM clients verified forced downward (922 to 800) and upward +(800 to 850) corrections without hit or healing feedback. A subsequent fight +recorded 26 Leet bites totaling 163 damage. After the kill, the owner's stats +showed the authoritative 693/922 HP, with normal melee messages and no phantom +nanobot damage or floating correction text. The observer's target bar also +reconciled silently. Screenshots and fixture state are retained in +`local/quiet-health-smoke/`. Reconnecting retained the authoritative current +health and continued receiving quiet corrections without feedback. + ## State and delivery ordering The state lock protects actors and current session ownership. The update lock diff --git a/server/regeneration.go b/server/regeneration.go @@ -66,9 +66,12 @@ func (server *server) advanceRegeneration(now time.Time) { } } if quiet { - body := binary.BigEndian.AppendUint32(nil, 27) - body = binary.BigEndian.AppendUint32(body, player.health) - server.queueCombat_locked(updates, player, player, n3Packet(0x2b333d6e, 50000, id, body)) + // HealthDamage assigns absolute HP; a zero change suppresses feedback. + var body []byte + for _, value := range []uint32{player.health, 0, 0, 0} { + body = binary.BigEndian.AppendUint32(body, value) + } + server.queueCombat_locked(updates, player, player, n3Packet(0x3710256c, 50000, id, body)) } body := binary.BigEndian.AppendUint32(nil, 214) body = binary.BigEndian.AppendUint32(body, player.nano) diff --git a/server/regeneration_test.go b/server/regeneration_test.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "encoding/binary" "testing" "time" @@ -94,7 +95,9 @@ func TestRegenerationCorrectsAbsoluteIdleResourcesForOwnerAndObserver(t *testing if len(conn.packets) != 2 || len(observer.packets) != 1 { t.Fatalf("resource recipients: owner=%x observer=%x", conn.packets, observer.packets) } - if binary.BigEndian.Uint32(conn.packets[0][29:33]) != 27 || binary.BigEndian.Uint32(conn.packets[0][33:37]) != 20 || + if binary.BigEndian.Uint32(conn.packets[0][16:20]) != 0x3710256c || + !bytes.Equal(conn.packets[0][29:45], []byte{0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) || + !bytes.Equal(conn.packets[0][16:], observer.packets[0][16:]) || binary.BigEndian.Uint32(conn.packets[1][29:33]) != 214 || binary.BigEndian.Uint32(conn.packets[1][33:37]) != 0 { t.Fatalf("absolute resource correction: %x", conn.packets) }