[PR #6837] [MERGED] Breathe the dragon-breath fans for the fight's own client #7128

Closed
opened 2026-11-03 06:34:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6837
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/dragon-breath-host-puffs


📝 Commits (2)

  • d4ed651 Breathe the dragon-breath fans for the fight's own client
  • 997f947 Keep dragon breath off the server thread's random

📊 Changes

2 files changed (+187 additions, -51 deletions)

View changed files

📝 crates/horizon-client/src/game/dragon.rs (+185 -49)
📝 tools/port_map/classes-01.tsv (+2 -2)

📄 Description

Vanilla behaviour

EnderDragon.tick runs the current phase's doClientTick on every client.
DragonLandingPhase.doClientTick breathes eight dragon-breath particles a
tick from the head's centre, jittered by nextGaussian() / 2, along
-getHeadLookVector(1) * 0.08F (0.3 for the vertical part) plus the dragon's
getDeltaMovement. DragonSittingFlamingPhase.doClientTick breathes on the
even ticks below 10 (++flameTicks; flameTicks % 2 == 0 && flameTicks < 10):
eight starts, each a fan of six puffs down the look line, -look.y * 0.6F
once for the vertical part. Both phases call look.yRot(...) and throw the
result away, so every puff of a fan leaves along the same line.

What Horizon got wrong

The fans existed only on a server's client (remote_dragon_phase_tick, the
tick_remote_dragon path). The fight's own client — single player, or the
host of a LAN world — never ran the phase's client tick, so the dragon came
down and flamed with no breath at all. tools/port_map/classes-01.tsv still
carried both methods as missing ("none are spawned").

The fan is now one function, breath_puffs, called by both paths: the host
draws it from tick_dragon after the parts are placed (host_dragon_breath_puffs)
and a server's client from remote_dragon_phase_tick, which keeps its own
flameTicks advance. The host's jitter comes from the world's random, not the
dragon's: the dragon's stream is the fight's own (Mob.baseTick's ambient
roll, the crystal scan, the growls), and vanilla's client copy never draws on
the server copy's stream, so the fight's random sequence stays vanilla's.

Proven

cargo test -q -p horizon-client --lib game::dragon — 20 passed, 0 failed,
1 ignored (the render fixture). New tests:

  • a_landing_dragon_breathes_eight_puffs_from_its_head: eight puffs, every one
    at the head jittered, every velocity -look * 0.08F / 0.3F (vertical) plus
    the dragon's motion.
  • a_flaming_dragon_breathes_a_fan_on_every_second_tick: 0 puffs on ticks 1,
    3, 9 and 10, 48 on ticks 2, 4 and 8, six per start sharing that start, with
    -look * 0.08F * j and -look.y * 0.6F.
  • only_the_landing_and_flaming_phases_breathe.

cargo clippy -q -p horizon-client --lib -- -D warnings clean;
rustfmt --edition 2024 --check crates/horizon-client/src/game/dragon.rs
clean. python3 tools/port_ledger.py build --jar .../26.3/jars/server.jar
then map-check tools/port_map/classes-01.tsv: "224 rows, no problems."

Not proven

No in-game check: the fan needs a real End fight with the dragon perched or
landing, which the harness does not stage. The unit tests pin the puffs'
counts, positions and velocities, not what they look like on screen.

tools/port_map/classes-01.tsv rows for both methods move from missing to
inline at Game::host_dragon_breath_puffs.


🔄 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/6837 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dragon-breath-host-puffs` --- ### 📝 Commits (2) - [`d4ed651`](https://github.com/horizon-rust/horizon/commit/d4ed651edab8c2cd36dfb212031ebf796624a1bf) Breathe the dragon-breath fans for the fight's own client - [`997f947`](https://github.com/horizon-rust/horizon/commit/997f9477e3089f12563b2f5d1a75fbba543df7fb) Keep dragon breath off the server thread's random ### 📊 Changes **2 files changed** (+187 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dragon.rs` (+185 -49) 📝 `tools/port_map/classes-01.tsv` (+2 -2) </details> ### 📄 Description ## Vanilla behaviour `EnderDragon.tick` runs the current phase's `doClientTick` on every client. `DragonLandingPhase.doClientTick` breathes eight dragon-breath particles a tick from the head's centre, jittered by `nextGaussian() / 2`, along `-getHeadLookVector(1) * 0.08F` (0.3 for the vertical part) plus the dragon's `getDeltaMovement`. `DragonSittingFlamingPhase.doClientTick` breathes on the even ticks below 10 (`++flameTicks; flameTicks % 2 == 0 && flameTicks < 10`): eight starts, each a fan of six puffs down the look line, `-look.y * 0.6F` once for the vertical part. Both phases call `look.yRot(...)` and throw the result away, so every puff of a fan leaves along the same line. ## What Horizon got wrong The fans existed only on a server's client (`remote_dragon_phase_tick`, the `tick_remote_dragon` path). The fight's own client — single player, or the host of a LAN world — never ran the phase's client tick, so the dragon came down and flamed with no breath at all. `tools/port_map/classes-01.tsv` still carried both methods as `missing` ("none are spawned"). The fan is now one function, `breath_puffs`, called by both paths: the host draws it from `tick_dragon` after the parts are placed (`host_dragon_breath_puffs`) and a server's client from `remote_dragon_phase_tick`, which keeps its own `flameTicks` advance. The host's jitter comes from the world's random, not the dragon's: the dragon's stream is the fight's own (`Mob.baseTick`'s ambient roll, the crystal scan, the growls), and vanilla's client copy never draws on the server copy's stream, so the fight's random sequence stays vanilla's. ## Proven `cargo test -q -p horizon-client --lib game::dragon` — 20 passed, 0 failed, 1 ignored (the render fixture). New tests: - `a_landing_dragon_breathes_eight_puffs_from_its_head`: eight puffs, every one at the head jittered, every velocity `-look * 0.08F` / `0.3F` (vertical) plus the dragon's motion. - `a_flaming_dragon_breathes_a_fan_on_every_second_tick`: 0 puffs on ticks 1, 3, 9 and 10, 48 on ticks 2, 4 and 8, six per start sharing that start, with `-look * 0.08F * j` and `-look.y * 0.6F`. - `only_the_landing_and_flaming_phases_breathe`. `cargo clippy -q -p horizon-client --lib -- -D warnings` clean; `rustfmt --edition 2024 --check crates/horizon-client/src/game/dragon.rs` clean. `python3 tools/port_ledger.py build --jar .../26.3/jars/server.jar` then `map-check tools/port_map/classes-01.tsv`: "224 rows, no problems." ## Not proven No in-game check: the fan needs a real End fight with the dragon perched or landing, which the harness does not stage. The unit tests pin the puffs' counts, positions and velocities, not what they look like on screen. `tools/port_map/classes-01.tsv` rows for both methods move from `missing` to `inline` at `Game::host_dragon_breath_puffs`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:34:20 +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#7128
No description provided.