Repository navigation
Conversation
A party member's health percentage changed on nearly every 500 ms tick during combat (damage, then regeneration), and every update rebuilt the party list and made the overlay repaint. Each overlay repaint copies the whole screen into a texture, which shows up as a periodic frametime spike. - Round the sent health percentage up to a whole number, so it only goes out when the bar visibly changes and 0 still means dead. - Ignore health updates that don't change a member's value, and only flash the party list on a real change. - Track party members by id so their elements are reused, and drop the width transition, which would otherwise repaint for 0.8 s per update. See tiltedphoques#940. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018fvQxPkaY5xU6UUaRU3L8h
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
Addresses tiltedphoques#940 (a periodic stutter while a party member fights, which goes away when the party disbands, the member dies, or the party UI is disabled).
Cause
RunPlayerHealthUpdatessends the raw float, so asetHealthgoes out about twice a second.setHealthre-emits the group, the party*ngFor(which has notrackBy) rebuilds its elements, and the list flashes even when the value is unchanged.OverlayRenderHandlerD3D11::OnPaintin TiltedUI copies the whole screen into the texture (it ignores dirty rects) while holding the lock that the game's render thread takes every frame. A higher resolution makes this worse. The same cost would explain why the debug overlay alone, which updates once a second, also stutters.Changes
Follow-up (not in this PR)
The repaint cost itself sits in the TiltedUI submodule: copy only the dirty rects, and do the copy outside the lock the game thread waits on. That would make every overlay update cheaper, including chat and the debug view.
Testing
ng buildpasses and Prettier is clean on the changed files.🤖 Generated with Claude Code
https://claude.ai/code/session_018fvQxPkaY5xU6UUaRU3L8h