Skip to content
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

Merged
merged 3 commits into from Jun 27, 2019

Conversation

Projects
None yet
7 participants
@davidpwbrown
Copy link
Contributor

commented Jun 23, 2019

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

@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

Screenshots or, even better, gif would be helpful.

@davidpwbrown

This comment has been minimized.

Copy link
Contributor Author

commented Jun 24, 2019

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.
Itd be much faster for everyone else I imagine.

@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

Oh, this is absolutely marvelous!

Show resolved Hide resolved src/player.h Outdated
Show resolved Hide resolved data/raw/keybindings.json Outdated
Show resolved Hide resolved src/overmap_ui.cpp Outdated
Show resolved Hide resolved src/overmap_ui.cpp Outdated
Show resolved Hide resolved src/overmap_ui.cpp Outdated
Show resolved Hide resolved src/overmap_ui.cpp Outdated
@davidpwbrown

This comment has been minimized.

Copy link
Contributor Author

commented Jun 25, 2019

Fixed some pathing problems, and the prompt to continue travelling when mosnter spotted.
Think it's fully there now.

It's much faster.

https://gfycat.com/fondspicykiwi

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jun 26, 2019

It keeps stopping after what looks like reaching the next submap.

@davidpwbrown

This comment has been minimized.

Copy link
Contributor Author

commented Jun 26, 2019

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?

@davidpwbrown davidpwbrown force-pushed the davidpwbrown:player_overmap_travel branch from 4d1ba53 to 772b46a Jun 26, 2019

davidpwbrown added some commits Jun 26, 2019

test
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

@davidpwbrown davidpwbrown force-pushed the davidpwbrown:player_overmap_travel branch from 772b46a to 25e87d1 Jun 26, 2019

@Inglonias

This comment has been minimized.

Copy link
Contributor

commented Jun 26, 2019

This looks really cool!

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jun 26, 2019

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.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jun 27, 2019

This was breaking in iso tiles mode. Don't ask me why, no idea.

@kevingranade kevingranade merged commit b8698af into CleverRaven:master Jun 27, 2019

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
gorgon-ghprb Build finished.
Details
@kevingranade

This comment has been minimized.

Copy link
Member

commented Jun 27, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.