[PR #1978] [MERGED] Count the death roll in ticks so the dead camera eases instead of shaking #3907

Closed
opened 2026-11-03 04:13:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1978
Author: @kacpherek
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/1881-death-camera-tilt


📝 Commits (1)

  • a654808 Count the death roll in ticks so the dead camera eases instead of shaking

📊 Changes

3 files changed (+16 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/game/agent.rs (+2 -0)
📝 crates/horizon-client/src/game/fov.rs (+7 -7)
📝 crates/horizon-client/src/game/remote.rs (+7 -0)

📄 Description

Fixes #1881.

What and why

After dying, the camera shook instead of easing into the death roll, on the death screen.

The camera's death roll and zoom (GameRenderer.bobHurt, Camera.modifyFovBasedOnDeathOrFluid) read
deathTime + partialTick. Horizon derived deathTime from the wall clock since the death message, which
the server-thread path never set: there deathTime stayed 0, so every frame used 0 + partialTick and
the view rolled from 0 to 0.2 degrees and snapped back twenty times a second (with a matching zoom pulse)
instead of settling at vanilla's 3.6 degrees. In frame, the wall-clock ticks were not in step with the
frame's partial tick either.

deathTime is now the tick counter LivingEntity.tickDeath keeps: the in-frame tick already counted it,
and the server-thread path now resets it when the death screen opens and counts it once per client tick.
horizon-ctl state reports it as player.death_time.

Vanilla reference

  • GameRenderer.bobHurt: for a dead entity,
    poseStack.mulPose(Axis.ZP.rotationDegrees(40.0F - 8000.0F / (Math.min(deathTime + partialTick, 20.0F) + 200.0F))).
  • Camera.modifyFovBasedOnDeathOrFluid: the zoom on the same deathTime + partialTick.
  • LivingEntity.tickDeath: deathTime counts once per tick while dead.

Self-check

I did not paste a tools/pr_ready.py block: I work on Windows, where tools/parity.py cannot run (it needs
fcntl) and three horizon-client tests fail on upstream/main as well
(crash::tests::stacks_start_at_the_panicking_frame,
packs::cache::tests::directory_inputs_config_and_owned_output_recovery,
save::tests::session_lock_is_exclusive). cargo fmt --all -- --check passes; CI runs clippy and the
tests on Linux, and the harnesses above were run one by one (python tools/test_<name>_parity.py).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1978 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1881-death-camera-tilt` --- ### 📝 Commits (1) - [`a654808`](https://github.com/horizon-rust/horizon/commit/a6548089c4677e1cf11a03a6f52cff63ba116f2b) Count the death roll in ticks so the dead camera eases instead of shaking ### 📊 Changes **3 files changed** (+16 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/agent.rs` (+2 -0) 📝 `crates/horizon-client/src/game/fov.rs` (+7 -7) 📝 `crates/horizon-client/src/game/remote.rs` (+7 -0) </details> ### 📄 Description Fixes #1881. ## What and why After dying, the camera shook instead of easing into the death roll, on the death screen. The camera's death roll and zoom (`GameRenderer.bobHurt`, `Camera.modifyFovBasedOnDeathOrFluid`) read `deathTime + partialTick`. Horizon derived `deathTime` from the wall clock since the death message, which the server-thread path never set: there `deathTime` stayed 0, so every frame used `0 + partialTick` and the view rolled from 0 to 0.2 degrees and snapped back twenty times a second (with a matching zoom pulse) instead of settling at vanilla's 3.6 degrees. In frame, the wall-clock ticks were not in step with the frame's partial tick either. `deathTime` is now the tick counter `LivingEntity.tickDeath` keeps: the in-frame tick already counted it, and the server-thread path now resets it when the death screen opens and counts it once per client tick. `horizon-ctl state` reports it as `player.death_time`. ## Vanilla reference - `GameRenderer.bobHurt`: for a dead entity, `poseStack.mulPose(Axis.ZP.rotationDegrees(40.0F - 8000.0F / (Math.min(deathTime + partialTick, 20.0F) + 200.0F)))`. - `Camera.modifyFovBasedOnDeathOrFluid`: the zoom on the same `deathTime + partialTick`. - `LivingEntity.tickDeath`: `deathTime` counts once per tick while dead. ## Self-check I did not paste a `tools/pr_ready.py` block: I work on Windows, where `tools/parity.py` cannot run (it needs `fcntl`) and three horizon-client tests fail on upstream/main as well (`crash::tests::stacks_start_at_the_panicking_frame`, `packs::cache::tests::directory_inputs_config_and_owned_output_recovery`, `save::tests::session_lock_is_exclusive`). `cargo fmt --all -- --check` passes; CI runs clippy and the tests on Linux, and the harnesses above were run one by one (`python tools/test_<name>_parity.py`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:10 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3907
No description provided.