-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Handle the AI hero's patrol mode in the AI pathfinder #9016
Conversation
I believe this PR should also fix #2315. |
@oleg-derevenetz , many thanks for this improvement! |
Hi @oleg-derevenetz , could you please manage the project for a while as I need to solve many personal issues at the moment? |
Hi @ihhub
Yes, of course. But I am not very familiar with some parts of the project, for example, the Editor. I hope you will be back soon. |
@oleg-derevenetz , thank you so much! |
Well, AI heroes of patrol will not return to the "starting point", because this point doesn't have any "special value" for them (and, to be honest, I don't see any reason why it should - why it should be somehow "better" than any other tile in the patrol zone). But of course they will perform a fog discovery within their patrol area (see the video in the PR description), visit castles, regularly hire troops in the external dwellings and so on. |
fix #9015
Currently in the
master
branch, the "patrol mode" is implemented as follows: objects outside the patrol radius are simply not considered as targets for the hero in "patrol mode". This leads to the possibility of behavior like this:fheroes2.engine.version_.1.1.1.2024-07-30.19-06-10.mp4
This hero has the patrol mode enabled and a patrol radius of 4 tiles, thus, the artifact is "sort of" in this radius, so he does not hesitate to simply run through the already-explored territory to this object, even along a trajectory that is outside the patrol zone. I believe something similar could have happened in #9015, just on a larger scale.
With this PR:
fheroes2.engine.version_.1.1.1.2024-07-30.19-11-41.mp4
Also, this PR removes any restrictions on the use of any adventure spells by heroes in patrol mode to pave the way. For instance, now such heroes can use Town Portal to teleport to any town or castle within their patrol radius.