It is currently 24 Aug 2025, 22:28
   
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 » 29 Apr 2016, 07:19

r31160:
Enemy does control Endless Whispers, when creatures die, the Trigger does trigger twice.
i don't know why does happen, i try to investigate that.
===
i found the culprit which does prevent the Gitrog Monster from triggering when lands are sacrificed or discarded.
it's the "OncePerEffect" thing that does prevent it (probably because the Discard and Sacrifice Trigger does block the ChangeZone Trigger)
but i don't know how to fix that without rewriting the SpellAbilityStackInstance
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Bug Reports (snapshot builds)

Postby friarsol » 29 Apr 2016, 13:33

Hanmac wrote:r31160:
Enemy does control Endless Whispers, when creatures die, the Trigger does trigger twice.
i don't know why does happen, i try to investigate that.
===
i found the culprit which does prevent the Gitrog Monster from triggering when lands are sacrificed or discarded.
it's the "OncePerEffect" thing that does prevent it (probably because the Discard and Sacrifice Trigger does block the ChangeZone Trigger)
but i don't know how to fix that without rewriting the SpellAbilityStackInstance
Rewriting StackInstances wouldn't help either. I looked into it when it was first reported. The issue is that costs trigger before the StackInstance even exists. The other triggers don't block this trigger, it's that the information "OncePerEffect" looks for isn't written to the triggers run params when costs are paid because they aren't available. I'm not even sure who wrote the OncePerEffect, but it's fairly flawed in this manner.
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 Hanmac » 29 Apr 2016, 13:48

hm you might be right, its SpellAbilityStackInstance didn't exist yet and that's why "si != null" does fail

my test was only to remove "OncePerEffect" and all the trigger does work.
but yeah i also have no idea how to do it better ...

PS: i am currently trying to add more stuff to the AI of Sin Ponder (like when its a bad idea to send cards to the graveyard)
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Bug Reports (snapshot builds)

Postby jje4th » 29 Apr 2016, 19:39

That's not the issue. The issue is the null check, which I assume was added to prevent a null-ref when calling si.attemptOncePerEffectTrigger. The stack does actually exist (it's null here because the caller isn't passing the whole stack, just the top through stack.peek). However, it is most commonly empty when evaluating discard because the discard is part of a cost. The simplest fix is to change the line to:
return si == null || si.attemptOncePerEffectTrigger(this.getHostCard());
which causes the ability to get triggered when the stack is empty as desired.

There is still a corner case where if there is a cost that requires discarding multiple cards, it will still trigger multiple times (since there still isn't anything on the stack). That scenario is far less common than the current situation.

I discovered this while trying to get Crawling Sensation to work (it's much trickier than it first appeared). I'll separate this into small fix.
jje4th
 
Posts: 18
Joined: 26 Dec 2014, 20:29
Has thanked: 0 time
Been thanked: 1 time

Re: Bug Reports (snapshot builds)

Postby friarsol » 29 Apr 2016, 20:31

jje4th wrote:There is still a corner case where if there is a cost that requires discarding multiple cards, it will still trigger multiple times (since there still isn't anything on the stack). That scenario is far less common than the current situation.
Yea any time there's any cost block that can send two lands to the graveyard (Discards, sacrifice, self-mill, etc) it won't be covered here. I was asking in mtgjudges, and it seems that there's a slight time change between the mana generation and the cost payment, so if you sacrifice a Dwarven Ruins for mana and need to discard a land for Magmatic Insight, you should still get two triggers.
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 Hanmac » 29 Apr 2016, 20:44

@jje4th thanks for that fix, i will investigate if there is a case where it does something wrong.
You need to test it with Geralf's Masterpiece because it can discard more lands as cost. i will test it too.

hey what do you guys think about the change i did for the AI of Sin Ponder?
i tried to make some Logic about what card are bad to mill (like cards that does trigger when they enter the graveyard from the library, or when other cards does that)
like Land with Gitrog or Creature with Sidisi
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Bug Reports (snapshot builds)

Postby jje4th » 29 Apr 2016, 23:34

It's definitely not completely fixed. Geralf's Masterpiece or any other cost that discards multiple lands will give you multiple triggers. I basically just reduced the surface area of the error. Instead of failing on all discard/mill event, it gives you multiple triggers when there are multiple discards/mills and the stack is empty.

The right fix will require keeping track of trigger state and determining if it already triggered from the current activated ability. The same type of tracking is needed for the triggers per turn restriction on crawling sensation. I've been looking at how to do that, but haven't figured it out yet.
jje4th
 
Posts: 18
Joined: 26 Dec 2014, 20:29
Has thanked: 0 time
Been thanked: 1 time

Re: Bug Reports (snapshot builds)

Postby jje4th » 30 Apr 2016, 05:41

Turns out making the Gitrog Monster work correctly with discard/mill is WAY more difficult than expected. It requires knowing the unique instance of the Spell Ability triggering the card entering the graveyard and putting that information into runParams on the ChangeZone trigger.

Adding a unique instance identifier to Spell Ability is rather straightforward (I think toUnsurpressedString + getNumberTurnActivations is unique). Getting that information in the runParams is quite difficult because there are a ton of method calls that move cards between zones for various purposes and most of them don't have access to the triggering SA. Fixing this looks to be a large amount of refactoring work.
jje4th
 
Posts: 18
Joined: 26 Dec 2014, 20:29
Has thanked: 0 time
Been thanked: 1 time

Re: Bug Reports (snapshot builds)

Postby Marek14 » 30 Apr 2016, 06:04

friarsol wrote:
jje4th wrote:There is still a corner case where if there is a cost that requires discarding multiple cards, it will still trigger multiple times (since there still isn't anything on the stack). That scenario is far less common than the current situation.
Yea any time there's any cost block that can send two lands to the graveyard (Discards, sacrifice, self-mill, etc) it won't be covered here. I was asking in mtgjudges, and it seems that there's a slight time change between the mana generation and the cost payment, so if you sacrifice a Dwarven Ruins for mana and need to discard a land for Magmatic Insight, you should still get two triggers.
What if you discard one land and mill another for Sinister Concoction?
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times

Re: Bug Reports (snapshot builds)

Postby VileTouch » 30 Apr 2016, 07:42

Description: When the AI takes control of Herald of War (+1 each attack) with Biting Tether (-1 each upkeep) the game doesn't know what to do with the counter.

The first upkeep works as intended (-1) because of summoning sickness. problem starts when HoW gets a +1 from attacking.

Suggested course of action: The number of counters needs to be saved per card and only be written to when it is going to be changed. once. instead of being constantly recalculated (every frame?).
this would also avoid flickering power/toughness on heavy load situations.

IndexOutOfBoundsException | Open
Code: Select all
Forge Version:    1.5.52-SNAPSHOT-r31168
Operating System: Windows 10 10.0 amd64
Java Version:     1.8.0_91 Oracle Corporation

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   at java.util.LinkedList.checkElementIndex(Unknown Source)
   at java.util.LinkedList.get(Unknown Source)
   at forge.util.collect.FCollection.get(FCollection.java:395)
   at forge.game.ability.effects.CountersMoveEffect.getStackDescription(CountersMoveEffect.java:45)
   at forge.game.ability.SpellAbilityEffect.getStackDescriptionWithSubs(SpellAbilityEffect.java:75)
   at forge.game.spellability.AbilitySub.getStackDescription(AbilitySub.java:114)
   at forge.game.ability.SpellAbilityEffect.getStackDescriptionWithSubs(SpellAbilityEffect.java:85)
   at forge.game.ability.AbilityApiBased.getStackDescription(AbilityApiBased.java:41)
   at forge.game.spellability.SpellAbilityStackInstance.<init>(SpellAbilityStackInstance.java:103)
   at forge.game.zone.MagicStack.push(MagicStack.java:447)
   at forge.game.zone.MagicStack.add(MagicStack.java:317)
   at forge.game.zone.MagicStack.addAndUnfreeze(MagicStack.java:153)
   at forge.ai.ComputerUtil.handlePlayingSpellAbility(ComputerUtil.java:112)
   at forge.ai.PlayerControllerAi.playChosenSpellAbility(PlayerControllerAi.java:401)
   at forge.game.phase.PhaseHandler.startFirstTurn(PhaseHandler.java:957)
   at forge.game.GameAction.startGame(GameAction.java:1479)
   at forge.game.Match.startGame(Match.java:95)
   at forge.match.HostedMatch$2.run(HostedMatch.java:220)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
"He traded sand for skins, skins for gold, gold for life. In the end, he traded life for sand." - Afari, Tales
User avatar
VileTouch
 
Posts: 33
Joined: 04 Apr 2016, 10:39
Has thanked: 10 times
Been thanked: 2 times

Re: Bug Reports (snapshot builds)

Postby VileTouch » 30 Apr 2016, 08:13

some cards, like Serene Steward force their activation every time the conditions are met.
if you gain life, you are forced to pick a creature from the battlefield, even if you cannot pay the cost or you simply do not want to spend mana on it this turn. (i suppose if there are no creatures to pick, the game would either lock up or crash)

Dawn to Dusk forces you to pick both actions even if there are no valid cards to pick either on the graveyard or the battlefield. sometimes it would refuse to pick an aura and just bounce in place with no feedback

In some strange cases, destroyed creatures will refuse to be returned to the battlefield (Reya Dawnbringer, Emeria, the Sky Ruin, Emeria Shepherd, Breath of Life, etc.)but would happily return to the hand... only to land again in the graveyard when cast again.

Archangel of Thune is "suspect" of giving two +1 counters to creatures instead of one when gaining life from sources other than LifeLink (such as Auriok Champion OR Suture Priest)

Rhox Faithmender not only doubles life gained, but "depending on it's mood" would sometimes triple or quadruple. the buff is not consistent (not that i'm complaining if it's on my side, lol)
"He traded sand for skins, skins for gold, gold for life. In the end, he traded life for sand." - Afari, Tales
User avatar
VileTouch
 
Posts: 33
Joined: 04 Apr 2016, 10:39
Has thanked: 10 times
Been thanked: 2 times

Re: Bug Reports (snapshot builds)

Postby Hanmac » 30 Apr 2016, 08:40

Serene Steward is right that way, you do target a creature, even if you do not pay the cost.
that is important for other cards that does react to targeting like Willbreaker.

about the creatures which are not returned, what are they? are they transformed creatures or other things?

Rhox Faithmender does work for me like it should, two of them does 4x.
or have you another case where it does wrong?
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Bug Reports (snapshot builds)

Postby friarsol » 30 Apr 2016, 17:44

VileTouch wrote:Description: When the AI takes control of Herald of War (+1 each attack) with Biting Tether (-1 each upkeep) the game doesn't know what to do with the counter.

The first upkeep works as intended (-1) because of summoning sickness. problem starts when HoW gets a +1 from attacking.
I don't really understand what you mean. As a state based action, if a permanent has both +1/+1 counters and -1/-1 counters 1 of each is removed until there is only one type of those two counters remain.
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 VileTouch » 30 Apr 2016, 18:07

Hanmac wrote:Serene Steward is right that way, you do target a creature, even if you do not pay the cost.
that is important for other cards that does react to targeting like Willbreaker.
okay, let me rephrase that. the oracle is very specific:
Whenever you gain life, you may pay {W}. (may, optional)
IF you do (and only if you do), put a +1/+1 counter on target creature
in Forge you must pick a creature first every time you gain life.(it will not let you proceed without making a selection) and then it prompts you to pay (ok, cancel).

regarding Willbreaker, there's this:
109.2. If a spell or ability uses a description of an object that includes a card type or subtype, but doesn’t include the word “card,” “spell,” “source,” or “scheme,” it means a permanent of that card type or subtype on the battlefield.
in other words,it should only target creature permanents(on the battlefield) after their ability has resolved, it shouldn't pick them directly from the stack (such as activating Throwing Knife and not sacrificing it).
I am aware that this is how it works in MTGO, but that is a bug on their side as that's not how it works in paper Magic.

and finally a quote saying pretty much the same i just did
Rules advisor here; it's a bug. Willbreaker can't gain control of a creature spell on the stack for the same reason you can't use Unsummon or Vapor Snag on a creature on the stack. "Creature" means a creature permanent on the battlefield. When a creature is on the stack, it will be referred to as a creature spell, like in Bone to Ash. In someone's hand, library, graveyard, or exile, it's a creature card. See Gravedigger or Ostracize for an example of that.
Hanmac wrote:about the creatures which are not returned, what are they? are they transformed creatures or other things?
in this case it was Ajani's Pridemate, Auriok Champion and Abzan Battle Priest. Ajani's Pridemate had been exiled and was "returned" to the graveyard with Pull from Eternity. the return to the battlefield would work (evidenced by Cathars' Crusade activation), but would just bounce back to the graveyard, even if returned to the hand.

Hanmac wrote:Rhox Faithmender does work for me like it should, two of them does 4x.
or have you another case where it does wrong?
as i said, it's not consistent, like Archangel of Thune. they both start out well, but then start giving slightly inaccurate results (the kind a rounding error would look like)
Last edited by VileTouch on 01 May 2016, 00:01, edited 1 time in total.
"He traded sand for skins, skins for gold, gold for life. In the end, he traded life for sand." - Afari, Tales
User avatar
VileTouch
 
Posts: 33
Joined: 04 Apr 2016, 10:39
Has thanked: 10 times
Been thanked: 2 times

Re: Bug Reports (snapshot builds)

Postby Hanmac » 30 Apr 2016, 19:36

about Willbreaker i didn't say about the stack

i used Serene Steward in a combo with Willbreaker because when i target a creature with Serene Steward, i get control of the creature.

its true for Throwing Knife, it does target, even if you do not activate its effect.
true for other cards like Frenzied Goblin and Haazda Snare Squad

Rulings of Haazda Snare Squad:
4/15/2013: You choose the target creature when the ability triggers and goes on the stack. You choose whether to pay {W} when that ability resolves. You may pay {W} only once. The creature will be tapped before blockers are chosen.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 31 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 31 users online :: 0 registered, 0 hidden and 31 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 31 guests

Login Form