It is currently 25 Aug 2025, 22:58
   
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 friarsol » 30 Apr 2016, 20:24

VileTouch wrote: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.
I don't see anyone talking about creature spells, so I'm not sure why you are bringing it up below this quote. The reason things work differently in paper magic is because people take shortcuts in paper magic. You can do things like ignore optional triggers, even though technically your opponent can force you to choose a target to properly maintain board state. If the Serene Steward has Shroud and the only other creature is a Skulking Ghost, your opponent IS forced to target it with the trigger. It's not a bug in MTGO and it's not a bug in Forge. Your original quote suggested Forge would crash if there aren't any targets, but that's not true. If there are no legal targets, the trigger can not successfully go on the stack, so it doesn't.
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 friarsol » 30 Apr 2016, 20:31

Marek14 wrote:What if you discard one land and mill another for Sinister Concoction?
Yea I was asking about that in the mtgjudges rules chat. The judge didn't seem 100% positive when I asked about Dreamscape Artist and The Gitrog Monster, but came to the conclusion that all of the costs are paid at the same time (even though the mana is generated slightly earlier), so you would only get one trigger. I'll see if I can ask in a few other places to see what answers I can get.
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 rigged » 30 Apr 2016, 20:53

Description: just started a new match and quickly clicked exit game...

ConcurrentModificationException | Open
Code: Select all
Forge Version:    1.5.52-SNAPSHOT-r31177
Operating System: Windows 7 6.1 amd64
Java Version:     1.8.0_77 Oracle Corporation

java.util.ConcurrentModificationException
   at java.util.LinkedList$ListItr.checkForComodification(Unknown Source)
   at java.util.LinkedList$ListItr.next(Unknown Source)
   at forge.util.Visitor.visitAll(Visitor.java:7)
   at forge.game.Game.forEachCardInGame(Game.java:491)
   at forge.game.trigger.TriggerHandler.cleanUpTemporaryTriggers(TriggerHandler.java:61)
   at forge.game.GameAction.checkStaticAbilities(GameAction.java:619)
   at forge.game.GameAction.checkStaticAbilities(GameAction.java:607)
   at forge.game.GameAction.changeZone(GameAction.java:279)
   at forge.game.GameAction.moveToLibrary(GameAction.java:558)
   at forge.game.GameAction.moveToLibrary(GameAction.java:550)
   at forge.game.player.Player.scry(Player.java:1196)
   at forge.game.GameAction.performMulligans(GameAction.java:1631)
   at forge.game.GameAction.startGame(GameAction.java:1461)
   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)
rigged
 
Posts: 56
Joined: 16 Feb 2010, 10:26
Has thanked: 3 times
Been thanked: 2 times

Re: Bug Reports (snapshot builds)

Postby VileTouch » 30 Apr 2016, 22:57

friarsol wrote: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.
that's what i expected to happen as well, however, looking at the stack trace posted above,
Code: Select all
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Biting Tether appears to lose track of that variable when Herald of War modifies it...or viceversa
"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 friarsol » 30 Apr 2016, 23:38

VileTouch wrote:
friarsol wrote: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.
that's what i expected to happen as well, however, looking at the stack trace posted above,
Code: Select all
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Biting Tether appears to lose track of that variable when Herald of War modifies it...or viceversa
I'm looking at the stack trace.. but it's coming from "CountersMoveEffect.getStackDescription(CountersMoveEffect.java:45)", neither Herald of War nor Biting Tether would use this effect. Any idea what the AI was trying to cast (or even have the decklist)? I'll wrap this stack description with exception handling, so we can try to figure out what's causing it, and fix the AI.
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, 23:53

friarsol wrote:I don't see anyone talking about creature spells, so I'm not sure why you are bringing it up below this quote.
oh, it was related to Willbreaker and wether it should proc before the targetting ability has activated (and has been paid for)...unless the card says target before it says pay (can't think of any atm) #-o
edit: oh, of course, it doesn't allow to steal a creature that has not "landed" yet with a counter.


friarsol wrote:The reason things work differently in paper magic is because people take shortcuts in paper magic. You can do things like ignore optional triggers, even though technically your opponent can force you to choose a target to properly maintain board state.
fair enough. i understand that, except in this case the card says pay, before it says target :)

friarsol wrote:If the Serene Steward has Shroud and the only other creature is a Skulking Ghost, your opponent IS forced to target it with the trigger. It's not a bug in MTGO and it's not a bug in Forge.
aha!. so what would be the order of the stack in such scenario?
Player gains 1 life > (Serene Steward Triggers)Pay {W} to activate this? (again, based on the order of the oracle) > if {W} is paid, choose a creature (else return) > Serene Steward targets Skulking Ghost > Skulking Ghost gets +1/+1 (thus triggering cards like Gladehart Cavalry) > bury Skulking Ghost (with it's +1/+1 counter!) > Gladehart Cavalry gives player 2 life

friarsol wrote:Your original quote suggested Forge would crash if there aren't any targets, but that's not true. If there are no legal targets, the trigger can not successfully go on the stack, so it doesn't.
good. i didn't have the chance to test that, so it was an assumption. given that you cannot proceed without choosing something.
Last edited by VileTouch on 01 May 2016, 00:21, 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 friarsol » 01 May 2016, 00:18

VileTouch wrote:aha!. so what would be the order of the stack in such scenario?
Player gains 1 life > (Serene Steward Triggers)Pay {W} to activate this? (again, based on the order of the oracle) > if {W} is paid, choose a creature (else return) > Serene Steward targets Skulking Ghost > Skulking Ghost gets +1/+1 (thus triggering cards like Gladehart Cavalry) > bury Skulking Ghost (with it's +1/+1 counter!) > Gladehart Cavalry gives player 2 life
Be careful with your terminology here. There's no "activation", it's a triggered ability, not an activated one.

Trigger payments occur during resolution, unlike activated ability payment which occur before a spell hits the stack.

So we have:

0) You gain 1 life (from something that doesn't matter).
1) Serene Steward triggers, targeting the only legal target - Skulking Ghost.
2) With the SS trigger on the stack, Skulking Ghost now triggers since it's AFRAID OF BEING LOOKED AT. :)
3) Both players pass priority, SG is sacrificed as it's trigger resolves.
4) Both players pass priority, SS trigger fizzles, since it's target is illegal (Ghost is no longer on the Battlefield)

In a case where the SS target is still on the Battlefield as it's trigger resolves, the user is asked to pay {W} now, and you can say no.

I believe Hanmac brought Willbreaker up because it's a similar scenario:

0) You have a Serene Steward and Willbreaker on the battlefield. And gain 1 life (again, doesn't matter)
1) Serene Steward triggers, you choose an opposing creature and put the SS trigger on the stack.
2) Your Willbreaker triggers since a (triggered) ability you control has targeted an opposing creature.
3) Both players pass priority, Willbreaker trigger resolves, you gain control of your opponents.. Siege Rhino.
4) Both players pass priority, SS trigger starts resolving, you can choose to pay {W} or not, but either way it won't affect the Willbreaker trigger. If you have the mana, I hear 5/6 Rhinos are pretty good.

Make sense?
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 » 01 May 2016, 01:07

friarsol wrote:Make sense?
Image

unlike activated ability payment which occur before a spell hits the stack.
i think that's the core of my argument. i meant to say that what goes on the stack is the choice to activate it or not(as per your definition)...by paying. after that step is resolved, then you can target.
"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 friarsol » 01 May 2016, 01:34

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 Marek14 » 01 May 2016, 05:52

VileTouch wrote:
unlike activated ability payment which occur before a spell hits the stack.
i think that's the core of my argument. i meant to say that what goes on the stack is the choice to activate it or not(as per your definition)...by paying. after that step is resolved, then you can target.
Yes, but it is wrong.
Triggered ability goes on stack, and then it resolves. Targets are always selected when a spell or ability is announced, before it goes on stack. If the word "target" is mentioned after the cost, that is completely irrelevant.

Some cards where new players might be tempted to choose the target too late (like Riddle of Lightning) have clearer wording that emphasises that you are supposed to choose the target first, however triggered abilities with optional payments don't have this wording.
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times

Re: Bug Reports (snapshot builds)

Postby jje4th » 01 May 2016, 07:20

I have a fix for The Gitrog Monster, but it feels a bit hacky. I added source SpellAbility instance tracking for ChangeZone triggers created by moving cards to the graveyard. For all other zone changes this value will be null.

Eventually, this information should be tracked for all zone moves (then the existing SpellAbilityStackInstance workaround could be removed) and ideally all triggers. That's why I chose to add the instance tracking to the base Trigger object. However, implementing the tracking for all triggers feels too large a scope for a single change.

I'd like to get opinions from the more seasoned developers on whether this change is reasonable. The patch is attached.
Attachments
GitrogMonsterFix.txt
Fix for single instanceing triggers on cost payment. (change .txt to .patch)
(20.1 KiB) Downloaded 245 times
jje4th
 
Posts: 18
Joined: 26 Dec 2014, 20:29
Has thanked: 0 time
Been thanked: 1 time

Re: Bug Reports (snapshot builds)

Postby friarsol » 01 May 2016, 12:45

Here's the exact rule -

603.5. Some triggered abilities’ effects are optional (they contain “may,” as in “At the beginning of your upkeep, you may draw a card”). These abilities go on the stack when they trigger, regardless of whether their controller intends to exercise the ability’s option or not. The choice is made when the ability resolves. Likewise, triggered abilities that have an effect “unless” something is true or a player chooses to do something will go on the stack normally; the “unless” part of the ability is dealt with when the ability resolves. #

The cost is not a prerequisite for the trigger, it's an option for the effect as it resolves.
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 » 01 May 2016, 18:03

friarsol wrote:Here's the exact rule -

603.5. Some triggered abilities’ effects are optional (they contain “may,” as in “At the beginning of your upkeep, you may draw a card”). These abilities go on the stack when they trigger, regardless of whether their controller intends to exercise the ability’s option or not. The choice is made when the ability resolves. Likewise, triggered abilities that have an effect “unless” something is true or a player chooses to do something will go on the stack normally; the “unless” part of the ability is dealt with when the ability resolves. #

The cost is not a prerequisite for the trigger, it's an option for the effect as it resolves.
thanks, friasol, yes, i found that rule yesterday. as it completely collided with the way me and everyone i've played before (for years!), seemed completely outlandish.(then confirmed by a number of comments) it led me to believe that this was the general concensus, specially the one stating it was a bug...i was genuinely convinced this was the case. while i still don't like 603.5, specially:
regardless of whether their controller intends to exercise the ability’s option or not
, I guess it makes my whole argument invalid.
thanks again for enlightening me.
"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 friarsol » 01 May 2016, 18:38

VileTouch wrote: while i still don't like 603.5, specially:
regardless of whether their controller intends to exercise the ability’s option or not
, I guess it makes my whole argument invalid.
The main thing is that in paper magic, you aren't necessarily playing wrong unless there's something out there that cares about that aspect of the rules. That's the nice thing about shortcuts, it speeds up the arduous process of slogging through the rules. There was actually a huge to-do semi-recently about missed triggers for certain levels of competitive Magic. One aspect of it pretty much boiled down to "If you forget to announce an optional trigger, it is assumed you declined the option." which it sounds like is exactly what you and your friends are doing (with perhaps a little more intent).

When you have software following rules, you pretty much HAVE to be as strict as possible, so things will work. This does lead to some clunkiness like forcing targets for triggers that will never be optioned. I'm sure I'm not the only developer who has tried to think of a way to streamline this so there aren't so many clicks. That's why things like right clicking on triggers for auto-yield, and auto-yes/no exist. In a similar vein, we might be able to have an auto-target option, which is a bit trickier since it would send things down the AI decision path, then need to verify if the targeting is legal, otherwise fallback to the Human choice. In the case of Serene Steward, doing X for the rest of the game probably isn't really what you want.


It miiiiight be solvable by having the target box look like this:

Select # target <valid game entity> for <Source Entity>:
{Suggested target: <Game Entity> (123)}

[Suggested] [Cancel]


The tricky part here is that second button in the targeting input is for accepting the targets when spells have a range of targets available to them. eg You can target up to 4 Creatures, but you only want to choose 2 of them. That probably means the "suggested" targeting would need to be unavailable as soon as you select the first legal target or the minimum number of targets is 0. For triggers that have mandatory targets, the cancel would be grayed out as usual.
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 friarsol » 01 May 2016, 21:57

jje4th wrote:I have a fix for The Gitrog Monster, but it feels a bit hacky. I added source SpellAbility instance tracking for ChangeZone triggers created by moving cards to the graveyard. For all other zone changes this value will be null.

Eventually, this information should be tracked for all zone moves (then the existing SpellAbilityStackInstance workaround could be removed) and ideally all triggers. That's why I chose to add the instance tracking to the base Trigger object. However, implementing the tracking for all triggers feels too large a scope for a single change.

I'd like to get opinions from the more seasoned developers on whether this change is reasonable. The patch is attached.
I'll try to take a look at this when I have some time. I wonder if a simpler way of handling things would just to create the StackInstance at the beginning of the process (when you first click on an entity) so its available for the waiting triggers for adding the reference to the right spot.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 18 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form