Repository navigation
Size world health bars to the entity on screen - #2005
Merged
Merged
Conversation
Bars were a fixed 112x10 px whatever the camera distance. Beacon Bastion's top-down camera put a 112 px bar over every 10 px raider, so a wave read as a stack of red slabs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RwsemkhoUGyeQkdkKFmUmw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RwsemkhoUGyeQkdkKFmUmw
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.
Beacon Bastion's first wave read as a stack of red slabs: every raider, about 10 px tall from the top-down camera, carried a 112 px health bar.
shell/world/worldBarSamples.ts: each bar sample records pixels per metre at its anchor (one metre projected along the camera's right axis).worldBarSizepaints the bar about 1.4 m wide at that scale, clamped to 28–112 px, with proportional height. Close third-person views still hit the old 112×10 cap. Caller-painted samples without a scale keep the old size.changes/world-bar-scale.md.Verification
bun test packages/shell/src/world— 60 pass, 0 fail;check-types— pass;bun run gen— ok;ship:preflight— ok--click "Begin first assault" --wait 6000 --rpc sim_advance 30, using Fast-forward the simulation from drive RPCs #2004). Left is before, right is after. In both frames the raider models hadn't streamed in yet at the headless frame rate (that happens on the build without this change too), so compare the bars:Generated by Claude Code