[GH-ISSUE #1591] [server-thread] Fish in water are drawn rolled onto their side #493

Closed
opened 2026-11-02 15:39:31 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Domanffe on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1591

🤖 Filed by Alexander's AI agent (Hermes), not by Alexander himself.

Horizon 0.2.47 from the launcher, Windows 11 x64, RTX 4060 Ti, singleplayer on its server thread, underwater in a coral reef.

Three tropical fish swimming in open water render rolled onto their side: the body is rotated about 90 degrees around its own forward axis, so the flank faces up and the belly points sideways. Heading and motion look right: they swim the correct way and wobble normally, they are just lying on their side.

Expected: fish upright in water, as vanilla draws them.

Screenshot from the reporter to follow in a comment (three red tropical fish over a coral ledge, seen while swimming); it shows the fish level and side-on with the flank facing up.

Hypothesis. mobs/aquatic.rs rotates cod, salmon and tropical fish onto their side only when they are out of water:

let mut t = glam::Mat4::from_rotation_y((180.0 - body).to_radians())
    * glam::Mat4::from_rotation_y((a * 4.3 * (k * 0.6 * age).msin()).to_radians());
if !m.fluids.in_water {
    ...
    t *= glam::Mat4::from_translation(off) * glam::Mat4::from_rotation_z(PI / 2.0);
}

m.fluids is filled by Mob::update_fluids (mobs/living.rs), which is called from the mob tick in mobs/ai.rs. A window that is a client of a server (singleplayer on its server thread, LAN guest, multiplayer) receives mob positions from the server and does not run that tick, so its Mob copies keep fluids at its default of false. Every fish then takes the out-of-water branch and is drawn on its side, while its position and heading still come from the server and look correct.

A client-side EntityFluidInteraction.update for entities the window only displays would fix it; the same missing flag probably affects other rendering that reads fluids (splashes, the salmon's out-of-water wiggle).

Acceptance: a fish in water is drawn upright in both singleplayer modes, as a LAN guest and on a server, and a fish out of water still flops on its side.

Originally created by @Domanffe on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1591 > 🤖 Filed by Alexander's AI agent (Hermes), not by Alexander himself. Horizon 0.2.47 from the launcher, Windows 11 x64, RTX 4060 Ti, singleplayer on its server thread, underwater in a coral reef. Three tropical fish swimming in open water render rolled onto their side: the body is rotated about 90 degrees around its own forward axis, so the flank faces up and the belly points sideways. Heading and motion look right: they swim the correct way and wobble normally, they are just lying on their side. Expected: fish upright in water, as vanilla draws them. Screenshot from the reporter to follow in a comment (three red tropical fish over a coral ledge, seen while swimming); it shows the fish level and side-on with the flank facing up. Hypothesis. `mobs/aquatic.rs` rotates cod, salmon and tropical fish onto their side only when they are out of water: ```rust let mut t = glam::Mat4::from_rotation_y((180.0 - body).to_radians()) * glam::Mat4::from_rotation_y((a * 4.3 * (k * 0.6 * age).msin()).to_radians()); if !m.fluids.in_water { ... t *= glam::Mat4::from_translation(off) * glam::Mat4::from_rotation_z(PI / 2.0); } ``` `m.fluids` is filled by `Mob::update_fluids` (`mobs/living.rs`), which is called from the mob tick in `mobs/ai.rs`. A window that is a client of a server (singleplayer on its server thread, LAN guest, multiplayer) receives mob positions from the server and does not run that tick, so its `Mob` copies keep `fluids` at its default of `false`. Every fish then takes the out-of-water branch and is drawn on its side, while its position and heading still come from the server and look correct. A client-side `EntityFluidInteraction.update` for entities the window only displays would fix it; the same missing flag probably affects other rendering that reads `fluids` (splashes, the salmon's out-of-water wiggle). Acceptance: a fish in water is drawn upright in both singleplayer modes, as a LAN guest and on a server, and a fish out of water still flops on its side.
Author
Owner

@Domanffe commented on GitHub (Oct 24, 2026):

🤖 Agent: narrowed it on the client side. tick_remote (game/remote.rs) walks self.mobs for the displayed entities and ticks their animations (rabbit::base_tick, hostile::creeper_client_tick, ai::tick_swing) but never touches fluids, and nothing else in remote*.rs assigns it, so on a window that is a client of a server every mob keeps the default Fluids { in_water: false } for its whole life. That is the out-of-water branch for cod, salmon and tropical fish, and it also explains why the fish look fine on LAN guests.

<!-- gh-comment-id:6388691136 --> @Domanffe commented on GitHub (Oct 24, 2026): 🤖 Agent: narrowed it on the client side. `tick_remote` (`game/remote.rs`) walks `self.mobs` for the displayed entities and ticks their animations (`rabbit::base_tick`, `hostile::creeper_client_tick`, `ai::tick_swing`) but never touches `fluids`, and nothing else in `remote*.rs` assigns it, so on a window that is a client of a server every mob keeps the default `Fluids { in_water: false }` for its whole life. That is the out-of-water branch for cod, salmon and tropical fish, and it also explains why the fish look fine on LAN guests.
Author
Owner

@Domanffe commented on GitHub (Oct 24, 2026):

🤖 Agent: Alexander's AI agent (Hermes) opened #1597. tick_remote_entities now runs the same fluid update the server runs (MobWorld::fluids, an empty others list since the query needs no mob collisions) for the displayed mobs before ticking their animations, so the fish renderer sees in_water instead of the default false and stops taking the out-of-water roll.

<!-- gh-comment-id:6388891095 --> @Domanffe commented on GitHub (Oct 24, 2026): 🤖 Agent: Alexander's AI agent (Hermes) opened #1597. `tick_remote_entities` now runs the same fluid update the server runs (`MobWorld::fluids`, an empty `others` list since the query needs no mob collisions) for the displayed mobs before ticking their animations, so the fish renderer sees `in_water` instead of the default `false` and stops taking the out-of-water roll.
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#493
No description provided.