Skip to content

Log the player's vital updates and death-teleport arrivals - #331

Merged
eriknihlen merged 2 commits into
mainfrom
diag/death-recall-vitals
Nov 26, 2026
Merged

eriknihlen merged 2 commits into
mainfrom
diag/death-recall-vitals

Conversation

@eriknihlen

Copy link
Copy Markdown
Owner

Logging only, with no behaviour change. When a character is next left at 0 health at the lifestone after a death, these lines should show which of two things happened:

  • A: the client refused the server's health restore, or
  • B: the server never ended portal space, because it didn't handle our login complete, or the client never arrived and so never sent it.

New client-log lines

They use the console's -- notice style and go to client.log with or without --console.

  • Refused own vital updates, every time, with the reason:
    • -- vital: health 140 (id 2) seq 17: refused, sequence 17 vs held 18; health now 147
    • -- vital: health 147 (id 2) seq 3: refused, not in items; health now unknown
    • -- vital: stamina 90 (id 4) seq 5: refused, no player guid; stamina now unknown
  • Taken own vital updates, only while a death is watched. That is from the update that brings health to 0 until health comes back, or until a still-dead warning has been written:
    -- vital: health 0 (id 2) seq 20: taken; health now 0
  • Other refused own quality updates, at most one line per property every 10 s:
    -- quality: own Int property 25 seq 9: refused, sequence 9 vs held 40 (2 more refused since the last line)
  • Login complete after a teleport:
    • -- login complete sent: teleport 3 arrived at 0x81640007
    • If the login's own login complete was still held, the teleport releases it instead, and both the release and the actual send are logged.
  • One-shot warnings, on the session clock:
    • -- still dead 30 s after the death teleport 5 to 0x81640007 (last health update: s=50.000, 0, taken)
    • -- still dead 60 s after dying with no teleport arrival (last health update: ...)

One change from the original request: taken vital updates are not logged every time. The request assumed they are rare. They aren't: ACE sends regeneration updates every few seconds, and one per hit or cast in combat. Logging all of them would cycle a farming bot's 8 MiB of client.log in under two days. Refusals are always logged. Taken updates are logged only around a death, which is the window that matters.

How it works

  • The world model stays pure. It notes what it did with each own-player single-quality update, in a queue capped at 64.
  • A new owner, session/vital_watch.rs, rate-limits those notes, remembers the last health update and runs the death timers.
  • The session turns the notes into a new HostEvent::Diagnostic(String).
  • QualityStamps::held lets a refusal name the sequence it was compared against.
  • Which updates are taken or refused is unchanged.

What reading the code found (not yet confirmed live)

  • The player's object stays in the client's object list through portal space. It isn't removed on delete or when objects go out of range. So "not in items" is unlikely.
  • Nothing resets the sequence counters on death or teleport.
  • ACE's restore sends each vital twice, out of order, with the same value. See ACE's Player_Death.cs and Player_Location.cs. So a refused, sequence N+1 vs held N+2 line right after a taken line for the same 75% value is normal on every death, not the bug.
  • Together this makes A look unlikely and B more likely. The new lines are meant to settle that.

Tests

  • 17 new tests: session::vital_watch, session::state, world::tests, and ac-core's quality stamps.
  • Each was shown to fail with its code removed.
  • scripts/check.ps1 passes. One earlier full run crashed in ac-render's GPU tests with an access violation. This PR doesn't touch ac-render; those tests passed run alone (849/849), and the next full run passed.
  • There is no test through the runner loop, because it needs a live connection. The runner's send of a held login complete now goes through SessionState::send_held_login_complete, which a test pins.

🤖 Generated with Claude Code

eriknihlen and others added 2 commits November 25, 2026 21:34
A character left at the lifestone with 0 health after a death stayed
there for hours until a relog, and the client log could not say why: the
server's health restore may have been refused by the client (no item
record, or an older sequence than the one held), or login complete may
never have ended the server's portal space. Neither left a line.

Now the client log gets, with no change to what is taken or refused:
- every vital update of the player's own, its value, sequence and what
  the world did with it (taken, or refused and why, with both sequences);
- any other refused update of the player's own, once per property every
  10 s;
- login complete going out at a teleport's arrival, or the login's held
  one released by it and then sent;
- one warning when the health is still 0 on the session clock 30 s after
  an arrival that followed a death, naming the last health update.

The world notes what it did; the session turns the notes into a new
HostEvent::Diagnostic, which the console prints and the multi-session
host also writes to the client log without --console. The lines are
documented in launch-options.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of the death-recall logging. A farming bot gets several taken
vital updates a second from regeneration and combat; logging all of them
would cycle its client log in under two days. Taken vital updates are
now logged only while a death is watched (from the health seen at 0
until it comes back, or until a still-dead warning was written);
refusals are always logged, other kinds still at most once per property
every 10 s. A session that never dies writes no vital lines.

The still-dead warning after an arrival kept moving its deadline with
every later arrival, so a bot recalling more often than every 30 s while
dead never got it; the first arrival now sets the time and a later one
only changes the teleport it names. A death followed by no arrival at
all (the client never arrived, so never sent login complete) now warns
once after 60 s. The health coming back ends the death and anything
pending for it; the separate died flag is gone.

The runner sends the held login complete through the session state, so
it cannot go out without its line. A test through the runner was not
practical: the runner loop can only be built over a live connection,
and the loopback harnesses reach the held path only with a window that
draws the world or with the game data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eriknihlen
eriknihlen merged commit 9e48d06 into main Nov 26, 2026
5 checks passed
@eriknihlen
eriknihlen deleted the diag/death-recall-vitals branch November 26, 2026 05:07
eriknihlen added a commit that referenced this pull request Nov 26, 2026
Plugins are no longer stopped as stuck while the client waits on a slow
disk (#330), and the client logs what it needs to explain a character left
at 0 health after a death recall (#331).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant