fix(debug): the flight lets Link go for events and respawns #2050

Merged
jarynclouatre merged 2 commits from fix/flight-yields-to-events into main 2026-11-11 02:47:41 +00:00
jarynclouatre commented 2026-11-11 01:06:01 +00:00 (Migrated from github.com)

Changes

Two fixes to the Debug tab's flight, both from playing with it on.

The first: an event that takes Link (a map change, the age toggle's reload, a cutscene) waits for him to stand, and the flight moves him to its own position every tick, so he never stood. Flying into an area's exit or toggling his age in the air left the screen black until the flight was switched off. A teleport sent from the Debug tab while flying could do the same, and a second request logged "teleport waits until the current event ends". While the event manager has an event playing, the flight now lets him go, so he lands and the event goes on. When it has ended the flight takes him again from where he stands.

The second: a respawn after a fall, or a warp, keeps Link's actor, so the flight put him straight back where it had him, over the same drop. With the flight on at an owl cutscene he fell, respawned and fell again until it was switched off. When he is more than 2 units from where the flight last placed him (it moves him 4 a second), the game moved him, and the flight starts again from there.

tests/test_flight_yields_to_events.py checks both pieces of the host code.

Testing

RTX 4070 Ti SUPER, driver 621.14, Windows 11.

Build: the Windows game builds with these two commits on fc375e9 plus #2020 (the same host/hos_main.c as this branch apart from #2020's conflict, resolved by keeping both functions). test_flight_yields_to_events, test_movement_speed and test_input_background pass on Linux.

Play, on that build: flying, teleported from the Debug tab to Sacred Forest Meadow as adult. Link landed, the map loaded and the picture was normal. On the build before, the same kind of map change while flying gave a black screen until the flight was switched off, several times in one session.

Not tested in play yet: the respawn case (the owl), and flying into an exit or toggling age in the air on the fixed build.

## Changes Two fixes to the Debug tab's flight, both from playing with it on. The first: an event that takes Link (a map change, the age toggle's reload, a cutscene) waits for him to stand, and the flight moves him to its own position every tick, so he never stood. Flying into an area's exit or toggling his age in the air left the screen black until the flight was switched off. A teleport sent from the Debug tab while flying could do the same, and a second request logged "teleport waits until the current event ends". While the event manager has an event playing, the flight now lets him go, so he lands and the event goes on. When it has ended the flight takes him again from where he stands. The second: a respawn after a fall, or a warp, keeps Link's actor, so the flight put him straight back where it had him, over the same drop. With the flight on at an owl cutscene he fell, respawned and fell again until it was switched off. When he is more than 2 units from where the flight last placed him (it moves him 4 a second), the game moved him, and the flight starts again from there. `tests/test_flight_yields_to_events.py` checks both pieces of the host code. ## Testing RTX 4070 Ti SUPER, driver 621.14, Windows 11. Build: the Windows game builds with these two commits on fc375e9 plus #2020 (the same `host/hos_main.c` as this branch apart from #2020's conflict, resolved by keeping both functions). `test_flight_yields_to_events`, `test_movement_speed` and `test_input_background` pass on Linux. Play, on that build: flying, teleported from the Debug tab to Sacred Forest Meadow as adult. Link landed, the map loaded and the picture was normal. On the build before, the same kind of map change while flying gave a black screen until the flight was switched off, several times in one session. Not tested in play yet: the respawn case (the owl), and flying into an exit or toggling age in the air on the fixed build.
hckrman101 (Migrated from github.com) approved these changes 2026-11-11 02:18:08 +00:00
hckrman101 (Migrated from github.com) left a comment

Read through it and it holds together. Letting flying go to 0 while oot_event_playing is true also clears flying_actor, so the flight re-seeds from where Link stands when the event ends, and the early if (!flying && action != 2 && action != 3) return; leaves him alone in between. The event test is the same events + 104 the teleport already uses, so the "waits until the current event ends" path and the new yield agree. The new test checks the order of the pieces, which is about all a game-free check can do here.

Two small things, neither blocking:

  • The respawn check compares Link's position with target. That relies on change_position having been applied to the actor by the next tick. At 4 units a second the lag is far under 2 units, but the "return to mark" action (3) while flying can jump target far away in one tick. If the actor position only updates after the physics step, the next tick would read the old position, see it more than 2 units from target, and re-seed there, which would cancel the return. I could not tell that from the source, so I would try mark then return while flying when you next have the game up.
  • The respawn and owl case, and flying into an exit, are listed as not tested yet. Worth a quick run before or right after merge.

CI: the only red check is tests/test_display_startup_failure.py (driver_cache_room undeclared, in the Vulkan code), on both the Ubuntu and Windows part 1 jobs. This PR does not touch that area, so I am not blaming it. The new test and everything else passes.

Read through it and it holds together. Letting `flying` go to 0 while `oot_event_playing` is true also clears `flying_actor`, so the flight re-seeds from where Link stands when the event ends, and the early `if (!flying && action != 2 && action != 3) return;` leaves him alone in between. The event test is the same `events + 104` the teleport already uses, so the "waits until the current event ends" path and the new yield agree. The new test checks the order of the pieces, which is about all a game-free check can do here. Two small things, neither blocking: - The respawn check compares Link's position with `target`. That relies on `change_position` having been applied to the actor by the next tick. At 4 units a second the lag is far under 2 units, but the "return to mark" action (3) while flying can jump `target` far away in one tick. If the actor position only updates after the physics step, the next tick would read the old position, see it more than 2 units from `target`, and re-seed there, which would cancel the return. I could not tell that from the source, so I would try mark then return while flying when you next have the game up. - The respawn and owl case, and flying into an exit, are listed as not tested yet. Worth a quick run before or right after merge. CI: the only red check is `tests/test_display_startup_failure.py` (`driver_cache_room` undeclared, in the Vulkan code), on both the Ubuntu and Windows part 1 jobs. This PR does not touch that area, so I am not blaming it. The new test and everything else passes.
Commenting is not possible because the repository is archived.
No description provided.