feat(input): "!place X Y Z" in the live input puts Link at a position in the map he is in #1351
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1351
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki/Longshot:live-place"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: feat · Risk: low · Tested on: Linux (Arch, kernel 7.2.15), RTX 4090 (NVIDIA 615.78.08) · Needs: Windows, any GPU (a
!placeline in a real run)Why
A bug report that says where Link was (the map, and x, y and z) cannot be followed by a tester today without walking there, and a test scenario or scripted run that has to start at one exact spot (the automated test player of #1198 is one) has no way to say so. The Debug tab's Teleport takes Link to a map's entrance, and Mark position and Return to mark only go back to a spot Link marked himself. This adds one line for the live input file (
HOS_INPUT_LIVE),!place X Y Z, that puts Link at that position in the map he is in. A tester pastes the numbers of a report's place line into it. The Bug report'splace:line (a separate change, not in this PR) prints the same numbers: metres, the frame of the control bridge'spos, one decimal, so a pasted position is within 0.09 m of where the player stood.What changed
!place X Y Zis a new line for the live input file, next to!cheat. The host takes three finite numbers, makes them the mark of the Debug tab's Return to mark and runs that return at Link's next update, so the game's own position change moves him and the log sayscheats: returned to X Y Z. Any other line (two numbers,nan,inf, letters, no numbers, a longer command that starts the same) is ignored. It needs neitherHOS_OOT_CHEATSnor the Debug tools row.host/nn_hid.c: the live input's reader parses!place <x> <y> <z>beside!cheat:sscanfof three floats, each tested finite, then the three are stored and one request is raised (release store).host/hos_main.c:oot_update_player_cheatstakes the request (acquire exchange) when no other action is waiting, copies the position into the return to mark'smark, marks the actor and controller as the mark's own, and runs the existing return to mark (action 3) at the same update. The flight, mark and return code is unchanged.tests/input_background_test.c,tests/test_input_background.py: a newlive-placecase runs the realread_inputagainst a live file: a good line stores its three numbers and asks once; the six look-alike or malformed lines leave the stored numbers and the request alone.docs/development.md: theHOS_INPUT_LIVErow says what!placetakes and does.What it does not do:
!cheatis, and a position inside a wall or over a drop is accepted as asked (the game then does what it does with Link). None of these was tried.cheats: returned toline; a driver tells by that line (read from the code, not tried).!placelines read in the same 30 ms poll: the last one wins.Measurements
Nothing to time: the only cost when no
!placeline is sent is one atomic exchange of an integer per update of Link; what was checked is that it works, in Testing.Flags and settings
None.
!placeis a line in the live input file, not aRX_,HOS_orLONGSHOT_switch, a menu row or an ini key.Testing
Tested: Linux (Arch, kernel 7.2.15), RTX 4090 (NVIDIA 615.78.08), i9-13900K, headless, 2026-11-16; main @
8e9cfc3a2and this PR @ d8277decf (based on that main; not rebased onto the six commits main has gained since).The new game-free test, both ways.
tests/test_input_background.pyhas the new caselive-place. On main'shost/nn_hid.cit fails:FAIL:391 hos_oot_place_ask == 1 && hos_oot_place[0] == 1.5f && hos_oot_place[1] == 2.0f && hos_oot_place[2] == -3.25f(the line is never read). With this PR the whole file passes, endingPASS: the live input's !place stores a finite position and asks once; malformed lines are ignored.The whole suite,
python -I -B tests/run_all.py --jobs 6 --strict, in a fresh home, once on this PR and once on main @8e9cfc3a2. This PR: 657 passed, 39 failed, 17 skipped. Main: 656 passed, 40 failed, 17 skipped. The 39 that fail here fail on main too, and are not this PR's: test_bug_report_defaults, test_cpu_report, test_crt_options, test_damage_debug_menu, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_framegen_preset, test_fsr_uniform_ownership, test_guest_imported, test_hud_layout_row, test_import_reach, test_invalidate_vcore, test_linux_preflight, test_linux_pressure, test_linux_update, test_menu_i18n, test_mirror_budget, test_missing_nup, test_mods_size_table, test_nonuniform_image_arrays, test_parallel_init_order, test_pending_guest_import, test_pipeline_play_cache, test_present_thread, test_profiling_mode, test_readback_timeout_source, test_replay_write_order, test_rumble_menu, test_run_all_changed, test_slow_frames, test_staging_burst, test_target_image_pool, test_tested_configurations, test_upscaler_round_trip, test_upscaler_rows, test_vcore_escape, test_vk_occlusion_queries, test_walk_key. (Main also failedtest_bake_skeletonin its run; it passes on this PR.) The rule tests this change could touch pass:test_input_background,test_pipeline_tour(it reads the!cheatline inhost/nn_hid.c),test_debug_tools_linux,test_flight_yields_to_events,test_doc_anchors,test_env_on,test_readme_menu_rows.test_menu_i18nfails on main as well (pt-BR: 583 != 582).Linux build. A full
make_game.pybuild of this PR @ d8277decf exited 0 (7 min 10 s: the game translated again from this checkout's sources; 104 of the 517 compiled files were new, the rest came from an object cache of an earlier build with the same compiler),@@done. The build did not prepare shaders; the game run's first stage did (below).Windows, compiled, not run. The Windows-target syntax check of the changed fixture (
tests/input_background_test.c, llvm-mingw 20261104): PASS, stopped before running it. A cross-build on Linux with the same llvm-mingw (Clang 23.1.5) and the project's own build plan: the renderer DLL linked, and 61 of 61 host sources compiled for Windows,host/hos_main.candhost/nn_hid.camong them (both new, not cached), with 0 warnings under the project's flags (-Wno-everything, so that is not a warning-clean claim). The game executable was not linked (no Windows lift here), and nothing ran on Windows.In the game, three maps, one run. A hold of one game run on this PR's full build @ d8277decf (a first stage prepared the shaders, 353 s; then the game, started from a copied save with only
HOS_CONTROLandHOS_INPUT_LIVE: guest memory off, noHOS_OOT_CHEATS, the Debug tools row Off). In Kokiri Forest, Hyrule Field and the Deku Tree (child Link) the driver teleported Link in, read his position, walked him about 4.8 m, read it again, then sent!placeback to the first position and on to the second, reading his position for 2 s after each and taking a picture. A seventh warp teleported into the Deku Tree first and then placed him.Every warp has both lines in
longshot_log.txt, in this order, with the asked numbers (shown here as X Y Z): 7!placelines, 7 returns, none missing or extra:The run ended by the game's quit: exit 0,
fatal=0 crash=0 devlost=0, no kernel or driver lines (kernel=0 nvrm=0), 5,675 frames, headless on the RTX 4090 with the PC busy, so its frame rate says nothing. Pictures, each after the first!placeof a map (Link stands where it was asked; the HUD and the map show the right place):live-place-kokiri-forest.jpg(Kokiri Forest),live-place-hyrule-field.jpg(Hyrule Field, in a tunnel mouth),live-place-deku-tree.jpg(Deku Tree, 1F). The same three maps gave 6 of 6 warps at 0.00 m on a private build of an older commit with the same patch.Not tested:
!placehas not run on Windows; the changed fixture and the host were only compiled for it (above).Must be tested:
!placein the live input): start the game withHOS_INPUT_LIVE=<file>(the control bridge'sstatusfor Link's position), load a save in Kokiri Forest, append the line!place X Y Zto the file with three numbers a few metres from where Link stands, and expecthid: live command ... !place ...andcheats: returned to X Y Zinlongshot_log.txt, and Link standing at the asked place a second later (hisposequal to the numbers).Risks
What could break: Only a
!placeline in the live input file does anything new, and that file is a test run's, not a player's. With no such line the host's Link update takes one more atomic exchange of an integer each time. A position that is wrong for the map (inside a wall, below the floor, over a drop) is taken as asked and the game then does what it does with Link; the command does not check the map. It reuses the Debug tab's return to mark, so it replaces that mark: Return to mark in the tab goes to the placed position until the next Mark position.Turning it off: revert the commit; with no
!placeline in the live input file nothing changes.Compatibility: Nothing changes: no save,
longshot_options.ini, cache,MkwVkHostor builder change.Issues
See #1198 (#1198): the automated test player, which needs to start a scenario at a given place.
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main(544229a26): the branch is one commit on top of it, the game-free input test passes after the rebase (python -I -B tests/test_input_background.py). The game run and the full build were on the commit before the rebase (main @8e9cfc3a2); the six commits between touchhost/hos_main.canddocs/development.mdaway from these lines and the rebase had no conflict. A rebuild on the new base is not done.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named): the 39 failures are main's own and named in Testing.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.New on this forge; not opened on GitHub.
A test run or a bug report that gives coordinates could only be followed by walking there, or by a teleport that lands at the map's entrance. "!place X Y Z" in HOS_INPUT_LIVE's file asks the host to put Link at that position (metres, the frame of the control bridge's pos) by the Debug tab's Return to mark path: the asked position becomes the mark and the return runs at Link's next update, so the log says "cheats: returned to X Y Z" and the game's own position change moves him. Only three finite numbers are taken; any other line is ignored. It does not set his facing, change the map or wait for an event, and it needs neither HOS_OOT_CHEATS nor the Debug tools row. nn_hid.c reads the line (host/nn_hid.c, beside "!cheat"), hos_main.c's oot_update_player_cheats takes it as the return to mark's action when no other action is waiting. tests/input_background_test.c, tests/test_input_background.py: the live-place case runs the real read_input against a live file: a good line stores its three numbers and asks once; a short line, nan, inf, letters, no numbers and a longer command name that starts the same ("!placement") are ignored. It fails on main (the ask is never set). docs/development.md: the HOS_INPUT_LIVE row. Assisted-by: Claude Sonnet 5.5 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>WIP: feat(input): "!place X Y Z" in the live input puts Link at a position in the map he is into feat(input): "!place X Y Z" in the live input puts Link at a position in the map he is in!place X Y Zin the live input file puts Link at that position in the map he is already in. I read head20d9dff9. It applies onto current main. The Windows run it still names is open, so this is not an approval.The reader keeps three finite numbers and raises one request. A short line,
nan,inf, letters, or a longer word that only starts withplaceleaves the request alone. Link's next update takes it when no cheat action is already waiting, copies the numbers into the Debug tab's mark, and runs the existing return to mark. The log sayscheats: returned to. It does not needHOS_OOT_CHEATSor the Debug tools row, and it does not turn him or change the map. Return to mark afterwards goes to the placed position until the next Mark position. If that update has no player controller, the request has already been taken and the log has no return line; the description says so.The game-free test checks the reader. The Linux run, on the commit before this rebase, put him on the asked spot in Kokiri Forest, Hyrule Field and the Deku Tree, with a return line for each
!place. Must be tested still asks for the same line in a Windows run.Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.