[GH-ISSUE #2273] Chickens disappear a lot sooner than other mobs #624

Closed
opened 2026-11-02 15:40:36 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @ludovic111 on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2273

What I did: opened a world, found a chicken and flew away for like 32 blocks
What happened: chicken disappeared after around 32 blocks, while other mobs disappear only way further
What I expected: chickens disappearing like other mobs
Horizon version: c048292f
OS, CPU, GPU: Windows 11, Ryzen 3700x, RX 7600
Notes: Entity culling is disabled.

Reported on Discord by andrij in #horizon-bugs · Discord thread
Tags: rendering

Attachments (Discord links expire after a while; the thread keeps them)

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @ludovic111 on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2273 > What I did: opened a world, found a chicken and flew away for like 32 blocks > What happened: chicken disappeared after around 32 blocks, while other mobs disappear only way further > What I expected: chickens disappearing like other mobs > Horizon version: c048292f > OS, CPU, GPU: Windows 11, Ryzen 3700x, RX 7600 > Notes: Entity culling is disabled. Reported on Discord by **andrij** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1564292455061389463) Tags: rendering **Attachments** (Discord links expire after a while; the thread keeps them) - [Recording_2026-10-26_155700.mp4](https://cdn.discordapp.com/attachments/1564292455061389463/1564292456730599425/Recording_2026-10-26_155700.mp4?ex=6ae0bc60&is=6adf6ae0&hm=5544e99d989dc7b3a1e44d7c998827c59adb0a88fe0a524e5ee240d36422db2c&) <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:40:36 +07:00
Author
Owner

@kacpherek commented on GitHub (Oct 26, 2026):

This looks like render distance rather than despawning. Vanilla only draws an entity within Entity.shouldRenderAtSqrDistance: the average edge of its bounding box × 64 × the Entity Distance option. A chicken's 0.4 × 0.7 × 0.4 box gives about 32 blocks at 100%, while a pig or cow is drawn noticeably farther, so chickens vanish first in vanilla too. Horizon uses the same formula (game/entity_culling.rs), and animals are never removed for distance (Animal.removeWhenFarAway). Raising Entity Distance in Video Settings should keep them visible longer.

<!-- gh-comment-id:6422505694 --> @kacpherek commented on GitHub (Oct 26, 2026): This looks like render distance rather than despawning. Vanilla only draws an entity within `Entity.shouldRenderAtSqrDistance`: the average edge of its bounding box × 64 × the Entity Distance option. A chicken's 0.4 × 0.7 × 0.4 box gives about 32 blocks at 100%, while a pig or cow is drawn noticeably farther, so chickens vanish first in vanilla too. Horizon uses the same formula (`game/entity_culling.rs`), and animals are never removed for distance (`Animal.removeWhenFarAway`). Raising Entity Distance in Video Settings should keep them visible longer.
Author
Owner

@ludovic111 commented on GitHub (Oct 26, 2026):

andrij added on Discord:

appreciate it

<!-- gh-comment-id:6423482643 --> @ludovic111 commented on GitHub (Oct 26, 2026): **andrij** added on Discord: > appreciate it <!-- kira -->
Author
Owner

@levzzz5154 commented on GitHub (Oct 27, 2026):

🤖 Agent: checked the report against the vanilla 26.3 sources and against Horizon's current code.

What the 32 blocks were

  • Vanilla Entity#shouldRenderAtSqrDistance(double) (server/net/minecraft/world/entity/Entity.java) compares the squared camera distance with (size * 64 * viewScale)², where size is AABB#getSize() — the mean of the three edge lengths — and a NaN size falls back to 1.0.
  • A chicken's box is 0.4 × 0.7 × 0.4, so the mean edge is 0.5 and the raw distance is 0.5 × 64 = 32 blocks. The missing factor is viewScale: Entity#setViewScale(double) is called by LevelExtractor#extractVisibleEntities with Mth.clamp(options.getEffectiveRenderDistance() / 8.0, 1.0, 2.5) * options.entityDistanceScaling().get(). At the default twelve chunks that is 1.5, so vanilla draws a chicken up to 48 blocks away. Horizon used the bare 32, exactly the distance measured in this report.
  • The despawn rules are not the cause and are already vanilla-correct in Horizon: Mob#checkDespawn uses MobCategory#getDespawnDistance() (128 blocks, 64 for water_ambient) and MobCategory#getNoDespawnDistance() (32), and Chicken#removeWhenFarAway is only true for a chicken jockey — an ordinary chicken never despawns by distance.
  • The "Entity culling is disabled" setting from the report is Horizon's own "Entity Culling" toggle (skip drawing entities hidden behind opaque terrain) and is unrelated to this draw distance.
  • The order of the mobs in the report is vanilla behaviour: the draw distance follows the mean edge of the bounding box, so a chicken (0.5) is drawn nearer than a cow (0.9). Only the absolute distance changes — 32 blocks becomes 48.

Fix

The behaviour was fixed upstream by #2317 ("Apply vanilla's view scale to entity render distance"), merged on 2026-10-27, which closed this issue. Horizon now computes the same factor as vanilla, and the other entities (boats, minecarts, paintings, item frames, text displays, remote players) use it too.

Test

That pull request carried no test, so #2736 adds one: the view scale formula now lives in a free function and the draw distance of a chicken is pinned at 48 blocks. cargo test -p horizon-client --bin horizon-client -- game::entity_culling::tests → 3 passed; with the view scale removed the chicken test fails with left: 32.0, right: 48.0.

<!-- gh-comment-id:6439399711 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: checked the report against the vanilla 26.3 sources and against Horizon's current code. **What the 32 blocks were** - Vanilla `Entity#shouldRenderAtSqrDistance(double)` (`server/net/minecraft/world/entity/Entity.java`) compares the squared camera distance with `(size * 64 * viewScale)²`, where `size` is `AABB#getSize()` — the mean of the three edge lengths — and a NaN size falls back to 1.0. - A chicken's box is 0.4 × 0.7 × 0.4, so the mean edge is 0.5 and the raw distance is 0.5 × 64 = **32 blocks**. The missing factor is `viewScale`: `Entity#setViewScale(double)` is called by `LevelExtractor#extractVisibleEntities` with `Mth.clamp(options.getEffectiveRenderDistance() / 8.0, 1.0, 2.5) * options.entityDistanceScaling().get()`. At the default twelve chunks that is 1.5, so vanilla draws a chicken up to **48 blocks** away. Horizon used the bare 32, exactly the distance measured in this report. - The despawn rules are not the cause and are already vanilla-correct in Horizon: `Mob#checkDespawn` uses `MobCategory#getDespawnDistance()` (128 blocks, 64 for `water_ambient`) and `MobCategory#getNoDespawnDistance()` (32), and `Chicken#removeWhenFarAway` is only true for a chicken jockey — an ordinary chicken never despawns by distance. - The "Entity culling is disabled" setting from the report is Horizon's own "Entity Culling" toggle (skip drawing entities hidden behind opaque terrain) and is unrelated to this draw distance. - The order of the mobs in the report is vanilla behaviour: the draw distance follows the mean edge of the bounding box, so a chicken (0.5) is drawn nearer than a cow (0.9). Only the absolute distance changes — 32 blocks becomes 48. **Fix** The behaviour was fixed upstream by #2317 ("Apply vanilla's view scale to entity render distance"), merged on 2026-10-27, which closed this issue. Horizon now computes the same factor as vanilla, and the other entities (boats, minecarts, paintings, item frames, text displays, remote players) use it too. **Test** That pull request carried no test, so #2736 adds one: the view scale formula now lives in a free function and the draw distance of a chicken is pinned at 48 blocks. `cargo test -p horizon-client --bin horizon-client -- game::entity_culling::tests` → 3 passed; with the view scale removed the chicken test fails with `left: 32.0, right: 48.0`.
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#624
No description provided.