NPC health recovery
Living NPCs recover health on the server, including creatures without a combat profile. Recovery uses the shipped 14.9.1 client's generic NPC prediction branch. The unavailable original server's numeric recovery policy and scheduler are not established by this client code. The current 100 maximum HP remains provisional; see NPC combat profiles.
Recovered client behavior
Original kkr.dll SHA-256
a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0,
FUN_1006ea50, checks recovery every two seconds and advances a counter by
two. Its NPC byte at actor offset 0x1b4 selects the health branch at
1006f4b9. With weapon-controller state 1 (idle) and stat 519 equal to zero:
health_interval = 1
health_delta = max(1, trunc(maximum_health / 120))
Otherwise it doubles HealInterval342 and retains HealDelta343. On an eligible
counter, it adds trunc(effective_BodyDevelopment152 / RestModifier425) to
that delta and clamps health to its maximum. Actor flag 0x10 at +0x11c
disables recovery. The separate player interval calculation in FUN_10074560
does not run for NPCs; applying the player's stamina formula gives the wrong
combat interval here.
A read-only probe of the published WASM client verified that the Leet spawn sets the NPC byte and retains interval 30, delta 3, base Body Development 5, RestModifier 100 and stat 519 equal to zero. The small ability contribution does not reach the next integer quotient of Body Development / 100. Its combat branch therefore gains 3 HP at counters divisible by 60. The idle branch gains 1 HP each check for the supported maximum of 100. There is no instantaneous full-health reset on stopping combat.
The two-second trigger belongs to the local GameTime singleton. Original
GameTime_t::RunFunction at 1000c3c0 alternates its tick phase; the actor
update tests byte +0x1d. Each actor owns a separate recovery counter at
*(actor + 0x188) + 0x34, initialized to zero by 10059770. The recovered
FullUpdate, HealthDamage, StopFight and GameTime update paths do not synchronize
that counter or the local trigger phase. Independently loaded clients can
therefore reach combat counter 60 at different times. This is bounded evidence
from those message paths, not proof about every unexamined protocol class.
The controlled baseline omitted server recovery. After a nano hit, the native Leet gained 3 HP at combat counter 60. After moving out of attack range, its weapon controller became idle; HP rose from 53 to 59 as its counter advanced from 84 to 96, while server health stayed fixed. This demonstrates client prediction, not original-server authority.
REA record
ev_9df66de8d0f05217a69046147043bfd7e0d2bd2483793a59a51bb25b74be2ca0
retains the update and player interval decompilation. Original instruction
addresses and baseline snapshots are in local/npc-regeneration-research/.
Server policy and delivery
The native recovery branch has no species, level or weapon-profile predicate. NPC spawns currently retain the same interval, delta, Body Development, RestModifier and stat-519 inputs, so recovery applies independently of the combat-profile catalog. This does not establish the original server's creature balance. NPC nano recovery and changed recovery stats remain outside the implementation.
The server keeps one two-second phase and counter per living NPC. Recovery runs within 200 metres horizontally of a ready, non-loading player in the same playfield and for fifteen minutes after the last nearby player leaves. After that, dormant NPCs retain their health and clock until a player returns. Starting or stopping an attack changes the applicable branch without resetting that phase or granting an additional heal. A late scheduler visit performs one check and skips the stalled backlog, following the existing player recovery policy. A fresh respawn gets full health and a new clock; dead remains cannot heal. Recovery stays in memory between periodic world checkpoints. Restart restores checkpointed NPC HP with a fresh recovery clock; it does not replay offline healing. Significant Fling damage outcomes commit immediately, as described in Fling Shot.
Health corrections use the existing zero-feedback HealthDamage packet. They reach only ready observers that already know the NPC in its playfield. An actual recovery change publishes immediately, including during combat. Otherwise quiet periodic corrections still wait while the NPC or an attacker targeting it is fighting. No unchanged combat HP update is added.
The maintained HealthDamage receiver in
client/game/kkr.dll/lifted-0052.c::sub_360B0A50 records which received weapon
results the absolute HP already includes. Those results retain their damage,
animation, feedback and ammunition, but do not debit HP again at impact. Later
hits still apply normally. A committed recovery therefore reaches both clients
without stopping an attacker or discarding its queued results. These updates do
not synchronize independent client recovery phases or establish the original
server's publication cadence.
Original holder stop 10079250 drains all queued weapon results against its
current resolved target through 100ab5a0, then clears its special-action
queue. Stopping the NPC drains its outgoing results, not the player's hits
against it. Periodic quiet corrections retain this stop-before-snapshot ordering,
with matching targets and no later result from that engagement.
The original HealthDamage body assigns HP without draining results or resetting
recovery; the maintained reconciliation above accounts for received outcomes.
Missing or changed targets remain separate ordering questions. The exact source
ledger, retained records and generated message bodies are in
local/npc-regeneration-research/native-followup/.
Admitted NPC profiles now retain engagement outside their weapon range, including fixed spawns. Repeatedly stopping and restarting a ranged target had selected idle recovery on the server while clients' independent phases sometimes checked the brief combat state, accumulating visible HP differences. The shared engagement rule preserves the opponent and swing deadline without dealing an out-of-range hit or changing recovery rates. Shared pursuit now handles admitted fixed and roaming encounters independently of their idle-wandering policy.
A contemporary March 2003 mission-boss discussion, post 16 reports substantially faster boss recovery after combat ends. It provides no numeric rate, Leet measurement, or original-server capture. Later guides and the local Fandom pages likewise do not establish a 14.9.1 Leet server formula; they are not substitutes for that missing evidence.
Verification
Combat recovery before weapon impact
TestBrowserNPCCombatRecovery reproduces the recorded false-zero target HP
with two controlled native clients. An injured Leet begins at10 HP. Both players
receive its ordinary combat start and baseline HP, avoiding unrelated idle
prediction during login. The owner's real Q attack delivers a normal5-point
hit. A controlled scheduler phase then executes one real3-point combat recovery
while that result is pending. A second normal hit leaves authoritative HP3.
Previously both clients reached HP0 because the recovery update was withheld.
The actual recovery now reaches both clients at HP8 while the first result
remains unchanged in each queue. Its impact retains8; the later hit leaves3.
Both server attack/recharge deadlines and engagements are unchanged by recovery.
A third real hit commits death and creates the native corpse on both clients.
No extra recovery feedback, attack cancellation or result is added. This verifies
publication and reconciliation, not earned progression or recovery cadence.
Captures: local/npc-combat-recovery/20261102-211705/.
Public scheduler regressions cover actual combat recovery, incoming-only combat, both observers, unchanged clocks/phase, zero-feedback bytes and no duplicate publication on repeated visits. Existing quiet corrections, readiness/interest, clamping and periodic checkpoint behavior remain covered.
Recovery rates and quiet reconciliation
Focused tests cover idle/combat rates, the native maximum-health division boundaries, clamping, scheduler jitter/backlogs, repeated visits, disengagement ordering, incoming weapon queues, observer interest/readiness, recovery without clients, dead/player exclusions and fresh respawn state. Player regeneration tests also exercise the shared quiet correction.
go test ./server/... passed (server 107.905 seconds). The focused NPC and
player regeneration tests passed five repetitions under the race detector
(94.593 seconds).
Two published WASM clients verified a real nano hit from 100 to 89 HP, 3-point server combat recovery at counter 120, and recovery after leaving attack range. A 40-sample idle capture followed server HP from 94 to 100: each two-counter step added exactly one HP, with native HP at most one prediction tick ahead. Both native clients and the server ended at 100 HP. A second encounter began from that recovered maximum and inflicted 19 damage. The separate killed Leet stayed dead throughout. Screenshots showed ordinary melee feedback without extra recovery messages.
The 120 captured samples and 20 checked assertions are retained in
local/npc-regeneration-smoke/verification.json. The agent-owned game pages
were unloaded after verification. Current manual testing uses the single
default-port HTTPS preview.
Recovery without a combat profile
Fling testing exposed an incorrect server gate: only MonsterData 17655 at level 1 with a combat profile could recover, while native prediction also ran for the unprofiled Reet of Paradise. Server HP remained 87 while the native clients recovered independently.
Fresh read-only probes of two published WASM clients reproduced that gap:
the owner saw Reet HP 92 and the observer later saw 98, while SQLite remained
87. Both Reets had NPC byte 1, flags 0, idle weapon state 1, interval 30,
delta 3, base Body Development 5, RestModifier 100 and stat 519 equal to zero,
matching the Leet. Their maximum 100 came from this development server; it
does not prove historical Reet HP. Original FUN_1006ea50 at 1006f4b9
branches on the NPC byte, weapon state and stat 519, with no species or level
test. The retained REA record above and its complete exported contents were
reused; no new binary session was necessary.
Regression tests first failed on the unprofiled Reet and periodic-checkpoint
cases, then passed after removing the gate. They also cover higher levels,
including extended level 300, and verify that recovery waits for a world
checkpoint before changing stored HP. A Reet combat profile remains separate:
two distinct shipped peck weapons are leads, and neither is yet bound to RT01.
Source records, bounded historical research and native captures are retained
under local/reet-regeneration-research/.
The updated full suite passed with go test ./server/... -count=1 (server
359.062 seconds, gamedata 7.513 seconds). NPC/player recovery tests passed three
repetitions under the race detector (123.269 seconds).
Two-client checks delivered the same seven-point special, taking the Reet from 100 to 93 HP. After the attacker's disconnect/reconnect ended retaliation, both native heaps and the database reached 100. A separate combat capture confirmed that clients can predict their three-point combat ticks at different phases. Actual server recovery now publishes through the reconciled snapshot above; subsequent quiet corrections still settle the remaining prediction drift.
For idle verification the attacker moved beyond the Reet's melee range before
firing a nine-point special. Both native heaps showed 91, 92 and 93 HP, then
100 in the final idle samples. Both clients received every authoritative
one-point correction from 92 through 100 with zero damage-feedback fields.
The 28 sampled pairs stayed within one native prediction tick of the last
correction, with no cumulative drift; their recovery counters retained distinct
phases. SQLite reached 100 at its periodic checkpoint. All 192 item rows were
unchanged, including loaded ammunition 19. These browser runs reported no page
errors or unimplemented adapters, and their owned browser contexts were closed.
The checked report is local/reet-regeneration-research/verification.json.
Special-attack recovery comparison
The earlier Fast Attack animation smoke's 54/51 HP captures were taken at different times during retaliation. Their preceding native snapshots already showed 72/69: the owner's recovery counter had crossed 60 while the observer's counter was 264. A later normal 18-point hit retained the three-point gap. Those captures suggested a recovery-phase difference, but did not establish simultaneous agreement or post-combat reconciliation.
A fresh pair of published GPU WASM clients sampled native state concurrently every 100 ms. The Giant Snake received the same eight-point Fast Attack and eight-point ordinary hit on both clients, leaving 84 HP. After the player stopped attacking, the NPC continued retaliating. Each native counter crossed 120 once and added three HP, 11.409 seconds apart. There were 109 paired samples within 150 ms of each other showing HP 87/84, both NPC controllers fighting, and the player's ordinary and special queues empty. No absolute NPC correction arrived during the engagement. This reproduces the difference independently of special damage delivery and explains the earlier three-point observation.
Walking out of range delivered the NPC's StopFight after the player's earlier stop. The next quiet correction set HP 88, followed by each integer through 100 with zero feedback fields. Across 374 steady idle samples, native HP stayed within one prediction tick of the latest settled correction. Both final native heaps and checkpointed SQLite HP were 100. The equipped axe retained its exact instance and slot; neither browser reported an error. Screenshots showed ordinary hit feedback without recovery damage messages.
TestWeaponSpecialRecoveryWaitsForBothCombatantsToStop covers Fast and Fling:
the player's stop does not publish absolute NPC HP during retaliation; moving
out of range stops the NPC before a single phase-preserving idle correction.
This comparison leaves the general combat healing/inspection ordering audit
open. Captures, the checked report and owned-fixture cleanup verification are
in local/special-health-smoke/verification.json and cleanup.json.
The focused new test passed in 7.750 seconds. Weapon-special and NPC/player recovery tests passed three repetitions under the race detector in 108.843 seconds; vet and diff checks passed. Both owned browser contexts were closed. Cleanup removed only the two fixture players, their axe and their NPC references, with unrelated-row hashes and SQLite foreign-key/integrity checks unchanged. Existing players 8/24 were retained and the single HTTPS preview was restored on its default ports. This follow-up changes tests and documentation only.