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

Fix the penalty calculation for enemy units that can evade the engagement during battle #9229

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

oleg-derevenetz
Copy link
Collaborator

@oleg-derevenetz oleg-derevenetz commented Oct 22, 2024

close #9225

With this PR:

fheroes2.engine.version_.1.1.2.2024-10-22.23-13-18.mp4

@oleg-derevenetz oleg-derevenetz added the improvement New feature, request or improvement label Oct 22, 2024
@oleg-derevenetz oleg-derevenetz added the AI Artificial intelligence behaviour label Oct 22, 2024
@oleg-derevenetz oleg-derevenetz added this to the 1.1.4 milestone Oct 22, 2024
const uint32_t penaltyDist = baseDist + Battle::Board::widthInCells + Battle::Board::heightInCells;

// Flying unit, even inferior in speed, can move around the entire battlefield and easily evade an engagement
if ( enemy->isFlying() ) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a flying unit is slowed, it can't fly over the whole battlefield. Does it make sense to take this into account?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nogov you definitely should take a closer look at the implementation of this method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Artificial intelligence behaviour improvement New feature, request or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combat, AI tends to prioritize the strongest stack without considering its flying ability/higher speed
2 participants