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

AI: add support for alternative costs usage (regression bug) #13139

Open
JayDi85 opened this issue Dec 14, 2024 · 1 comment
Open

AI: add support for alternative costs usage (regression bug) #13139

JayDi85 opened this issue Dec 14, 2024 · 1 comment

Comments

@JayDi85
Copy link
Member

JayDi85 commented Dec 14, 2024

Current AI logic can't choose between alternative or normal cost -- it uses random. If it choose a wrong option (e.g. impossible to pay) then whole activate/cast will fail and lead to bugs like "AI do nothing":
shot_241214_220954

It's a regression bug from newly added alternative cost choose dialog from #12420. Old code with canPay and yes/no choices was a more friendly for AI games:
shot_241214_221715

Possible fixes:

  1. canPay check before make a choice (for AI and human). Faster solution, but not covered some use cases;
  2. Available mana check before make a choice (for AI only) ;
  3. Available mana check before make a choice (for AI and human);
  4. Full game simulations for each possible alternative option. Better and harder solution;

Also human's UX can be improved to show non-selectable options or additional info for better misclicks (example: if only alternative cast possible then user must see it before real cast).

[[Nulldrifter]] can be a good starting point, see disabled AI tests in NulldrifterTest from 4bce1e0

Copy link

Nulldrifter - (Gatherer) (Scryfall) (EDHREC)

{7}
Creature — Eldrazi Elemental
4/4
When you cast this spell, draw two cards.
Flying
Annihilator 1 (Whenever this creature attacks, defending player sacrifices a permanent of their choice.)
Evoke {2}{U} (You may cast this spell for its evoke cost. If you do, it's sacrificed when it enters.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant