Bug Reports (snapshot builds)
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Bug Reports (snapshot builds)
by elcnesh » 28 Sep 2014, 14:04
Maybe it happened because you had a specific card in hand (as Trigger is card-specific) – were there any "weird" cards in your deck?Agetian wrote:r27727: Got an interesting NPE today during the very beginning of the game. Was pretty random, not sure what caused it to happen, but I think it happened immediately after I kept my hand. Had to restart the game to proceed. I restarted Forge and the next time I started the match there was no such exception anymore. :\
- elcnesh
- Posts: 290
- Joined: 16 May 2014, 15:11
- Location: Netherlands
- Has thanked: 34 times
- Been thanked: 92 times
Re: Bug Reports (snapshot builds)
by Agetian » 28 Sep 2014, 14:13
It was a random-generated deck and sadly it was too late for me to write down my hand because I closed the game already. Judging by the place it crashed in, it was probably some card that had an effect that triggered during the opponent's turn (possibly even from the opening hand?) Just for the fun of it I tried Leyline of the Void (the only card that came to mind that triggers from the opening hand) but it worked correctly. If it happens again I'll note down which cards were in my hand at the moment it crashed.elcnesh wrote:Maybe it happened because you had a specific card in hand (as Trigger is card-specific) – were there any "weird" cards in your deck?Agetian wrote:r27727: Got an interesting NPE today during the very beginning of the game. Was pretty random, not sure what caused it to happen, but I think it happened immediately after I kept my hand. Had to restart the game to proceed. I restarted Forge and the next time I started the match there was no such exception anymore. :\
- Agetian
- Agetian
- Programmer
- Posts: 3486
- Joined: 14 Mar 2011, 05:58
- Has thanked: 683 times
- Been thanked: 569 times
Re: Bug Reports (snapshot builds)
by Fizanko » 28 Sep 2014, 20:23
r27740
I encountered the same sound problem i noticed in r27575 , in which the counter sound is played at every phases within someone turn after you add counters.
For that case i'm playing the Tezzeret deck from Elspeth vs Tezzeret
At some point i played Contagion Clasp, and selected the AI Conclave Equenaut as the target of the -1/-1 count, the sound played, but then at each further press of OK/spacebar to change phase the counter sound is replayed again and again
And thanks to my Esperzoa being on the battlefield i can replay Contagion Clasp every turns, redoing the same sound repetition problem
I encountered the same sound problem i noticed in r27575 , in which the counter sound is played at every phases within someone turn after you add counters.
For that case i'm playing the Tezzeret deck from Elspeth vs Tezzeret
At some point i played Contagion Clasp, and selected the AI Conclave Equenaut as the target of the -1/-1 count, the sound played, but then at each further press of OK/spacebar to change phase the counter sound is replayed again and again
And thanks to my Esperzoa being on the battlefield i can replay Contagion Clasp every turns, redoing the same sound repetition problem
probably outdated by now so you should avoid : Innistrad world for Forge (updated 17/11/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
Re: Bug Reports (snapshot builds)
by elcnesh » 29 Sep 2014, 09:08
I think I found it – it's related to the AI checking whether it can pump the creature with counters, which involves copying it and placing counters on the copy (I know, it's weirdFizanko wrote:r27740
I encountered the same sound problem i noticed in r27575 , in which the counter sound is played at every phases within someone turn after you add counters.

- elcnesh
- Posts: 290
- Joined: 16 May 2014, 15:11
- Location: Netherlands
- Has thanked: 34 times
- Been thanked: 92 times
Re: Bug Reports (snapshot builds)
by Fizanko » 29 Sep 2014, 15:42
It seems to work, in r27744 i just played a few duels in which the AI had counters added to its creatures and the sounds haven't yet replayed.
On another note, not really a bug but related to the auto mana pay.
I have 3 island and Mishra's Factory
I play Steel Wall.
Instead of autopaying by using an island, the game use Mishra's Factory , preventing then me to use its abilities.
The auto-mana pay should always give tapping priority to regular lands (or at least lands without abilities), i think it should never tap a special land when there are still untapped regular ones that could be used instead, because many special lands may have abilities the player may want to use.
On another note, not really a bug but related to the auto mana pay.
I have 3 island and Mishra's Factory
I play Steel Wall.
Instead of autopaying by using an island, the game use Mishra's Factory , preventing then me to use its abilities.
The auto-mana pay should always give tapping priority to regular lands (or at least lands without abilities), i think it should never tap a special land when there are still untapped regular ones that could be used instead, because many special lands may have abilities the player may want to use.
probably outdated by now so you should avoid : Innistrad world for Forge (updated 17/11/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
Re: Bug Reports (snapshot builds)
by Fizanko » 29 Sep 2014, 21:32
r27746
I don't know if the flickering P/T display bug was fixed (and so in that case it's back) but in this situation :

I have Daring Skyjek with Guardian's Magemark on it and at every phase of my or the AI turn, the P/T flicker between 3/1 and 4/2
I don't know if the flickering P/T display bug was fixed (and so in that case it's back) but in this situation :

I have Daring Skyjek with Guardian's Magemark on it and at every phase of my or the AI turn, the P/T flicker between 3/1 and 4/2
probably outdated by now so you should avoid : Innistrad world for Forge (updated 17/11/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
Re: Bug Reports (snapshot builds)
by elcnesh » 29 Sep 2014, 21:53
Pff that flickering is really getting annoying... I really thought I fixed it, but it's hard to test when I can't reproduce it. Maybe someone else can have a look? I thought the problem was too many GameEventCardStatsChanged being fired, but it may also be another event that updates cards.
- elcnesh
- Posts: 290
- Joined: 16 May 2014, 15:11
- Location: Netherlands
- Has thanked: 34 times
- Been thanked: 92 times
Re: Bug Reports (snapshot builds)
by Deadpool » 29 Sep 2014, 22:00
Description: [KTK Draft Match - Used Sarkhan's ability to become a 4/4 dragon until end of turn. I had an Icy Blast in hand (thinking the Ferocious trigger my be related). When i passed the turn, this bug happened. Maybe having Ferocious and then not goofed it?]
- ConcurrentModificationException | Open
- Code: Select all
Forge Version: 1.5.28-SNAPSHOT-r-1u
Operating System: Windows 8.1 6.3 x86
Java Version: 1.7.0_67 Oracle Corporation
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
at java.util.ArrayList$Itr.next(Unknown Source)
at forge.game.card.Card.getLatestPT(Card.java:4019)
at forge.game.card.Card.getSetPower(Card.java:3990)
at forge.game.card.Card.getCurrentPower(Card.java:4078)
at forge.game.card.Card.getUnswitchedPower(Card.java:4094)
at forge.game.card.Card.getNetAttack(Card.java:4120)
at forge.view.ViewUtil.writeNonDependentCardViewProperties(ViewUtil.java:83)
at forge.view.LocalGameView.writeCardToView(LocalGameView.java:469)
at forge.view.LocalGameView.getCardView(LocalGameView.java:393)
at forge.view.LocalGameView$3.apply(LocalGameView.java:408)
at forge.view.LocalGameView$3.apply(LocalGameView.java:405)
at forge.view.ViewUtil.transformIfNotNull(ViewUtil.java:142)
at forge.view.LocalGameView.getCardViews(LocalGameView.java:413)
at forge.view.LocalGameView.getPlayerView(LocalGameView.java:351)
at forge.view.LocalGameView.getPlayerView(LocalGameView.java:323)
at forge.view.LocalGameView.getPlayerTurn(LocalGameView.java:213)
at forge.GuiDesktop.updatePhase(GuiDesktop.java:258)
at forge.control.FControlGameEventHandler$1.run(FControlGameEventHandler.java:88)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Re: Bug Reports (snapshot builds)
by Fizanko » 29 Sep 2014, 23:32
I can understand that, as i tried to build a deck withelcnesh wrote:Pff that flickering is really getting annoying... I really thought I fixed it, but it's hard to test when I can't reproduce it. Maybe someone else can have a look? I thought the problem was too many GameEventCardStatsChanged being fired, but it may also be another event that updates cards.
And play constructed with it vs the AI using it too.
As a result absolutely no P/T flickering.
The only difference i could see in the situation in which P/T was flickering at each phase is that there were some other cards that generate some visual effect :
the AI had an Amulet of Krog with a Living Artifact (generating counters)
I had a Soul Tithe applied to the AI Verduran Enchantress (generating an arrow)
And on my side a Glaring Spolight that have an effect on the battlefield by allowing to bypass hexproof (though no visual effect)
Maybe it's when there's too many effects happening along enchantement that the P/T start to flicker
probably outdated by now so you should avoid : Innistrad world for Forge (updated 17/11/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
Re: Bug Reports (snapshot builds)
by friarsol » 30 Sep 2014, 01:39
The TapXType cost is no longer cancellable (I believe it used to be). This means that if I click on my Opposition, and choose a target without realizing I only have one creature in play, then I'm forced to tap it. This should be an undoable cost.
Edit: The "Auto" mechanism fails to cast a Fact or Fiction when my only blue mana source is a Tainted Isle. The Auto is enabled, but it looks like it uses the Isle to pay for colorless instead of blue (not sure why it would ever pay for colorless instead of colored if it could).
Edit2: The Brainstorm UI is confusing. The Input panel says "Choose a card from your hand", but nothing actually happens when you select the first card (no "selected" icon on that card). Nothing happens until you click on a second card and they both are just whisked away to your library. I think an immediate redraw here would be sufficient.
Edit: The "Auto" mechanism fails to cast a Fact or Fiction when my only blue mana source is a Tainted Isle. The Auto is enabled, but it looks like it uses the Isle to pay for colorless instead of blue (not sure why it would ever pay for colorless instead of colored if it could).
Edit2: The Brainstorm UI is confusing. The Input panel says "Choose a card from your hand", but nothing actually happens when you select the first card (no "selected" icon on that card). Nothing happens until you click on a second card and they both are just whisked away to your library. I think an immediate redraw here would be sufficient.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Bug Reports (snapshot builds)
by Agetian » 30 Sep 2014, 03:47
I also noticed that the current Auto mechanism (read: AI mana tapping mechanism) can fail easily when trying to tap lands with more than one choice to pay mana cost. For instance, I played a variant of the Hexproof Bant deck and tried to cast Unflinching Courage on my creature using Breeding Pool, Sunpetal Grove and some other "two-mana" land (too bad I can't remember which one, since now I can't easily reproduce it - it was on mobile and I did not have anything to write the exact configuration of lands on). "Auto" was enabled and I hit it, which resulted in two of my lands becoming tapped and the third one (Breeding Pool, whe U/G one) did not get tapped and the prompt remained querying for white mana. It seems like it indeed does try to pay for colorless shards first in some cases for some stupid reason, which breaks it (and since the AI itself is getting the same considerations, I think it may break its mana payment logic in more than one case and render it impossible for the AI to cast spells which it can indeed cast). Basically, what happened was that the AI used Sunpetal Grove to pay either for green or for colorless, and that other land I had to pay either for green or for colorless, leaving Breeding Pool open but now unable to pay the white mana.friarsol wrote:Edit: The "Auto" mechanism fails to cast a Fact or Fiction when my only blue mana source is a Tainted Isle. The Auto is enabled, but it looks like it uses the Isle to pay for colorless instead of blue (not sure why it would ever pay for colorless instead of colored if it could).
- Agetian
Last edited by Agetian on 30 Sep 2014, 18:26, edited 1 time in total.
- Agetian
- Programmer
- Posts: 3486
- Joined: 14 Mar 2011, 05:58
- Has thanked: 683 times
- Been thanked: 569 times
Re: Bug Reports (snapshot builds)
by Agetian » 30 Sep 2014, 18:05
Description: r27757: I got this NPE again, immediately after keeping my hand (and could not continue the game afterwards). This time I diligently wrote down the contents of both my initial hand and the opponent's opening hand. I mulliganed to 6, then kept the following hand: Penumbra Spider, Pyromancer's Swath, Vedalken Shackles, Island, Narcomoeba, Island. The game crashed immediately after I pressed "Keep" and I was unable to continue playing. However, I was able to look at the opponent's hand using dev mode features, which was the following: Swamp, Plains, Path to Exile, Bound in Silence, Veteran Armorer, Swamp, Terramorphic Expanse.
- Agetian
- NullPointerException | Open
- Code: Select all
Forge Version: SVN
Operating System: Linux 3.8.0-26-generic amd64
Java Version: 1.7.0_51 Oracle Corporation
java.lang.NullPointerException
at forge.game.trigger.Trigger.phasesCheck(Trigger.java:181)
at forge.game.trigger.TriggerHandler.isTriggerActive(TriggerHandler.java:335)
at forge.game.trigger.TriggerHandler.resetActiveTriggers(TriggerHandler.java:179)
at forge.game.GameAction.checkStateEffects(GameAction.java:941)
at forge.game.GameAction.startGame(GameAction.java:1573)
at forge.game.Match.startGame(Match.java:81)
at forge.match.MatchUtil$2.run(MatchUtil.java:228)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
- Agetian
Last edited by Agetian on 30 Sep 2014, 18:46, edited 2 times in total.
- Agetian
- Programmer
- Posts: 3486
- Joined: 14 Mar 2011, 05:58
- Has thanked: 683 times
- Been thanked: 569 times
Re: Bug Reports (snapshot builds)
by friarsol » 30 Sep 2014, 18:44
Looks like Phase.getPlayerTurn() == Null when the the active triggers are first setup. So phasesCheck needs some safeguards for this scenario. Specifically where the NPE line number is pointing:Agetian wrote:Description: r27757: I got this NPE again, immediately after keeping my hand (and could not continue the game afterwards). This time I diligently wrote down the contents of both my initial hand and the opponent's opening hand.
- Code: Select all
if (!phaseHandler.getPlayerTurn().isOpponentOf(this.getHostCard().getController())) {
- Code: Select all
if (!this.getHostCard().getController().isOpponentOf(phaseHandler.getPlayerTurn())) {
Here's the code where things are called before everything is ready. In GameAction.startGame(). This could also be fixed by setting the first turn before the checkStateEffects() which activates triggers. I'm not sure why the Beginning of the Game triggers happen before the "StartFirstTurn" is set to begin with...
- startGame | Open
- checkStateEffects(); // why?
// Run Trigger beginning of the game
final HashMap<String, Object> runParams = new HashMap<String, Object>();
game.getTriggerHandler().runTrigger(TriggerType.NewGame, runParams, true);
//</THIS CODE WILL WORK WITH PHASE = NULL>
game.getPhaseHandler().startFirstTurn(first);
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Bug Reports (snapshot builds)
by Agetian » 30 Sep 2014, 19:03
For now, I inverted the condition in an attempt to provide a safeguard against the NPE. I took a look at GameAction.startGame but I feel too tired to attempt a more in-depth fix there - basically, it's impossible to just move the line "...startFirstTurn(first)" above checkStateEffects, otherwise checkStateEffects, as well as all the code below it (running the beginning of the game triggers) will not be reached in an ordinary game, so it requires a bit of a recode/restructure in that part to work smoothly...
I can't yet confirm that the inverted condition works because it's not as easy to reproduce the condition for the crash (I tried to do "setup game state" but it only allows to set the game state up after the first turn has already begun). Feel free to dig further into this when/if you have some time.
- Agetian
I can't yet confirm that the inverted condition works because it's not as easy to reproduce the condition for the crash (I tried to do "setup game state" but it only allows to set the game state up after the first turn has already begun). Feel free to dig further into this when/if you have some time.

- Agetian
- Agetian
- Programmer
- Posts: 3486
- Joined: 14 Mar 2011, 05:58
- Has thanked: 683 times
- Been thanked: 569 times
Re: Bug Reports (snapshot builds)
by ZappaZ » 30 Sep 2014, 21:15
r27763
Description: AI was attacking me with Student of Warfare, not much else on the bord.
http://imgur.com/pLdaqyx
Description: AI was attacking me with Student of Warfare, not much else on the bord.
http://imgur.com/pLdaqyx
- NullPointerException | Open
- Code: Select all
Forge Version: 1.5.28-SNAPSHOT-r-1u
Operating System: Windows 7 6.1 amd64
Java Version: 1.8.0_20 Oracle Corporation
java.lang.NullPointerException
at forge.game.card.Card.getLatestPT(Card.java:4040)
at forge.game.card.Card.getSetPower(Card.java:4010)
at forge.game.card.Card.getCurrentPower(Card.java:4098)
at forge.game.card.Card.getUnswitchedPower(Card.java:4114)
at forge.game.card.Card.getNetAttack(Card.java:4140)
at forge.view.ViewUtil.writeNonDependentCardViewProperties(ViewUtil.java:83)
at forge.view.LocalGameView.writeCardToView(LocalGameView.java:518)
at forge.view.LocalGameView.getCardView(LocalGameView.java:438)
at forge.view.LocalGameView$3.apply(LocalGameView.java:455)
at forge.view.LocalGameView$3.apply(LocalGameView.java:452)
at forge.view.ViewUtil.transformIfNotNull(ViewUtil.java:142)
at forge.view.LocalGameView.getCardViews(LocalGameView.java:460)
at forge.view.LocalGameView.getPlayerView(LocalGameView.java:393)
at forge.view.LocalGameView.getPlayerView(LocalGameView.java:359)
at forge.view.LocalGameView.getPlayerTurn(LocalGameView.java:249)
at forge.screens.match.CMatchUI.updatePhase(CMatchUI.java:432)
at forge.control.FControlGameEventHandler$1.run(FControlGameEventHandler.java:89)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Who is online
Users browsing this forum: DanielKarie and 19 guests