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

Prevents double targeting on player mon if both ai mons see kill #5297

Draft
wants to merge 7 commits into
base: upcoming
Choose a base branch
from

Conversation

AlexOn1ine
Copy link
Collaborator

Closes #5212. It isn't exactly what was asked in the suggestion but this is a superset of it. I believe the suggestion in the issue ticket isn't good and should not make it into expansion

In vanilla when both AI mons see a kill on a player mon they will pin down the mon with both mons. This pr changes it so the other mon will be targeted by one of the AI mons.

Since this is a superset of the vanilla implementation I made it as default with a vanilla ai flag to turn it off. This could potentially be a config. Additionally or replacing the ai flag.

Examples:

Slot 1 Slot 3
Slot 0 Slot 2

If slot 1 and 3 see kill on slot 2, Slot 1 will first target slot 2 then if Slot 3 targets slot 2 as well, slot 1 will recalc and skip slot 3 as the target

If both ai mons (slot 1 and 3) see kill on both player mons (slot 0 and 2), slot 1 will randomly decide between slot 0 and 2. Then Slot 3 decides randomly. If they both target the same slot, slot 1 will recalc

Scenario 1:

double1.mp4

Scenario 2:

double2.mp4

Scenario 3:

double3.mp4

@Pawkkie Pawkkie self-assigned this Aug 31, 2024
@hedara90 hedara90 added the category: battle-ai Pertains to Battle Engine Upgrade's AI label Sep 1, 2024
@Pawkkie
Copy link
Collaborator

Pawkkie commented Sep 1, 2024

Would you be willing to add an extremely brief section for the flag to docs/ai_flags.md so it stays up to date? Just to keep it complete :)

Copy link
Collaborator

@Pawkkie Pawkkie left a comment

Choose a reason for hiding this comment

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

Looks good to me as is, though I would request that AI_FLAG_VANILLA_DOUBLE_TARGET get added to the ai_flags.md document if you don't mind :)

@AlexOn1ine
Copy link
Collaborator Author

Looks good to me as is, though I would request that AI_FLAG_VANILLA_DOUBLE_TARGET get added to the ai_flags.md document if you don't mind :)

Will add.

Also I want to write some tests.

@AlexOn1ine AlexOn1ine marked this pull request as draft September 19, 2024 16:02
@AlexOn1ine AlexOn1ine marked this pull request as ready for review September 19, 2024 19:38
@AlexOn1ine
Copy link
Collaborator Author

Ready for re-review

@AlexOn1ine AlexOn1ine marked this pull request as draft September 28, 2024 12:46
@AlexOn1ine
Copy link
Collaborator Author

AlexOn1ine commented Sep 28, 2024

There is a bug (the ai recalcs the target but not the move choice) in this so putting in on draft

@Pawkkie
Copy link
Collaborator

Pawkkie commented Sep 28, 2024

There is a bug (the ai recalcs the target but not the move choice) in this so putting in on draft

I'm now back form my honeymoon so can re-review when you're ready :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: battle-ai Pertains to Battle Engine Upgrade's AI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants