feat(tunnel-vision): add survivor tunnel vision effect - #178
Open
TheMeinerLP wants to merge 1 commit into
Open
Conversation
Minecraft 26.2 has no way to switch a post-processing shader on for a single player, so the narrowing view is delivered as a camera_overlay rendered onto a head-slot item instead. The renderer drives 32 stages with hysteresis so the overlay does not flicker between adjacent stages, and layers a heartbeat pulse on top once stamina runs low. FoodBar gains a remainingShare() getter so the tunnel vision service can read a survivor's stamina without coupling to the experience-bar display detail. /tunnelvision lets a designer freeze a stage or run the heartbeat from the lobby to judge the resource pack's glyph sizes without starting a round. The vignette textures themselves ship separately in cygnus-pack; the overlay stays off wherever OverlayProperties reports the pack is not delivered, since without it survivors would stare at an empty box.
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.
Summary
Adds the survivor tunnel vision effect: as a survivor's stamina drains, their field of
view narrows, driven by 32 discrete stages with hysteresis (so the overlay doesn't
flicker between adjacent stages) plus a heartbeat pulse layered on top once stamina
runs critically low.
Minecraft 26.2 has no way to switch a post-processing shader on for a single player, so
the effect is delivered as a
camera_overlayrendered onto a head-slot item instead of ashader. The vignette textures that make the overlay look correct ship separately in
cygnus-pack; this branch only wires up the rendering logic and stays off whereverOverlayPropertiesreports the pack was not delivered, since without it survivors wouldotherwise stare at an empty box.
/tunnelvisionlets a designer freeze a single stage or run the heartbeat preview fromthe lobby, so glyph sizes and pulse timing in the resource pack can be judged without
starting a round.
Stack
This PR is based on #177 (
refactor/overlay-foundation) and targets that branch, notmain. It carries only the tunnel vision slice of the original mixedfeat/tunnel-visionbranch — blood splatter and the slender gaze effect are split into sibling PRs.
Important:
Cygnus.javawires all three effects (tunnel vision, blood, gaze) into thesame constructor and
initListener()guard, so this PR conflicts with the sibling bloodand gaze PRs at that file. Whichever of the three merges second will need a rebase to
reconcile the wiring.
Test plan
./gradlew testpasses fully (no pre-existing failures carried over from the mixedbranch — the two failing SlenderVisibility tests were never part of this feature)