It is currently 19 Apr 2024, 19:32
   
Text Size

You may draw a card

Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins

You may draw a card

Postby PalladiaMors » 07 May 2015, 13:15

"You may draw a card" is a very common ability - if you search for this text in the card explorer it returns 105 implemented cards.

Part of these cards have been coded as regular MayChoices - I believe the script version of the ability has been coded like that. Most groovy cards have this ability coded as a SimpleMayChoice with a default choice of yes (Bident of Thassa, Cold-Eyed Selkie and many others).

This is a case of a common ability where in the vast majority of the situations you want to make a certain choice. In some very rare spots, it can lead to disaster (you have 1 life and opponent has Underworld Dreams on the battlefield, or you're playing against a mill deck and there's zero cards left in your library).

I have no doubt that coding all cards with this ability as simple choices would result in an overall increase in the AI's playing strength, simply because the amount of situations where you do want to draw is immensely higher than the very rare situations where you don't want to do it. The drawback is that the AI would make game-losing errors in some specific spots. If I understand it correctly, once a choice is set as the default choice, the AI can't avoid making it.

I'm pretty sure there are other MayChoices where similar options could be made. Please discuss!
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: You may draw a card

Postby muppet » 07 May 2015, 14:17

If I understand the way the ai makes a decision correctly it should be possible to bias them.
I think it simply counts the number of wins and loses and picks the line with the most wins.
Now if a decision makes almost no difference this makes it pretty random whether it will so one or the other. But if you add a bias so it needs say 75%wins to make the normally least optimal option e.g. not drawing the card then this should work. You might have to tweak the numbers till you found a good value.
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

Re: You may draw a card

Postby PalladiaMors » 16 May 2015, 14:24

Magarena has now extended SimpleMayChoice to other cases, and I was thinking about more cards that could also use it safely. Gempalm Incinerator and Gempalm Polluter came to mind, but while testing them to see if that worked I noticed that SimpleMayChoice doesn't allow a target choice. Would it be viable to extended it to targeted abilities in the future? I think that would improve AI handling of a considerable number of cards.

@muppet, if you pick the latest 1.62 build, some of the AI issues you've been mentioning should have been improved, like skipping life triggers or draws. Please playtest when you can if you're interested!
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: You may draw a card

Postby PalladiaMors » 16 May 2015, 15:30

Also, considering

muppet wrote:Failed to search for a basic land when Solemn Simulacrum entered the battlefield.
"you may search for a basic land card and put it onto the battlefield" at first sight looks like another good candidate for SimpleChoice in script form. As usual, I'm pretty sure there will be some rare situations where you don't want to do it, but it's the correct choice in the vast majority of situations, so there should be a net gain for the AI's strength. I think it might be possible in the future to add exceptions for the known exceptional cases. For example, the SimpleMayChoice.DRAW_CARDS could include a check to verify if the opponent controls a permanent named "Underworld Dreams" or if the player's library size is < 10, and in those cases switch to a default choice of No. These are just examples, I know that there will be more cases than that and that it's difficult to keep track of every possibility, but I don't think it's impossible to include the exceptional cases as people report misplays by the AI.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: You may draw a card

Postby jerichopumpkin » 17 May 2015, 14:49

I wonder if it's possible to add a failsafe to SimpleMayChoiche: only check if doing the default action leads to immediate defeat (draw with zero cards in deck, search a land and put it on the battlefield with Zo-zu in play and less than 2 life, etc.), and in that case, do the opposite of the default. Is it possible without impacting the code and the game performance too much?
jerichopumpkin
 
Posts: 212
Joined: 12 Sep 2013, 11:21
Has thanked: 19 times
Been thanked: 13 times


Return to Magarena

Who is online

Users browsing this forum: No registered users and 64 guests


Who is online

In total there are 64 users online :: 0 registered, 0 hidden and 64 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 64 guests

Login Form