Repository navigation
Land hits from the attacker's client and sync player health - #40
Merged
Merged
Conversation
…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
…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
force-pushed
the
claude/party-health-sync
branch
from
November 14, 2026 19:13
7467cc0 to
81d644b
Compare
Copies of players defend with none of the player's perks, armor skill or block, so a hit computed on the attacker's client was about 3x too strong against a well armored player. The attacker now sends the hit's damage from before armor (HitData physical damage), plus attacker, weapon and the flags the armor step reads, in a new RequestPlayerHit. The victim's client rebuilds the HitData against its real player, runs the game's armor and block step (44014), its Mod Incoming Damage perks, then the damage function with its own difficulty. Also brings the damage diagnostics over, quieter: only hits involving a player and of at least 1 point, flags only for hits or deltas that arrive twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018fvQxSwpo46aX4h3sn2BYB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Eric · project thread
Based on
v1.8.7-10(same commit asAPI-playtest). Adds one message pair (RequestPlayerHit/NotifyPlayerHit), so clients and server must come from the same build.Why
Damage logs from the diagnostic build (#39) showed:
What
Actor::ProcessHitData(38586) is hooked to expose the HitData toHookDamageActor. When the local player or an NPC owned here hits a remote player, the client sendsRequestPlayerHitwith the HitData physical damage (+0x54: after the attacker's perks, sneak and crit, before armor/block), attacker, weapon and flags. The server forwards it to the hit player's owner only.Actor::ApplyHitFromOwner) builds a HitData (ctor 43995) against its real player, runs the armor and block step (44014), Mod Incoming Damage (ApplyPerkEntryPoint23526, entry 0x24), then the originalDamageActor(37335) which applies the player difficulty multiplier (3x on Legendary for PvP too), bleedout and death. The attacker's armor penetration (entry 0x25) is answered on the victim's side by the existing RemotePerks.OnHealthChangeBroadcastsubtracted damage with the wrong sign from the stored health used for later spawns.[DmgDiag]logging, quieter than Log damage and health sync events to find doubled or missing party damage #39: player hits of at least 1 point, sent/received player hits, andFLAG DUP_LOCAL_HIT/DUP_RECEIVED_HIT/DUP_BROADCASTwarnings.build_versionxmake option from Log damage and health sync events to find doubled or missing party damage #39.Verified / assumed
Verified with Ghidra on SkyrimSE 1.6.1170 (decompiled, read-only): HitData offsets (+0x18 aggressor handle, +0x1C target handle, +0x30
TESObjectWEAP*, +0x50 total, +0x54 physical, +0x80 flags, size 0x98), ctor/dtor 43995/43997, 44014 reads only +0x50 as input and null-checks aggressor and weapon, 23526 call pattern(0x24, target, aggressor, weapon, float*), 38586 calls 37335 with +0x50 once per hit, main thread only.Assumed: the 1.7.104 code (IDs from the Address Library only); per-entry perk argument counts (filled at runtime, taken from call sites); Mod Incoming Damage now runs after armor instead of before crit, a small ordering difference. Weapon enchantments/poison and stagger still come from the victim's own replay of the hit.
Needs an in-game test with 2 clients; the server needs a rebuild.
🤖 Generated with Claude Code
https://claude.ai/code/session_018fvQxSwpo46aX4h3sn2BYB