[PR #2317] [MERGED] Apply vanilla's view scale to entity render distance #4199

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2317
Author: @socksprox
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/entity-view-scale


📝 Commits (2)

  • 2c8b933 Apply vanilla's view scale to entity render distance
  • ee0af20 Cap the view scale's render distance by the server's

📊 Changes

11 files changed (+43 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/game/boats.rs (+1 -1)
📝 crates/horizon-client/src/game/creatures.rs (+10 -3)
📝 crates/horizon-client/src/game/cushions.rs (+1 -2)
📝 crates/horizon-client/src/game/entity_culling.rs (+18 -3)
📝 crates/horizon-client/src/game/frames.rs (+3 -2)
📝 crates/horizon-client/src/game/minecarts.rs (+2 -3)
📝 crates/horizon-client/src/game/paintings.rs (+1 -2)
📝 crates/horizon-client/src/game/remote.rs (+3 -1)
📝 crates/horizon-client/src/game/text_displays.rs (+2 -1)
📝 crates/horizon-client/src/game/tnt.rs (+1 -1)
📝 crates/horizon-client/src/game/trident.rs (+1 -1)

📄 Description

🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself.

What and why

Fixes #2273 — chickens (and other small entities) disappeared ~32 blocks out, about half of vanilla's distance.

Entity.shouldRenderAtSqrDistance scales the bounding box's mean edge by 64 * viewScale, and LevelExtractor.extractVisibleEntities sets viewScale to the entity distance option times clamp(renderDistance / 8, 1, 2.5) — a render-distance boost Horizon dropped, using the option alone. A chicken's 0.4×0.7×0.4 box renders 32 blocks at scale 1 but 48 at render distance 12 and up to 80 at 20+, matching "other mobs disappear only way further".

Every shouldRenderAtSqrDistance port now uses Game::view_scale() (streaming.radius is the effective render distance, already capped by the server remotely): mobs, minecarts, boats, tridents, primed TNT, paintings, item frames, text displays and cushions. mob_geometry also counts remote players' boxes ten times, per RemotePlayer.shouldRenderAtSqrDistance, so other players stop vanishing ~96 blocks out on servers (vanilla: ~960).

Vanilla reference

LevelExtractor.extractVisibleEntities (Entity.setViewScale), Entity.shouldRenderAtSqrDistance + AABB.getSize, RemotePlayer/ItemFrame/Display/AbstractArrow overrides — .local/minecraft/26.3/sources/client/. No dedicated harness; render-path only.

Self-check

Check Result
Scope ✅ 11 files, +35 −19
Cargo.lock ✅ unchanged
Public tree ✅
rustfmt ✅ (5 s)
clippy ✅ (10 s)
tests: horizon-client ✅ 1335 passed (3 min 20 s)
doc tests ✅ 0 passed (2 s)
Parity ➖ 278 affected, to run in CI (--quick)

🤖 Generated with Devin


🔄 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/2317 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/entity-view-scale` --- ### 📝 Commits (2) - [`2c8b933`](https://github.com/horizon-rust/horizon/commit/2c8b933be483bcf6d44437fb0763facfee707095) Apply vanilla's view scale to entity render distance - [`ee0af20`](https://github.com/horizon-rust/horizon/commit/ee0af20e16cc4ec5e3ad3240dccdde8dec3fe8fb) Cap the view scale's render distance by the server's ### 📊 Changes **11 files changed** (+43 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/boats.rs` (+1 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+10 -3) 📝 `crates/horizon-client/src/game/cushions.rs` (+1 -2) 📝 `crates/horizon-client/src/game/entity_culling.rs` (+18 -3) 📝 `crates/horizon-client/src/game/frames.rs` (+3 -2) 📝 `crates/horizon-client/src/game/minecarts.rs` (+2 -3) 📝 `crates/horizon-client/src/game/paintings.rs` (+1 -2) 📝 `crates/horizon-client/src/game/remote.rs` (+3 -1) 📝 `crates/horizon-client/src/game/text_displays.rs` (+2 -1) 📝 `crates/horizon-client/src/game/tnt.rs` (+1 -1) 📝 `crates/horizon-client/src/game/trident.rs` (+1 -1) </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself. ## What and why Fixes #2273 — chickens (and other small entities) disappeared ~32 blocks out, about half of vanilla's distance. `Entity.shouldRenderAtSqrDistance` scales the bounding box's mean edge by `64 * viewScale`, and `LevelExtractor.extractVisibleEntities` sets viewScale to the entity distance option times `clamp(renderDistance / 8, 1, 2.5)` — a render-distance boost Horizon dropped, using the option alone. A chicken's 0.4×0.7×0.4 box renders 32 blocks at scale 1 but 48 at render distance 12 and up to 80 at 20+, matching "other mobs disappear only way further". Every `shouldRenderAtSqrDistance` port now uses `Game::view_scale()` (`streaming.radius` is the effective render distance, already capped by the server remotely): mobs, minecarts, boats, tridents, primed TNT, paintings, item frames, text displays and cushions. `mob_geometry` also counts remote players' boxes ten times, per `RemotePlayer.shouldRenderAtSqrDistance`, so other players stop vanishing ~96 blocks out on servers (vanilla: ~960). ## Vanilla reference `LevelExtractor.extractVisibleEntities` (`Entity.setViewScale`), `Entity.shouldRenderAtSqrDistance` + `AABB.getSize`, `RemotePlayer`/`ItemFrame`/`Display`/`AbstractArrow` overrides — `.local/minecraft/26.3/sources/client/`. No dedicated harness; render-path only. ## Self-check | Check | Result | | --- | --- | | Scope | ✅ 11 files, +35 −19 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | rustfmt | ✅ (5 s) | | clippy | ✅ (10 s) | | tests: horizon-client | ✅ 1335 passed (3 min 20 s) | | doc tests | ✅ 0 passed (2 s) | | Parity | ➖ 278 affected, to run in CI (--quick) | 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:24 +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#4199
No description provided.