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

Cleaner Focus Punch Handling #6031

Open
Pawkkie opened this issue Jan 15, 2025 · 2 comments
Open

Cleaner Focus Punch Handling #6031

Pawkkie opened this issue Jan 15, 2025 · 2 comments
Labels
category: battle-ai Pertains to Battle Engine Upgrade's AI feature-request Requests a new feature type: refactor type: reminder

Comments

@Pawkkie
Copy link
Collaborator

Pawkkie commented Jan 15, 2025

Description

Focus Punch is uniquely problematic because it's a super high damage move that the AI almost never wants to go for.

#6028 refactors Focus Punch handling to be more flexible with AI scoring so the AI can actually use it, which is great, but this also means that everywhere in the codebase that calculates a maximum damage or a hits-to-KO threshold will consider Focus Punch as dealing max damage, even though it doing so is very unlikely due to the nature of Focus Punch.

I fixed the one case that was needed to pass existing tests in #6028, but there might be a smarter / cleaner solution overall given some time to think about it.

This issue is a reminder so Alex and I don't forget that we should come back to this.

Discord contact info

@Pawkkie

@Pawkkie Pawkkie added type: reminder category: battle-ai Pertains to Battle Engine Upgrade's AI feature-request Requests a new feature type: refactor labels Jan 15, 2025
@i0brendan0
Copy link

Would it be a decent idea to try to give checks for scenarios that would make Focus Punch much more likely to hit?

For example

  • Opponent is asleep or frozen = extreme chance of Focus Punch hitting.
  • Opponent is paralyzed and/or confused = higher chance of Focus Punch hitting.
  • Opponent is stuck in the recovery turn of a move like Hyper Beam and/or the opponent has Truant = certain chance of Focus Punch hitting.
  • Opponent has a low accuracy stage and/or user has a high evasion = higher chance
  • User knows opponent can't use a damaging move = extreme chance

The cases could go on and on, but I think these 5 count for a large number of scenarios. At least with a 1v1.

@Pawkkie
Copy link
Collaborator Author

Pawkkie commented Jan 16, 2025

This is actually already how Focus Punch works! :D

The issue is just that, with this approach, certain places where you don't want to consider FP's massive 150 power due to its generally poor reliability, such as places in the switching or scoring code where you need to calculate how many hits your mon can take before being KO'd, you still consider a full power FP, which leads to weird behaviour because of how unreliable it is in practice. This means that for specific handling you'd need to consider it specifically in all of these cases, which isn't super sustainable and also kind of ugly :)

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 feature-request Requests a new feature type: refactor type: reminder
Projects
None yet
Development

No branches or pull requests

2 participants