Skip to content

Land hits from the attacker's client and sync player health - #40

Draft
absol89 wants to merge 4 commits into
API-playtestfrom
claude/party-health-sync
Draft

absol89 wants to merge 4 commits into
API-playtestfrom
claude/party-health-sync

Conversation

@absol89

@absol89 absol89 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Requested by Eric · project thread

Based on v1.8.7-10 (same commit as API-playtest). No protocol changes; one small server fix.

Why

Damage logs from the diagnostic build (#39) showed:

  • A party member only took an enemy hit when their own replayed copy of the enemy connected: 4 of 10 real hits landed. PvP hits had the same problem, so friendly fire landed one way and not the other.
  • Regen and heals are never sent, so copies of other players only lose health (88 HP off after a minute).

What

  • HookDamageActor: when the local player or an NPC owned here hits a remote player, send the raw hit for that player. The local player ignores hits from any remote attacker's copy. The PvP-off rule (players and their summons) is applied on the sending side.
  • OnHealthChangeBroadcast: a delta for the local player is applied through the game's own DamageActor (Actor::ApplyHitFromOwner), so the player's difficulty (3x on Legendary for PvP too), bleedout and death work as for a local hit. Deltas for remote players are ignored.
  • OnActorValueChanges: remote players take their owner's health from the actor value sync; the local player's health is now sent every 250 ms when it changes (RunPlayerHealthUpdates), independent of party.
  • Server: OnHealthChangeBroadcast subtracted damage with the wrong sign from the stored health used for later spawns.
  • Also carries the build_version xmake option from Log damage and health sync events to find doubled or missing party damage #39.

Verified / assumed

  • Assumed: the original DamageActor with no attacker applies the player difficulty multiplier and handles death (the diagnostic logs showed the game applies the multiplier inside it).
  • Known gap: copies of players have no perks, so their armor is lower (158 vs 400 in the logs) and the raw hit sent is larger than the player's own game would compute. Not corrected yet.
  • Needs an in-game test with 2 clients; the server fix needs a server rebuild.

🤖 Generated with Claude Code

https://claude.ai/code/session_018fvQxSwpo46aX4h3sn2BYB

…sion

A diagnostic build from a branch reports e.g. v1.8.7-10-1-ga91c0c49 and
the v1.8.7-10 server rejects it. With --build_version=v1.8.7-10 the build
stamps that version instead of git describe. The protocol is unchanged on
this branch, so the client stays compatible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fvQxSwpo46aX4h3sn2BYB
…ealth

A party member only took an enemy hit when their own replayed copy of the
enemy happened to connect: in a test 4 of 10 real hits landed. The client
that owns the NPC now sends the raw hit to the player's client, which
runs it through the game's damage with its own difficulty, and players
ignore hits from replayed NPC copies.

Health regen and heals were never synced, so copies of other players only
ever lost health (88 HP off after a minute). Copies now take the owner's
health from the actor value sync instead of summing deltas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fvQxSwpo46aX4h3sn2BYB
@absol89 absol89 self-assigned this Nov 14, 2026
…alth faster

PvP hits only landed when the victim's replayed copy of the attacker
happened to connect, so friendly fire went through one way and not the
other. The attacker's client now sends the hit like an NPC owner does,
and the victim applies it with its own difficulty, the same multiplier
as an enemy hit.

Other clients now take a player's health only from the owner, so the
local player's health is sent every 250 ms when it changes instead of
once a second, for everyone nearby whether in a party or not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fvQxSwpo46aX4h3sn2BYB
The server added health deltas with the wrong sign, so a damaged actor's
stored health went up until the owner's next actor value sync. Players
who walk in later spawn actors with that stored health.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fvQxSwpo46aX4h3sn2BYB
@absol89
absol89 force-pushed the claude/party-health-sync branch from 7467cc0 to 81d644b Compare November 14, 2026 19:13
@absol89 absol89 changed the title Let the attacking NPC's owner land hits on players, and sync player health Land hits from the attacker's client and sync player health Nov 14, 2026
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.

2 participants