Open Brambor opened 1 week ago
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 furniture_type = puddle
to be blacklisted. That wouldn't work, since it sometimes is better or possible to only walk through puddle. So we would define cost for each tile ... ... ...
Recording path across ramp doesn't work (stairs do work).
I just found out that Travel to doesn't work with ramps either:
Commanding the character to
Travel to
to the tile below the cursor.
The moment you step down it cancels:
Edit: I think I fixed that, PR coming soon.
Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.
This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt
so they will not trigger an alert next time.
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:![image](https://github.com/CleverRaven/Cataclysm-DDA/assets/13402666/40ba97fb-b24c-4937-909f-28be870c825e)
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 fix:
string_input_popup
to ImGui.Further not-implemented 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: https://github.com/CleverRaven/Cataclysm-DDA/assets/13402666/c6d2dc67-b2fd-40eb-9090-b5ccd76e660e 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: https://github.com/CleverRaven/Cataclysm-DDA/assets/13402666/7f44f12e-a91b-44aa-853c-497edd3e01f8 ---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.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 https://github.com/CleverRaven/Cataclysm-DDA/issues/74433#issuecomment-2171117437
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