Page 2 of 3

Re: Mutate and AI

PostPosted: 16 Sep 2020, 20:45
by gp66
Underdose wrote: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.
Sorry about that, i forgot to uncomment the array that holds the unfinished ZNR cards.

New build link in first post.

Re: Mutate and AI

PostPosted: 17 Sep 2020, 03:10
by gp66
Thanks @Underdose and @emerald000.

I simply switched the under/over selection and the computer player always mutates over.
This played so much better! I gave the AI player a black/blue flash mutate deck and it wiped me off the board. #-o

Just in case, copying the images folder from the previous build to the new build will save you a bit of time.
mage-bundle\mage-client\plugins\images

New build link is in post #1.

Re: Mutate and AI

PostPosted: 17 Sep 2020, 15:22
by Underdose
New build looks great! Been testing for a few hours now and not seen a single mutate card fall off.

Have run into a lot of missing images - the card points to the image name without the number that xmage recently added (e.g. /IKO/Sea-Dasher Octopus.full.jpg, rather than /IKO/Sea-Dasher Octopus.66.full.jpg), but it's not consistent - it seems to depend on what it's mutated on to. I can give you a list of cards I saw with incorrect image directory, but honestly it was pretty much all of them and like I say, wildly inconsistent.

Otrimi has the Brokkos problem where casting it with mutate from the command zone just puts it straight onto the battlefield instead.

Speaking of Brokkos, although it doesn't work if you cast it with mutate from command zone or graveyard, it does if you cast it from hand or from exile (tested with Vivien, Champion of the Wilds).

Hope this at all helps! Thanks again for your hard work, looking fantastic so far :D

Re: Mutate and AI

PostPosted: 17 Sep 2020, 17:45
by gp66
Underdose wrote:New build looks great! Been testing for a few hours now and not seen a single mutate card fall off.

Have run into a lot of missing images - the card points to the image name without the number that xmage recently added (e.g. /IKO/Sea-Dasher Octopus.full.jpg, rather than /IKO/Sea-Dasher Octopus.66.full.jpg), but it's not consistent - it seems to depend on what it's mutated on to. I can give you a list of cards I saw with incorrect image directory, but honestly it was pretty much all of them and like I say, wildly inconsistent.

Otrimi has the Brokkos problem where casting it with mutate from the command zone just puts it straight onto the battlefield instead.

Speaking of Brokkos, although it doesn't work if you cast it with mutate from command zone or graveyard, it does if you cast it from hand or from exile (tested with Vivien, Champion of the Wilds).

Hope this at all helps! Thanks again for your hard work, looking fantastic so far :D
Thanks for the ongoing input, it really helps.

The problem with images and mutate stem from cards with multiple images (multiple card numbers). All mutate cards have multiple images and when you mutate 'over' a creature with only a single card (no multiple art cards) the image sometimes does not work. I wracked my brain over this one and like most mutate stuff could not get it working 100% of the time and only with standard legal cards and now C20. The image works 100% of the time when mutating under a creature.

Hope this sheds some light.

Re: Mutate and AI

PostPosted: 18 Sep 2020, 14:35
by Underdose
gp66 wrote:Thanks for the ongoing input, it really helps.

The problem with images and mutate stem from cards with multiple images (multiple card numbers). All mutate cards have multiple images and when you mutate 'over' a creature with only a single card (no multiple art cards) the image sometimes does not work. I wracked my brain over this one and like most mutate stuff could not get it working 100% of the time and only with standard legal cards and now C20. The image works 100% of the time when mutating under a creature.

Hope this sheds some light.
Ah yeah that makes sense and sounds like a difficult problem to solve. FWIW, I made an image of each mutate card without the extra number in its name and the image seems to always work now when mutating over, but of course this would require each user manually adding those images or xmage changing their imaging number system again, neither of which seems likely!

Re: Mutate and AI

PostPosted: 25 Sep 2020, 08:32
by adesst
Hi @gp66,

i tested the mutate, "Gemrazer"

1. during cast, it ask me whether
- cast Gemrazer
- cast Gemrazer using mutate
2. i chose `cast Gemrazer using mutate`

Actual:
3. Gemrazer etb as a standalone card

Expected:
3. ask target of controll non-human creature
4. if target is valid then
5. ask to mutate on top or bottom of targeted creature
6. if resolved then ask target opponent, artifact or permanent
7. target opponent has to be ask or add target as many as the
successful target

Here is the snippet log:

2:40 PM, T9.M1: adesst78 puts Forest [e79] from hand onto the Battlefield
2:40 PM, T9.M1: adesst78 plays Forest [e79]
2:40 PM, T9.M1: adesst78 casts Gemrazer [b56] using mutate
2:40 PM, T9.M1: adesst78 puts Gemrazer [b56] from stack onto the Battlefield

Re: Mutate and AI

PostPosted: 25 Sep 2020, 15:46
by gp66
adesst wrote:Hi @gp66,

i tested the mutate, "Gemrazer"

1. during cast, it ask me whether
- cast Gemrazer
- cast Gemrazer using mutate
2. i chose `cast Gemrazer using mutate`

Actual:
3. Gemrazer etb as a standalone card

Expected:
3. ask target of controll non-human creature
4. if target is valid then
5. ask to mutate on top or bottom of targeted creature
6. if resolved then ask target opponent, artifact or permanent
7. target opponent has to be ask or add target as many as the
successful target

Here is the snippet log:

2:40 PM, T9.M1: adesst78 puts Forest [e79] from hand onto the Battlefield
2:40 PM, T9.M1: adesst78 plays Forest [e79]
2:40 PM, T9.M1: adesst78 casts Gemrazer [b56] using mutate
2:40 PM, T9.M1: adesst78 puts Gemrazer [b56] from stack onto the Battlefield
.

Hi adesst,

Yeah, that happens to me once in awhile too, forgot to add this to post #4. Also, usually when the board is full, the mutate perm will lose all the merged cards. I was not able to solve these issues. See post #4 for a full list of what works and what doesn't.

Thanks for reporting this issue,

Gary

Re: Mutate and AI

PostPosted: 25 Sep 2020, 16:50
by adesst
Hi Gary,

I added some rules to Gemrazer, as the card to work on.
And the ability i am focusing is to target controlled non-human
creature.

The JUnitTest shows promissing result. I am testing with
the quick-duel-mode. But can not figure out why the `game`
stops/end at turn 6th.

And another thing is, how could i share my working progress?
Would push the progress to my forked Mage help? or any other
method.

thx.

-ade-

Re: Mutate and AI

PostPosted: 26 Sep 2020, 17:16
by gp66
adesst wrote:Hi Gary,

I added some rules to Gemrazer, as the card to work on.
And the ability i am focusing is to target controlled non-human
creature.

The JUnitTest shows promissing result. I am testing with
the quick-duel-mode. But can not figure out why the `game`
stops/end at turn 6th.

And another thing is, how could i share my working progress?
Would push the progress to my forked Mage help? or any other
method.

thx.

-ade-
.
Mutate targeting will be handled in MutateAbility.java and the mutate triggered ability will be handled in MutatesSourceTriggeredAbility.java.

...\mage\Mage\src\main\java\mage\abilities\keyword\MutateAbility.java
...\mage\Mage\src\main\java\mage\abilities\common\MutatesSourceTriggeredAbility.java

I followed this pull request to get the basics working:
https://github.com/magefree/mage/pull/6567

As far as sharing your work, you can search Google to find some excellent tutorials, but just create a new local branch and then push to github.

Hope this helps.

Re: Mutate and AI

PostPosted: 08 Oct 2020, 22:33
by gp66
I was able to get the computer player to mutate under or over based on power and toughness.
While playing a test match, Auspicious Starrix mutated over a 1/1 creature, then Migratory Greathorn mutated under.
A few simple 'if' statements did the trick. :D

New build link in post #1

Re: Mutate and AI

PostPosted: 22 Oct 2020, 03:14
by gp66
fixed a null pointer error, new build link in post #1

Re: Mutate and AI

PostPosted: 18 Dec 2020, 18:32
by thefnitalian
Is there a any update on this build?

Re: Mutate and AI

PostPosted: 18 Dec 2020, 20:53
by gp66
thefnitalian wrote:Is there a any update on this build?
Sorry, the build in post #1 is the last.

Re: Mutate and AI

PostPosted: 20 Dec 2020, 01:34
by thefnitalian
So what does that mean? Is the mutate code just being deprecated and not worked on?
Also, how do you connect to a server with the build in the first post?

Re: Mutate and AI

PostPosted: 20 Dec 2020, 15:41
by gp66
thefnitalian wrote:So what does that mean? Is the mutate code just being deprecated and not worked on?
Also, how do you connect to a server with the build in the first post?
Mutate has not been implemented as of yet for xmage.

The build in post #1 was me sharing a personal build. I am a coding newbie and wanted to learn Java and xmage code. Naively, i picked mutate as my first mechanic :oops: :D

I got busy at work and the devs updated a ton of code and I was unable to update to current version without a ton of errors. So, sadly, the build in post #1 is the last :(