-
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
Player overmap auto-travel #31786
Player overmap auto-travel #31786
Conversation
Screenshots or, even better, gif would be helpful. |
https://gfycat.com/classicesteemedguineapig A gif of the selection of the route and the auto-travel. Bear in mind my laptop is an absolute potato, and recording and travelling in cata looks slow. |
Oh, this is absolutely marvelous! |
Fixed some pathing problems, and the prompt to continue travelling when mosnter spotted. It's much faster. |
It keeps stopping after what looks like reaching the next submap. |
It's not doing that for me... any particular situation you were in when it stops moving? any potential difficulties in pathing the terrain perhaps? or nearby monsters? |
initial implementation changed description remove include putting something back as I dont need it afterall linty lint lint Update src/activity_handlers.cpp Co-Authored-By: Anton Burmistrov <Night_Pryanik@mail.ru> Update src/activity_handlers.cpp Co-Authored-By: Anton Burmistrov <Night_Pryanik@mail.ru> made overmap UI text neater move omt_path to character.h change default key from F1 to W to initiate route Update src/overmap_ui.cpp Co-Authored-By: BevapDin <tho_ki@gmx.de> Update src/overmap_ui.cpp Co-Authored-By: BevapDin <tho_ki@gmx.de> Update src/overmap_ui.cpp Co-Authored-By: BevapDin <tho_ki@gmx.de> make it faster by delaying draw() call overmapui - changed to std::find, fixed pathing problems, and safe prompt test output
This looks really cool! |
I was just auto-traveling down a road, sometimes on it and sometimes not on it, there were no monsters or other threats and nothing in particular was happening to the player, so I'm not clear what would have cancelled it, but it was very persistent. It's possible I just had a bad merge with other stuff I was testing at the same time, so if I re test and that doesn't happen we can proceed. |
This was breaking in iso tiles mode. Don't ask me why, no idea. |
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/player-overmap-autotravel/20572/1 |
Summary
SUMMARY: Features "Player overmap auto-travel"
Purpose of change
Getting annoyed at the long-distance travelling back to base, I thought it might be cool to get the player to do it for you automatically.
Describe the solution
Leverages activities set_destination and player automove functionality.
Gets the omt pos from the overmap UI, where you can preview the route. ( press W to select and again to confirm )
THe player will then do an automove route there.
Similar to the automove, it will cancel when enemies are spotted.
This could probably be tweaked better to allow the player to keep movng even though enemies are visible, otherwise it is slightly less convenient, unless the path is known to be safe.
Describe alternatives you've considered
A proper absolute co-ord pathing system would be nice.
What I did here instead was find the next omt along , so its still inbounds and get its centre point, then path again when reaching that point, and so on.
This means it probably could be a whole lot faster.
Would welcome feedback on this area.
Additional context
N/A