[GH-ISSUE #1680] When flying in sprint, holding control increases speed #515

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

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

What I did: fly forwards and test holding control and not holding it after already initializing a sprint
What happened: when holding control you fly faster than when not
What I expected: you to fly the same speed regardless since you are sprinting anyway
Horizon version: 0.2.49
OS, CPU, GPU: windows x86, ryzen 9 3950x, rtx 4060ti 8gb

Reported on Discord by kevennever#5592 in #horizon-bugs · Discord thread
Tags: gameplay

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

Originally created by @ludovic111 on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1680 > What I did: fly forwards and test holding control and not holding it after already initializing a sprint > What happened: when holding control you fly faster than when not > What I expected: you to fly the same speed regardless since you are sprinting anyway > Horizon version: 0.2.49 > OS, CPU, GPU: windows x86, ryzen 9 3950x, rtx 4060ti 8gb Reported on Discord by **kevennever#5592** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1563699509496909978) Tags: gameplay <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:39:41 +07:00
Author
Owner

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

Fixed on main by #1779 and #2022: the server used to rewrite the player's sprint flag from the held Ctrl key on every input packet, so without Ctrl the flag was cleared and flying speed dropped. Sprint now starts and stops only through the sprint command, as in vanilla.

<!-- gh-comment-id:6422541820 --> @kacpherek commented on GitHub (Oct 26, 2026): Fixed on main by #1779 and #2022: the server used to rewrite the player's sprint flag from the held Ctrl key on every input packet, so without Ctrl the flag was cleared and flying speed dropped. Sprint now starts and stops only through the sprint command, as in vanilla.
Author
Owner

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

🤖 Agent: verified on current main (aba4f19a): the sprint key no longer changes the flight speed. The flight speed follows the sprint state, as in vanilla, and #2550 adds the end-to-end test that was missing for it.

What I verified, and how

  • The flight speed is vanilla's Player.getFlyingSpeed(): a flying player moves at abilities.getFlyingSpeed() (0.05), doubled while isSprinting(), and LivingEntity.getFrictionInfluencedSpeed uses it for the airborne speed. Horizon implements it in crates/horizon-world/src/player_travel.rs::flying_speed and in MotionWorld::flying_speed (crates/horizon-client/src/motion.rs).
    python3 tools/parity.py player_travel → PASS player_travel (the corpus covers flying × sprint, against the pinned 26.3 client and server jars)
  • The reported symptom came from the server side. The server used to rewrite the player's sprint flag from the held Ctrl key on every input packet, so without Ctrl the flag was cleared; the server sends that flag back in the shared entity data and the client copies the bit onto player.sprinting (crates/horizon-client/src/game/remote.rs, the DATA_SHARED_FLAGS_ID sprinting bit), so the flight speed dropped. Hub's S::PlayerInput arm now only records the keys and the crouching, and the flag changes only through PlayerCommand — the fix from #1779.
    cargo test -p horizon-client --test lan_bot -- sprint_commands_survive_keyboard_input_changes → ok. 1 passed
  • New end-to-end test motion::tests::the_flight_speed_follows_the_sprint_state_not_the_sprint_key: a flying player is at 0.05, at 0.1 once the sprint state holds, and still at 0.1 after the sprint key comes up. It fails with the sprint state survives the sprint key in the air if the state is dropped when the key comes up.
running 4 tests
test sprint::tests::sprint_survives_releasing_the_key_through_a_jump ... ok
test motion::tests::a_sprint_jump_keeps_its_impulse_when_the_sprint_key_comes_up ... ok
test motion::tests::the_flight_speed_follows_the_sprint_state_not_the_sprint_key ... ok
test motion::tests::a_sprint_survives_the_sprint_key_coming_up_while_swimming ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 1213 filtered out; finished in 5.97s

One note on the expectation. In vanilla a sprint that has started does double the flight speed (Player.getFlyingSpeed() returns abilities.getFlyingSpeed() * 2.0F while isSprinting()), so "the same speed whether or not Ctrl is held" holds because the sprint state persists, not because the sprint is ignored. What was broken was that the key (through the server's flag rewrite) toggled the speed; that no longer happens.

Vanilla reference — Player.getFlyingSpeed, Abilities.getFlyingSpeed, LivingEntity.getFrictionInfluencedSpeed, LocalPlayer.aiStep (canStartSprinting), ServerGamePacketListenerImpl.handlePlayerCommand, Entity.setSharedFlag (the sprinting bit is bit 3).

PR: #2550 (tests only, no behaviour change).

I cannot close this issue myself — the account has no permission to close issues on this repository — so I am leaving it open for a maintainer to close.

<!-- gh-comment-id:6428882231 --> @levzzz5154 commented on GitHub (Oct 26, 2026): 🤖 Agent: verified on current main (`aba4f19a`): the sprint key no longer changes the flight speed. The flight speed follows the sprint *state*, as in vanilla, and #2550 adds the end-to-end test that was missing for it. **What I verified, and how** * The flight speed is vanilla's `Player.getFlyingSpeed()`: a flying player moves at `abilities.getFlyingSpeed()` (0.05), doubled while `isSprinting()`, and `LivingEntity.getFrictionInfluencedSpeed` uses it for the airborne speed. Horizon implements it in `crates/horizon-world/src/player_travel.rs::flying_speed` and in `MotionWorld::flying_speed` (`crates/horizon-client/src/motion.rs`). `python3 tools/parity.py player_travel` → `PASS player_travel` (the corpus covers `flying` × `sprint`, against the pinned 26.3 client *and* server jars) * The reported symptom came from the server side. The server used to rewrite the player's sprint flag from the held Ctrl key on every input packet, so without Ctrl the flag was cleared; the server sends that flag back in the shared entity data and the client copies the bit onto `player.sprinting` (`crates/horizon-client/src/game/remote.rs`, the `DATA_SHARED_FLAGS_ID` sprinting bit), so the flight speed dropped. `Hub`'s `S::PlayerInput` arm now only records the keys and the crouching, and the flag changes only through `PlayerCommand` — the fix from #1779. `cargo test -p horizon-client --test lan_bot -- sprint_commands_survive_keyboard_input_changes` → `ok. 1 passed` * New end-to-end test `motion::tests::the_flight_speed_follows_the_sprint_state_not_the_sprint_key`: a flying player is at 0.05, at 0.1 once the sprint state holds, and still at 0.1 after the sprint key comes up. It fails with `the sprint state survives the sprint key in the air` if the state is dropped when the key comes up. ``` running 4 tests test sprint::tests::sprint_survives_releasing_the_key_through_a_jump ... ok test motion::tests::a_sprint_jump_keeps_its_impulse_when_the_sprint_key_comes_up ... ok test motion::tests::the_flight_speed_follows_the_sprint_state_not_the_sprint_key ... ok test motion::tests::a_sprint_survives_the_sprint_key_coming_up_while_swimming ... ok test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 1213 filtered out; finished in 5.97s ``` **One note on the expectation.** In vanilla a sprint that has *started* does double the flight speed (`Player.getFlyingSpeed()` returns `abilities.getFlyingSpeed() * 2.0F` while `isSprinting()`), so "the same speed whether or not Ctrl is held" holds because the sprint state persists, not because the sprint is ignored. What was broken was that the *key* (through the server's flag rewrite) toggled the speed; that no longer happens. **Vanilla reference** — `Player.getFlyingSpeed`, `Abilities.getFlyingSpeed`, `LivingEntity.getFrictionInfluencedSpeed`, `LocalPlayer.aiStep` (`canStartSprinting`), `ServerGamePacketListenerImpl.handlePlayerCommand`, `Entity.setSharedFlag` (the sprinting bit is bit 3). PR: #2550 (tests only, no behaviour change). I cannot close this issue myself — the account has no permission to close issues on this repository — so I am leaving it open for a maintainer to close.
Author
Owner

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

🤖 Agent: Fixed on current main — ef0714a99 ("Lock in the sprint state that outlives the sprint key") makes sprint a state per vanilla's LocalPlayer.aiStep: the key starts it, only vanilla stop conditions end it. Holding or releasing control no longer changes fly speed once sprinting. You were on v0.2.49. Suggest closing.

<!-- gh-comment-id:6441945306 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: Fixed on current main — `ef0714a99` ("Lock in the sprint state that outlives the sprint key") makes sprint a state per vanilla's `LocalPlayer.aiStep`: the key starts it, only vanilla stop conditions end it. Holding or releasing control no longer changes fly speed once sprinting. You were on v0.2.49. Suggest closing.
Author
Owner

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

Fixed on main by #1779 and #2022: flying speed follows the sprint state, not whether Ctrl is held.

<!-- gh-comment-id:6453958776 --> @kacpherek commented on GitHub (Oct 27, 2026): Fixed on main by #1779 and #2022: flying speed follows the sprint state, not whether Ctrl is held.
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#515
No description provided.