It is currently 17 Jan 2021, 04:06
   
Text Size

Mutate and AI

Moderators: TheElk801, BetaSteward, LevelX, North, noxx, JayDi, jeffwadsworth, CCGHQ Admins

Mutate and AI

Postby gp66 » 18 Aug 2020, 18:19

I was able to get basic mutate working well enough to enjoy this cool mechanic. Still hunting down the occasional zone change bug where the merged cards don't follow the main permanent to the next zone.

I was unable to locate where I would add code to get AI to mutate under or over properly. Any suggestions would be greatly appreciated.

Here's a video example of my progress so far:
https://youtu.be/a3Z9HPp11WU

Here's a download link for the build (updated on 10-21-20):
https://1drv.ms/u/s!AhH5Enss8kF3mo8GoJJhaHc2u4jjcA?e=wp1p0r

Thanks to everyone who keeps this awesome project rolling along!

Cheers,
Gary
Last edited by gp66 on 22 Oct 2020, 03:09, edited 6 times in total.
gp66
 
Posts: 20
Joined: 26 Apr 2020, 23:37
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby gp66 » 22 Aug 2020, 23:07

I figured out how to create a private build, the link is in the first post. It's a little buggy but you'll be able to play some basic mutate decks. If you try it out and encounter any bugs, let me know.
gp66
 
Posts: 20
Joined: 26 Apr 2020, 23:37
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby DominusMaximus » 31 Aug 2020, 04:19

Bugs I've found:

1.) Regal Leosaur's Mutate trigger is giving itself +2/+1. It should only give other creatures +2/+1.

2.) When Brokkos, Apex of Forever is cast from the graveyard, it seems it's being cast normally instead of through its Mutate ability. The Mutate dialog doesn't appear even when there's a non-human creature on the battlefield.


Thanks for the build. It's been fun using mutate in XMage =D>
DominusMaximus
 
Posts: 3
Joined: 31 Aug 2020, 04:06
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby gp66 » 02 Sep 2020, 19:45

DominusMaximus wrote:Bugs I've found:

1.) Regal Leosaur's Mutate trigger is giving itself +2/+1. It should only give other creatures +2/+1.

2.) When Brokkos, Apex of Forever is cast from the graveyard, it seems it's being cast normally instead of through its Mutate ability. The Mutate dialog doesn't appear even when there's a non-human creature on the battlefield.


Thanks for the build. It's been fun using mutate in XMage =D>
Hi Dominus, I'll look into the Regal Leosaur bug, thanks for posting it.

Here is a list of what works and does not work...

What works with Mutate:
    if target is valid
      enters battlefield does not trigger
      summoning sickness is determined by target perm
    if target is not valid, mutate spell enters battlefield as a creature
      enters battlefield does trigger
      creature has summoning sickness
    zone changes work
      all merged cards follow main perm to next zone
      return to battlefield from graveyard and exile works for non-token mutate perms
    phased in/out (Teferi, Master of Time)
    if p/t has a "*", it is passed up to top card (characteristic-defining ability)
    clone/copy seems to be working, Spark Double, Quasiduplicate, etc

What does not work with Mutate:
    every once in a while, the mutate perm loses the merged cards
      the perm stays on battlefield, but it loses all of it's mutations
      it rarely happens so i haven't been able to track down why
      it does not seem to happen when playing human vs human

    mutating with a token
      sending to exile or graveyard that has an immediate or delayed return effect does not work
      mutating over a token
        the merged perm should not be a token anymore, couldn't figure this one out
        the image does not work

    rollbacks don't work with mutate perms
    the AI opponent has a lot of glitches
      AI has not been trained, it only mutates under
      at times, it takes a long time to make a decision
      a mutating perm sometimes steals abilities from recently cast creatures that have mutate
      mutate perms occasionally lose all their merged cards
    Brokkos, Apex of Forever's ability doesn't work
    most likely a ton of things i haven't even considered yet :D
gp66
 
Posts: 20
Joined: 26 Apr 2020, 23:37
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby gp66 » 02 Sep 2020, 20:50

New build link added to the first post, fixed Regal Leosaur and updated code to be even with master build, includes a ton of fixes to M21 cards.

Still can't figure out computer player mutating under/over correctly. :(
gp66
 
Posts: 20
Joined: 26 Apr 2020, 23:37
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby DominusMaximus » 05 Sep 2020, 17:06

Thanks for the build update and the rundown of what's working. I tried out several mutate interactions found in this article:

www cardmarket com/en/Magic/Insight/Articles/Tricky-Rules-Interactions-Explained-Ikoria-Edition

It goes through a wide variety of interesting interactions. Here's what I found:

1.) If I cast Mnemonic Betrayal, I shouldn't be able to cast an opponent's creature for its Mutate cost, since a Mutation can only occur if all creatures within the Mutation have the same owner.

2.) If a Mutate creature is on the stack, and I give the creature it's targeting protection from one of its colors (e.g. through Gods Willing), the Mutation shouldn't occur.

3.) If The Scarab God dies while Mutated, all creatures from that Mutation should be returned to its owner's hand at end of turn.

4.) If I enchant an opponent's Mutation with a Minion's Return, when that Mutation dies, all creatures should be returned to the battlefield under my control individually (no longer merged). When tested on a 2-creature Mutation, one creature returned under my control, and the other to my opponent's control. This interaction worked correctly when Minion's Return enchanted a Mutation I controlled.

Interactions that worked correctly:

1.) With a Fires of Invention on the board, you must still pay the Mutate cost.

2.) Umori, the Collector and Spellwild Ouphe reduced the Mutate cost.

3.) Misdirection is able to target a Mutation on the stack.

4.) Choosing a Dreamtail Heron to be the top creature of a Mutation caused a Controlled Instincts to fall off.

5.) Unsummon sends the entire Mutation to its owner's hand.

6.) Teferi, Hero of Dominaria's -3 ability sends the entire Mutation to its owner's library third from the top.

7.) A Mutated God Eternal Kefnet sends the entire Mutation to its owner's library third from top upon its death trigger resolving.

8.) A Mutated Guile solely shuffled itself into the library upon the Mutation dying (was surprised to see this work).

9.) A Mutation with Persist or Undying correctly brings back each creature individually (no longer merged) after dying, and each with the appropriate counter.
DominusMaximus
 
Posts: 3
Joined: 31 Aug 2020, 04:06
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby gp66 » 05 Sep 2020, 20:31

Dominus, thanks for the article link and testing all those mutate mechanics, will be adding a bunch of items to my to-do list. I'll give these a shot but programming mutate correctly is way beyond my programming skills, I had to hack the code up pretty bad just to get the basics working.

I'm just guessing, but there's a reason why the devs haven't added mutate yet, every time you write a line of code it opens up a can of worms in 4 or 5 other places and it never seems to end. I have the luxury to hack up the code for a personal build, the devs don't have this luxury, I wish them all the best with mutate and am looking forward to the final version.
gp66
 
Posts: 20
Joined: 26 Apr 2020, 23:37
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby DominusMaximus » 05 Sep 2020, 20:51

I understand. I had similar thoughts while reading through these interactions. It wouldn't surprise me if they end up having to make fundamental code rewrites to support it correctly.
DominusMaximus
 
Posts: 3
Joined: 31 Aug 2020, 04:06
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby Underdose » 16 Sep 2020, 14:54

I don't suppose there's any chance of you adding the C20 mutate cards to your build? Would love to try out my Otrimi deck on Xmage :)

Thanks for the work you're doing, looks like mutate is a real difficult mechanic to get working!

EDIT: Just found a bug that casting Brokkos from the command zone with his mutate cost causes him to just enter the battlefield normally, even though the mutate target is still valid.
Underdose
 
Posts: 6
Joined: 25 Apr 2018, 10:42
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby gp66 » 16 Sep 2020, 17:45

Underdose wrote:I don't suppose there's any chance of you adding the C20 mutate cards to your build? Would love to try out my Otrimi deck on Xmage :)

Thanks for the work you're doing, looks like mutate is a real difficult mechanic to get working!

EDIT: Just found a bug that casting Brokkos from the command zone with his mutate cost causes him to just enter the battlefield normally, even though the mutate target is still valid.
Hi Underdose,

Your post had impeccable timing, I was just getting a new build ready for Zendikar Rising so I was able to add the C20 mutate cards.

Brokkos is broke_kos (poor attempt at humor), he doesn't work, I couldn't get his mutate ability working. See the 4th post for what works and what doesn't work.

Let me know if the images don't work when you mutate under/over with the C20 cards.

Gary
gp66
 
Posts: 20
Joined: 26 Apr 2020, 23:37
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby gp66 » 16 Sep 2020, 17:49

New build link added to the first post, added C20 mutate cards and Zendikar Rising.

Still can't figure out computer player mutating under/over correctly. :(

One last plea to any dev reading this, any hint on how to get computer player mutating under/over properly would be greatly appreciated.
gp66
 
Posts: 20
Joined: 26 Apr 2020, 23:37
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby emerald000 » 16 Sep 2020, 18:08

The AI is terrible and is not really capable of making good plays presently. Having it figure out a 6/6 is better than a 2/2 isn't really a thing right now.
User avatar
emerald000
 
Posts: 92
Joined: 07 Jul 2014, 16:55
Has thanked: 1 time
Been thanked: 9 times

Re: Mutate and AI

Postby Underdose » 16 Sep 2020, 19:42

gp66 wrote:
Underdose wrote:I don't suppose there's any chance of you adding the C20 mutate cards to your build? Would love to try out my Otrimi deck on Xmage :)

Thanks for the work you're doing, looks like mutate is a real difficult mechanic to get working!

EDIT: Just found a bug that casting Brokkos from the command zone with his mutate cost causes him to just enter the battlefield normally, even though the mutate target is still valid.
Hi Underdose,

Your post had impeccable timing, I was just getting a new build ready for Zendikar Rising so I was able to add the C20 mutate cards.

Brokkos is broke_kos (poor attempt at humor), he doesn't work, I couldn't get his mutate ability working. See the 4th post for what works and what doesn't work.

Let me know if the images don't work when you mutate under/over with the C20 cards.

Gary
Oh wow, that was great timing! Thanks so much, nicely done! I'll post here if any images don't work.

I'd love to offer actual help, but I haven't done any coding for years and even that was extremely basic C++, literally no java, so with that in mind take my suggestion with a huge rock of salt - but are you able to use the AI's blocking decision as a basis for over/under? It pretty much always blocks if it has a bigger creature, and will never block if its creature is smaller and would die. Since with mutate 99% of the time you want the bigger creature on top, could you use that?

Best of luck with it, and thanks again! :)

Edit to add: The deck builder appears to be pretty broken in this build unfortunately - cannot add or remove cards by double clicking. Moving cards to/from sideboard or from the deck to the searcher to remove them does not actually move/remove them, only visually appears to. Searching doesn't show any results until you do something such as remove lands from results. Trying to use the text export/import feature at the moment to modify the deck list.
Last edited by Underdose on 16 Sep 2020, 20:23, edited 1 time in total.
Underdose
 
Posts: 6
Joined: 25 Apr 2018, 10:42
Has thanked: 0 time
Been thanked: 0 time

Re: Mutate and AI

Postby emerald000 » 16 Sep 2020, 19:48

You'd have to rewrite how the computer makes choices, which is not an easy feat. Currently, if you ask him a yes/no question, it always answers yes. So it will always choose the same position to put the mutate creature.

As long as the mechanic works and you can make the test player choose over/under in tests, we don't really care about the AI.
User avatar
emerald000
 
Posts: 92
Joined: 07 Jul 2014, 16:55
Has thanked: 1 time
Been thanked: 9 times

Re: Mutate and AI

Postby gp66 » 16 Sep 2020, 20:41

emerald000 wrote:You'd have to rewrite how the computer makes choices, which is not an easy feat. Currently, if you ask him a yes/no question, it always answers yes. So it will always choose the same position to put the mutate creature.

As long as the mechanic works and you can make the test player choose over/under in tests, we don't really care about the AI.
Thanks for the clarification, and thanks for all the work on XMage =D>
gp66
 
Posts: 20
Joined: 26 Apr 2020, 23:37
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Developers Talk

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 1371 on 09 Feb 2020, 16:22

Users browsing this forum: No registered users and 1 guest

Login Form