It is currently 16 Apr 2024, 10:18
   
Text Size

Tempest world development

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Tempest world development

Postby Seravy » 17 Sep 2017, 17:01

Found another unplayable card :

Coffin Queen - AI should not untap it if it is currently reviving a creature. In general it should not be used during upkeep - probably only during enemy turn unless targeting a creature with Haste, unless the AI learns to evaluate which is higher value play, the revived creature or other options in hand.

Also, I observed a BUG : AI used the card immediately after it was untapped with the trigger still on the stack, and the untap effect removed both the old and the new revived creature while it should only be the old one.
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Tempest world development

Postby Seravy » 17 Sep 2017, 17:39

AI didn't remove counters to heal from Spike Feeder in response to Dark Banishing :(
...and it blocked a Juggernaut when there was no need to (still at 18) and also didn't remove counters. That's not a bad move actually, if removing the counters but horrible otherwise.

...AI has 2 copies of Verdant Force in hand but only 2 forests, does not activate Survival of Fittest...I don't want to put a 22th deck on the unplayable list but I'm not sure there is a point in difficulty testing the deck when the AI fails at this many things - It's still playable but once fixed the difficulty would be much higher...
Speaking of which the AI probably shouldn't play a second copy of Fittest, one is plenty and doing that blocks it from searching for a card using that green mana - often losing an entire turn or more.
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Tempest world development

Postby Agetian » 17 Sep 2017, 18:31

Seravy wrote:...AI has 2 copies of Verdant Force in hand but only 2 forests, does not activate Survival of Fittest...I don't want to put a 22th deck on the unplayable list but I'm not sure there is a point in difficulty testing the deck when the AI fails at this many things - It's still playable but once fixed the difficulty would be much higher...
Speaking of which the AI probably shouldn't play a second copy of Fittest, one is plenty and doing that blocks it from searching for a card using that green mana - often losing an entire turn or more.
I improved it as far as playing the second copy goes. Not sure what's up with that first issue you mentioned, feels like we're almost on different builds. Just tried a scenario with two forests and two Verdant Force in hand, and it activated Survival of the Fittest twice to grab castable cards and put both Verdant Force into graveyard. :/ A game state would help see what's up in your particular case, as usual (but there is none, unfortunately).

I also improved Spike Weaver to be used in most of those cases you outlined above.

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Tempest world development

Postby Seravy » 17 Sep 2017, 18:43

I'm using the build from yesterday, it takes forever to update, patch and compile so I only do it when a relevant change happens. Once I finish these last 3 blue decks I'll do an update then.

Here is a state file to reproduce the problem - it seems if the AI has enough lands in play but not of the right color it fails to activate it.

I tried and it activated it with 5 or fewer lands, but not with 6 or more so it's not even "enough lands".

Also, it should always activate on any creature if playing a "living death" deck, see my "1." on the list of activations. Possible exception to this rule could be Eternal Witness (to fetch the Living Death from the grave) if we really want one but it's not relevant to this quest world.
Ideally with this deck and only this deck we want to dump most of the creatures into the grave ASAP.
(up to you if you want to restrict it to only cases when Living Death/Twilight's Call/All Hallow's Eve is in hand, or having many of them in deck is enough, each has its advantage and weakness - in case of the former the threshold to cast the spells needs to be high enough to allow the AI to fill the grave first. )
Attachments
fittest.txt
(1.69 KiB) Downloaded 217 times
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Tempest world development

Postby Agetian » 17 Sep 2017, 18:52

Yeah, predicting colors of mana, among other mana payment issues, is a complicated thing, so if that's the problem, it'd be rather tough to fix with the AI model we currently have (without a rather thorough rewrite of that mentioned component). It's also the source of the issues with, for instance, the AI misfiring on Dark Ritual from time to time or tapping a Nykthos, Shrine to Nyx and then failing to play anything because it needed other colors. There are some worse bugs associated with mana payment, such as e.g. the AI not being able to pay (or offer auto payment, for that matter) for Anafenza, the Foremost when it has three different nonbasics, each of which offer two or three different colors of mana to pay. :/

Hmm, predicting a Reanimator deck (not necessarily Living Death, but any kind) might be tough, but fun to try. I'll see if I can find time. :)

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Tempest world development

Postby Seravy » 17 Sep 2017, 19:02

I don't see how the AI can mistake 4 swamps and 2 forests as enough to pay 5GGG though so there has to be more behind this. If it's those complicated cases, yes, that's not surprising. In those cases it probably will be able to play the card as soon as it draws a land anyway so they are not that important (tho mana payment in general is - wild growth and mana flare type cards are a major part of the game) but messing up on 6 basic lands...shouldn't ever happen.

...maybe I need to take a look at mana payments tho I know next to nothing about scripting :(

More importantly, are mana payments an NP-complete problem? If yes, we are in big trouble...
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Tempest world development

Postby Agetian » 17 Sep 2017, 19:07

Yeah, I'll take a look if I can improve the Survival routine in particular, I think it's currently only using the mana count, I'll see if I can hook the "can pay the cost right now" code in there to make it better :)

EDIT: Hmm, actually, not really, it's already checking the "can pay the cost right now" in at least one place there. I'll need to debug this to see what's going on.

Ok, I see what's up - there's currently a CMC difference threshold set up, so that if the card is at +3 CMC or less compared to the mana available at the moment, the AI will not consider the card for SotF discard. +3 is probably too much for the "average case", but +1 would likely be too low (since the AI will be able to hard-cast it with just one more mana). Hmm, maybe set it to +2 for now? :/ Or, better yet, try to detect Reanimator and, if we are playing it, then discard anyway.

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Tempest world development

Postby Agetian » 17 Sep 2017, 19:51

Ok, Survival should be a bit better in those scenarios with playing Reanimator (with specific cards right now, I marked Living Death, All Hallow's Eve and Twilight's Call). Will detect presence of 1+ in hand or 3+ in deck.

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Tempest world development

Postby Seravy » 17 Sep 2017, 19:51

Detect reanimtor definitely.
However, even if not reanimator, I'd say still discard without a CMC threshold - we effectively have to pick between these two bad things :

1. AI keeps holding its last card(s), fails to draw a land to play them, loses to whatever threat the human manages to play. (note that fittest itself is -1 card on the AI's side so this is a likely outcome if there are a lot of 1 card vs 1 card trades)
2. AI discards its "big bomb" and wastes it but gets to play something else. Unlikely to be a problem in constructed decks - they'll probably dig from the grave or play multiple copies of the main threats or even tutor for Squee and gain massive card advantage. More of a problem in limited, but having a play is still better than not having one I think.

However, detection should probably count lands already in hand ready to be played? At least the first two...
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Tempest world development

Postby Seravy » 17 Sep 2017, 20:02

Oh, if you made the "do not play multiple copies" into an AILogic then Treasure Trove is another card that could benefit from it. There might be more but that's the only one coming to my mind right now. It's probably something we'll see needing often.
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Tempest world development

Postby Agetian » 17 Sep 2017, 20:03

Yeah, true.
Btw, with that in mind, what phases should the AI play it in? I mean, currently it'll play it in basically any phase, I think. This way, with repeated activations (with no CMC threshold especially, and when looking to fill the graveyard due to reanimator), it can simply mana lock itself turn after turn.

"Don't play multiples" is a simple NeedsToPlayVar check in the script, can be added to pretty much any card that the AI needs to have only one of on board at the same time, but keep in mind it's a pretty hard limitation, in fact, it might be too restrictive - if something happens to that first Survival (e.g. Imprisoned in the Moon), the AI won't play another until that first one is gone. So actually, I'm not sure if I'm a big fan of this type of thing, I think I'll remove it for the time being and see if I can imagine a better solution.

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Tempest world development

Postby Seravy » 17 Sep 2017, 20:25

Change the limitation to not count cards enchanted by enemy Auras. If it's a global effect, the second copy will also get disabled so playing more won't help.
Fittest, the AI should activate during enemy end of turn I guess. Can't imagine a reason why you'd want it earlier unless you are digging for a creature that has Flash.
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Tempest world development

Postby Seravy » 17 Sep 2017, 20:34

Finished sorting out the difficulty levels of all functional decks.

Easy : 8
Medium : 9
Hard : 2
Very Hard : 1
Unplayable : 22

As only half the decks are playable, I think there is no need to hurry designing the challenges yet. I'll wait for AI improvements or maybe work on something else meanwhile.

PS : not playing additional copies can also save the AI from mass removal spells, so it's a very useful effect. (tho it needs to be added on a per-card basis - Ensnaring Bridge for example should always be played to ensure hand size is small and no attack happen due to targeted removal even though the effect itself is not cumulative.)
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: Tempest world development

Postby Agetian » 18 Sep 2017, 04:21

Ok, readded the "only one Survival on the battlefield" restriction using the AI cast parameter. Actually, can't find good debuff targets yet (Imprisoned in the Moon doesn't work on enchantments), so added it in its original MaxControlled form for the time being. Also added it to Treasure Trove.

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Tempest world development

Postby Agetian » 18 Sep 2017, 07:04

Should hopefully be better: Evacuation (and other similar cards for the purpose of lethal damage last resort save), Survival of the Fittest (one on the battlefield), Treasure Trove (one on the battlefield), Sudden Impact (and similar cards).

- Agetian
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 74 guests


Who is online

In total there are 74 users online :: 0 registered, 0 hidden and 74 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 74 guests

Login Form