-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto path #74644
Auto path #74644
Conversation
It is not ready for merge, but it is ready for review. |
I'm not sure this is a benefit. Like macros, this risks making it a player responsibility to make up for deficiencies in game systems and UX. |
@anothersimulacrum You are not the only one. @ GuardianDll pushed back too and warned me. I am totally fine with this not being merged. As stated on Discord, I made it for myself. Merging is just more convenient to me. |
TL;DR: I see the alternatives as either suboptimal or more work (for the player). I disagree though, that Travel to, and such, could be improved to the level this would be completely obsolete. For me, Travel to would have to find the optimal* path between A and B and that is next to impossible in all cases. Small improvements just don't do it for me. I need to believe the path is optimal. Just not being able to mark tiles as dangerous per-tile makes Travel to sub optimal. If that was implemented, then marking all dangerous tiles would be too much work. So let's consider only tiles I walked on already, I could have walked into a puddle I don't want to walk into again. Then I need to mark it off again. I could mark |
This comment was marked as resolved.
This comment was marked as resolved.
Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details. Click to expand
This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to Hints for adding a new word to the dictionary
|
I really like the UI! |
I will continue with this on 2024-07-22. I just figured this could be improved: I want I would like it if a TAB would always switch focus from buttons to paths list. I will see if I can make the buttons unselectable. Like in the keybindings menu. I dislike that when you browse paths with UP & DOWN, the bright blue is "hovered over" and light blue is "selected". This is confusing. I accidentally deleted the wrong path.
Add a popup on deleting a path. With all the path's info. The keybindings are what I figured could work. The menu could be opened with |
Added "Walk path from middle", see the Original Post. |
Just to repeat what guardiandll and anothersimulacrum already told you, this isn't getting merged, but if you want to work on it in this PR that's fine. |
I thought my argument was accepted:
But ok, thanks for letting me know. I guess I don't need to polish it any further then. |
It is ready. I am leaving it in draft since it will not get merged. Then reviewers don't have to look at an open PR. |
Summary
Features "Player can record paths and automatically walk them again"
Purpose of change
Resolve #74433
Describe the solution
Listen with
u.get_path_manager()->record_step
to when the avatar moves inAdd the new_pos to
std::vector<tripoint_abs_ms> recorded_path
. If a cycle is detected, remove it.Add an interface, where the player can manage their paths:
If they select
Walk path from middle
:Known issues to fix / features to implement:
(i)
hover next toWalk the path
button:Walk the first path from the list the player is standing on either end.
Will not fixDepends on:string_input_popup
to ImGui.string_input_popup
to ImGui needs migratingstring_input_popup::*history
which usesuilist
so it needs its migration which is being done in Migrate uilist to ImGui #74341Further possible improvements
dist optimization results
For the optimization, I ended up doing
max( tripoint_diff.abs().xyz() )
. The results are pretty amazing: 4 checks instead of 800 on this test path:Cataclysm_.Dark.Days.Ahead.-.0.G-10291-g221e3ee59b-dirty.2024-06-24.21-04-11.mp4
Works reasonably in a spiral. I especially like how the number of checks decreases despite the number of tiles increasing when the character walks away from the spiral at the end:
Cataclysm_.Dark.Days.Ahead.-.0.G-10291-g221e3ee59b-dirty.2024-06-24.21-18-35.mp4
recorded_path
frombegin()
toend()
withtile
, if the player is next to thetile
, delete everything fromtile
torecorded_path.end()
. This is similar to loop optimization but more aggressive.(i)
hover next to the button:Continue recording the first path the player is standing at either end of. Temporarily swaps start and end until the recording is finished.
Remember the path and the direction the player was walking. The player can press "continue walking". They continue if they are on the same path (even at different tile of the path). Otherwise popup with info to the closest tile and the tile you left the path:popup( "You are no longer standing on the path you were walking. You left the path 3SW, closest tile is 1N." )
look around
. Such paths might need some fixing on first use.Describe alternatives you've considered
Record keystrokes #74433 (comment)
Testing
I tried whatever I could think of. Should work on flat ground, with stairs, and ladders. Doesn't work with ramps, I will look into Travel To code when I have the time.
Additional context