It is currently 09 Jun 2025, 19:21
   
Text Size

Bug Reports (snapshot builds)

Post MTG Forge Related Programming Questions Here

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

Re: Bug Reports (snapshot builds)

Postby Hanmac » 17 Dec 2016, 05:36

Agetian wrote:
stormcat wrote::r32713
When AI plays Memory Jar, this message shown in log.

Memory Jar - [Couldn't add to stack, failed to target]- ~(Card Text)
This card is marked RemAIDeck, which means the AI currently does not know how to properly activate its ability (and when, too).
All sorts of weird stuff can happen when an AI tries to play a RemAIDeck card (depending on the exact card it can range from suboptimal and random use of the ability [the most usual scenario] to the complete inability to cast or activate the card or failing to specify legal targets and other stuff).

- Agetian
Hm I will look at it what went wrong, because Memory Jar does not use target, so i wonder where the error comes from.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Bug Reports (snapshot builds)

Postby Agetian » 17 Dec 2016, 06:27

Hanmac wrote:Hm I will look at it what went wrong, because Memory Jar does not use target, so i wonder where the error comes from.
By the look of things the issue is in ChangeZoneAllAi.java:137-140 which implies that from the AI standpoint the ChangeZoneAll effect must have a target (the AI will try setting a target even if ChangeZoneAllAi does not use targeting). If we add an additional condition to the "if" line there (sa.usesTargeting()), then the AI stops using Memory Jar altogether since there is no logic coded for that ("return false"). Should we make it that way for now to avoid the said error in the log?

Speaking of targeting errors, still can't crack Declaration in Stone AI mistargeting :/ That one bothers me a bit more since it happens commonly but randomly (seemingly without a way to consistently recreate the conditions) on a card that the AI is supposed to know how to play... :(

- Agetian
Last edited by Agetian on 17 Dec 2016, 10:11, edited 2 times in total.
Agetian
Programmer
 
Posts: 3487
Joined: 14 Mar 2011, 05:58
Has thanked: 683 times
Been thanked: 569 times

Re: Bug Reports (snapshot builds)

Postby Marek14 » 17 Dec 2016, 09:58

Hanmac wrote:@Marek14: I suspect something, can you please check if it works before r32705?
Hm, the previous versions are no longer at the krazyweb, where I get them from. I could try with the release version, maybe...
Marek14
Tester
 
Posts: 2772
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 302 times

Re: Bug Reports (snapshot builds)

Postby friarsol » 17 Dec 2016, 13:55

Agetian wrote:
Hanmac wrote:Hm I will look at it what went wrong, because Memory Jar does not use target, so i wonder where the error comes from.
By the look of things the issue is in ChangeZoneAllAi.java:137-140 which implies that from the AI standpoint the ChangeZoneAll effect must have a target (the AI will try setting a target even if ChangeZoneAllAi does not use targeting). If we add an additional condition to the "if" line there (sa.usesTargeting()), then the AI stops using Memory Jar altogether since there is no logic coded for that ("return false"). Should we make it that way for now to avoid the said error in the log?
Yea that's fine. The card is already marked for the AI not to play it. Saying "I don't want to play this" in correlation with that makes more sense than just forcing it through the steps incorrectly.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Bug Reports (snapshot builds)

Postby Agetian » 17 Dec 2016, 14:17

friarsol wrote:
Agetian wrote:
Hanmac wrote:Hm I will look at it what went wrong, because Memory Jar does not use target, so i wonder where the error comes from.
By the look of things the issue is in ChangeZoneAllAi.java:137-140 which implies that from the AI standpoint the ChangeZoneAll effect must have a target (the AI will try setting a target even if ChangeZoneAllAi does not use targeting). If we add an additional condition to the "if" line there (sa.usesTargeting()), then the AI stops using Memory Jar altogether since there is no logic coded for that ("return false"). Should we make it that way for now to avoid the said error in the log?
Yea that's fine. The card is already marked for the AI not to play it. Saying "I don't want to play this" in correlation with that makes more sense than just forcing it through the steps incorrectly.
kk, committed the relevant change.
I went through all the cards that have AB/SP ChangeZoneAll in them with "Origin = Hand" or "Origin = Library" and most of them are marked as RemAIDeck, but there is one that wasn't marked so (Paradigm Shift). I tried it (in the AI's hands) and it has the same issue as other similar cards, so I marked it RemAIDeck for now.

EDIT: Ok, I committed what I think is a better idea for now. Now, the AI will simply play the non-targeted ChangeZoneAll ability if it's encountered without trying to target it (thus, not falling into an erroneous misplay). This allows Paradigm Shift to stay RemRandomDeck only (without the necessity to add RemAIDeck), as well as opens up the potential for having future ChangeZoneAll cards that the AI can play without having to worry about targets, while all the other currently RemAIDeck cards (Memory Jar, Timetwister, etc.) will at least be properly played (go on stack and resolve) if ever attempted by the AI (I know that there are some specially tweaked quest decks that utilize some RemAIDeck cards), and the RemAIDeck warning is still there to warn those people who want to place those cards in the AI's virtual hands.

- Agetian
Agetian
Programmer
 
Posts: 3487
Joined: 14 Mar 2011, 05:58
Has thanked: 683 times
Been thanked: 569 times

Re: Bug Reports (snapshot builds)

Postby Agetian » 17 Dec 2016, 15:03

Alright, I was able to come up with a test case that showcases the issue with AI targeting Declaration in Stone in a reproducible way:

Code: Select all
humanlife=20
ailife=20
activeplayer=ai
activephase=MAIN1
humancardsinhand=Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone
humancardsinlibrary=Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone
humancardsingraveyard=Declaration in Stone
humancardsinplay=t:Clue,P:0,T:0,Cost:no cost,Types:Artifact-Clue,Keywords:,Image:c_clue2;t:Clue,P:0,T:0,Cost:no cost,Types:Artifact-Clue,Keywords:,Image:c_clue3;t:Clue,P:0,T:0,Cost:no cost,Types:Artifact-Clue,Keywords:,Image:c_clue;Llanowar Elves|SummonSick:True;Elvish Mystic|SummonSick:True
humancardsinexile=Llanowar Elves;Llanowar Elves;Elvish Mystic
humancardsincommand=
aicardsinhand=Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone
aicardsinlibrary=Declaration in Stone;Declaration in Stone;Declaration in Stone;Declaration in Stone
aicardsingraveyard=Declaration in Stone;Declaration in Stone
aicardsinplay=Plains|Tapped:True;Plains|Tapped:True
aicardsinexile=
aicardsincommand=
To see the problem, load this test case, then start skipping turns. The first time AI attempts a Declaration in Stone, it'll be successful. However, all the subsequent Declarations (on subsequent turns) will fail with a targeting error.

EDIT: Looks like resetting targets of the SA makes this work correctly (committed as r32729). Considering this fixed for now.

- Agetian
Last edited by Agetian on 17 Dec 2016, 16:22, edited 1 time in total.
Agetian
Programmer
 
Posts: 3487
Joined: 14 Mar 2011, 05:58
Has thanked: 683 times
Been thanked: 569 times

Re: Bug Reports (snapshot builds)

Postby Agetian » 17 Dec 2016, 15:37

Something is still wrong with PutCounter AI where the AI is allowed to divide a certain number of counters among several targets. A classic example is Abzan Charm in the "put counter" mode. First of all, the AI will now only ever target one creature (instead of choosing several creatures from time to time as it used to do before), but the bigger problem is that sometimes the AI will only place one counter on one creature and that's it. I'm assuming that it "wants" to target two creatures and put one counter on each, but for some reason it's only targeting one creature and putting one counter on it. :/

What's interesting is that targets are apparently filled correctly (counter division and all) in CounterPutAi::canPlayAI (two targets specified with one counter each), but then at some point later the AI changes that somehow to only one target with one counter. Here's a test case:

Code: Select all
humanlife=4
ailife=20
activeplayer=ai
activephase=UPKEEP
humancardsinhand=Abzan Charm;Abzan Charm;Abzan Charm;Abzan Charm;Abzan Charm;Abzan Charm;Abzan Charm
humancardsinlibrary=Abzan Charm;Abzan Charm;Abzan Charm
humancardsingraveyard=
humancardsinplay=
humancardsinexile=
humancardsincommand=
aicardsinhand=Abzan Charm;Abzan Charm;Abzan Charm;Abzan Charm;Abzan Charm;Abzan Charm;Abzan Charm;Abzan Charm
aicardsinlibrary=Abzan Charm;Abzan Charm;Abzan Charm
aicardsingraveyard=Raise the Alarm
aicardsinplay=t:Soldier,P:1,T:1,Cost:no cost,Types:Creature-Soldier,Keywords:,Image:w_1_1_soldier_m15;t:Soldier,P:1,T:1,Cost:no cost,Types:Creature-Soldier,Keywords:,Image:w_1_1_soldier_m15;Swamp;Plains;Forest;Courser of Kruphix
aicardsinexile=
aicardsincommand=
EDIT: Ok, this apparently results from the fact that when the game tries to clone the Abzan Charm PutCounter subability for the purpose of chaining the abilities to AF Charm, it calls setTargetCard after calling setTargets, thus forgetting all the targets beyond the first (since setTargetCard overwrites targets). I reordered that (calling setTargets last) and that seems to work fine, but once again, please double-check and update as/if necessary (r32730).

- Agetian
Agetian
Programmer
 
Posts: 3487
Joined: 14 Mar 2011, 05:58
Has thanked: 683 times
Been thanked: 569 times

Re: Bug Reports (snapshot builds)

Postby Agetian » 17 Dec 2016, 18:28

For some reason, cards like Aurification and Curse of Stalked Prey do not work. The trigger goes on stack but the counter is not put on the creature.

Quite a good number of cards appears to be affected, for example, Dissipation Field does not work either (basically anything that tries to reference a TriggeredSource from a trigger, it seems).

- Agetian
Agetian
Programmer
 
Posts: 3487
Joined: 14 Mar 2011, 05:58
Has thanked: 683 times
Been thanked: 569 times

Re: Bug Reports (snapshot builds)

Postby Ldcs8T4EAnj8h5ZMD8rf » 17 Dec 2016, 19:13

Agetian wrote:
P.S. It looks like it *may* in fact be some kind of a threading issue (a race condition of some sort?) since sometimes when I get those alt. win condition achievements in my testing, the game would sometimes hang (lock up) completely while awarding the achievements to me, and at other times it would work fine.

- Agetian
I have also had the application hang on the alt. win achievements but I have not experienced it since 1.5.55. (I am on OS X.)

Next bug: I found a missing targeting arc in r32704. Felidar Sovereign is blocking my Endless One but there is no targeting arc. I believe it may be due to Vigilance as I have seen this occur in 32704 with both Felidar Sovereign and Ghostly Sentinel but not with creatures lacking Vigilance.
Attachments
targeting arcs.tif
Ldcs8T4EAnj8h5ZMD8rf
 
Posts: 36
Joined: 13 Nov 2015, 15:36
Has thanked: 1 time
Been thanked: 2 times

Re: Bug Reports (snapshot builds)

Postby Hanmac » 17 Dec 2016, 20:14

@Ldcs8T4EAnj8h5ZMD8rf: check in the config if the Arcs are all enabled.

also can you please not use TIF as format? PNG is much better.

preview doesn't work in the forum, and on my phone it didn't open at all.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Bug Reports (snapshot builds)

Postby Marek14 » 18 Dec 2016, 14:44

Opponent's Ronin Warclub triggered on a creature I pulled out from his graveyard with the ultimate of Liliana Vess.
Marek14
Tester
 
Posts: 2772
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 302 times

Re: Bug Reports (snapshot builds)

Postby Hanmac » 18 Dec 2016, 14:57

Marek14 wrote:Ronin Warclub triggered on a creature I pulled out from opponent's graveyard with the ultimate of Liliana Vess.
Isn't that as it should? A creature enters the battlefield under your control.

Edit: Oh now it makes more sense xD
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Bug Reports (snapshot builds)

Postby Agetian » 18 Dec 2016, 15:18

Marek14 wrote:Opponent's Ronin Warclub triggered on a creature I pulled out from his graveyard with the ultimate of Liliana Vess.
Hmm, what was the creature it triggered on? I just tried this (Wrath of God'ed a bunch of crap on both sides of the battlefield, then ultimated Liliana Vess while Ronin Warclub was on the opponent's side of the battlefield). All creatures ETBed on my side of the battlefield, but opponent's Ronin Warclub did not trigger.

- Agetian
Agetian
Programmer
 
Posts: 3487
Joined: 14 Mar 2011, 05:58
Has thanked: 683 times
Been thanked: 569 times

Re: Bug Reports (snapshot builds)

Postby rikimbo » 18 Dec 2016, 16:58

The triggered ability for Reyhan, Last of the Abzan doesn't work properly in r32739. It doesn't fire because the destination zone for the triggered ability is set to "Graveyard,Command". Currently the "Destination" parameter doesn't accept a list; it only accepts a single zone or "Any". The test to check whether the trigger should fire never matches "Graveyard,Command" to any zone.

A possible solution is modifying TriggerChangesZone's performTest() method so that the "Destination" test iterates over each item in comma separated list (similar to the "ExcludedDestinations" test). This is semantically a little inconsistent (singular "Destination" versus plural "ExcludedDestinations") but it'll work...

An alternate solution that doesn't require any engine changes is modifying Reyhan's card script to split the triggered ability into two abilities. Each one would be identical except for one's Destination being set to Graveyard and the other set to Command.
User avatar
rikimbo
 
Posts: 52
Joined: 25 Mar 2014, 14:15
Location: Winnipeg
Has thanked: 10 times
Been thanked: 7 times

Re: Bug Reports (snapshot builds)

Postby Agetian » 18 Dec 2016, 18:46

rikimbo wrote:The triggered ability for Reyhan, Last of the Abzan doesn't work properly in r32739. It doesn't fire because the destination zone for the triggered ability is set to "Graveyard,Command". Currently the "Destination" parameter doesn't accept a list; it only accepts a single zone or "Any". The test to check whether the trigger should fire never matches "Graveyard,Command" to any zone.

A possible solution is modifying TriggerChangesZone's performTest() method so that the "Destination" test iterates over each item in comma separated list (similar to the "ExcludedDestinations" test). This is semantically a little inconsistent (singular "Destination" versus plural "ExcludedDestinations") but it'll work...

An alternate solution that doesn't require any engine changes is modifying Reyhan's card script to split the triggered ability into two abilities. Each one would be identical except for one's Destination being set to Graveyard and the other set to Command.
Fixed (r32740).

- Agetian
Agetian
Programmer
 
Posts: 3487
Joined: 14 Mar 2011, 05:58
Has thanked: 683 times
Been thanked: 569 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 57 guests


Who is online

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

Login Form