Developing Bugs
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Developing Bugs
by Max mtg » 23 May 2013, 05:55
AI played Yamivaya Ants, they were gaining age counters each upkeep, after they obtained 3 counters, they got buried
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Developing Bugs
by Sloth » 23 May 2013, 07:27
That is to be expected with Cumulative Upkeep. Where's the bug?Max mtg wrote:AI played Yamivaya Ants, they were gaining age counters each upkeep, after they obtained 3 counters, they got buried
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Developing Bugs
by Max mtg » 23 May 2013, 08:42
Looks like I've mixed up these age counters with time ones.Sloth wrote:That is to be expected with Cumulative Upkeep. Where's the bug?

Not a bug.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Developing Bugs
by Sloth » 23 May 2013, 16:40
You forgot to convert cards that gain suspend from effects: Epochrasite and Delay.RedDeckWins wrote:This is my first attempt a significant change to the rules engine. Someone please look at it. The patch is to make the "cast for free" portion of suspend happen via a trigger. This will fix a bug with a few cards such as Fungal Behemoth, as well as make the trigger stiflable like it should be.
https://dl.dropboxusercontent.com/u/129 ... gers.patch
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Developing Bugs
by Sloth » 23 May 2013, 16:49
There are a few bugs related to hitting enter very fast:
1. This error pops up a lot (but doesn't do anything bad):
2. When i control a card with an "At the beginning of your upkeep," trigger (for example Agent of Masks) it sometimes triggers twice in one upkeep. The opponents suspended card even triggered four times during one upkeep.
1. This error pops up a lot (but doesn't do anything bad):
- | Open
- java.lang.RuntimeException: Trying to unlock input which is not locked! Do check when your threads terminate!
at forge.control.input.InputQueue.unlock(InputQueue.java:203)
at forge.control.input.InputQueue$1.run(InputQueue.java:223)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2. When i control a card with an "At the beginning of your upkeep," trigger (for example Agent of Masks) it sometimes triggers twice in one upkeep. The opponents suspended card even triggered four times during one upkeep.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Developing Bugs
by moomarc » 23 May 2013, 21:33
Is it possible that this one has something to do with my additions in PhaseHandler for Paradox Haze? I wasn't sure if it needed to freeze/unfreeze the stack so left it and it seemed to work.Sloth wrote:2. When i control a card with an "At the beginning of your upkeep," trigger (for example Agent of Masks) it sometimes triggers twice in one upkeep. The opponents suspended card even triggered four times during one upkeep.
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Developing Bugs
by RedDeckWins » 23 May 2013, 22:10
K, I'll fix that up. Good catch.Sloth wrote:You forgot to convert cards that gain suspend from effects: Epochrasite and Delay.RedDeckWins wrote:This is my first attempt a significant change to the rules engine. Someone please look at it. The patch is to make the "cast for free" portion of suspend happen via a trigger. This will fix a bug with a few cards such as Fungal Behemoth, as well as make the trigger stiflable like it should be.
https://dl.dropboxusercontent.com/u/129 ... gers.patch
-
RedDeckWins - Posts: 35
- Joined: 20 Apr 2013, 16:45
- Has thanked: 8 times
- Been thanked: 10 times
Re: Developing Bugs
by RedDeckWins » 23 May 2013, 23:43
While fixing this up I encountered another issue I am a little unsure of how to deal with. Why does CardFactoryUtil remove Intrinsic Keywords for a lot of the abilities (champion, suspend, cycling, etc)? Right now this is affecting the engines ability to detect withoutSuspend (for example, for Delay). I believe this flaw has always existed for suspend and was not introduced by me.
-
RedDeckWins - Posts: 35
- Joined: 20 Apr 2013, 16:45
- Has thanked: 8 times
- Been thanked: 10 times
Re: Developing Bugs
by Max mtg » 24 May 2013, 09:48
I've just managed to skip my upkeep by repeatedly pressing Enter.Sloth wrote:There are a few bugs related to hitting enter very fast:
Would have to pay echo cost if the game worked correctly.
I'll take a look at this family of problems.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Developing Bugs
by swordshine » 24 May 2013, 15:22
Description: This exception comes out quite frequently when I start an AI vs. AI game
- RuntimeException | Open
- Code: Select all
Forge Version: SVN
Operating System: Windows XP 5.1 x86
Java Version: 1.7.0_17 Oracle Corporation
java.lang.RuntimeException: ComputerUtil : payManaCost() cost was not paid for Nightmare. Didn't find what to pay for 1
at forge.game.ai.ComputerUtilMana.payManaCost(ComputerUtilMana.java:178)
at forge.game.ai.ComputerUtilMana.payManaCost(ComputerUtilMana.java:55)
at forge.card.cost.CostPartMana.payAI(CostPartMana.java:160)
at forge.card.cost.CostPayment.payComputerCosts(CostPayment.java:190)
at forge.game.ai.ComputerUtil.handlePlayingSpellAbility(ComputerUtil.java:119)
at forge.game.ai.AiController.playSpellAbilities(AiController.java:899)
at forge.game.ai.AiController.onPriorityRecieved(AiController.java:847)
at forge.game.ai.AiInputCommon$1.run(AiInputCommon.java:73)
at forge.control.input.InputQueue$1.run(InputQueue.java:222)
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:722)
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Developing Bugs
by Max mtg » 25 May 2013, 18:45
Try to reproduce any of these now. (r21673+)Sloth wrote:There are a few bugs related to hitting enter very fast:
1. This error pops up a lot (but doesn't do anything bad):
- | Open
- java.lang.RuntimeException: Trying to unlock input which is not locked! Do check when your threads terminate!
at forge.control.input.InputQueue.unlock(InputQueue.java:203)
at forge.control.input.InputQueue$1.run(InputQueue.java:223)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2. When i control a card with an "At the beginning of your upkeep," trigger (for example Agent of Masks) it sometimes triggers twice in one upkeep. The opponents suspended card even triggered four times during one upkeep.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Developing Bugs
by Sloth » 25 May 2013, 19:37
This one does still happen (r21673):
- | Open
- java.lang.RuntimeException: Trying to unlock input which is not locked! Do check when your threads terminate!
at forge.control.input.InputQueue.unlock(InputQueue.java:203)
at forge.control.input.InputQueue$1.run(InputQueue.java:223)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
)
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Developing Bugs
by Max mtg » 25 May 2013, 20:20
Try with 21678 or newer.
It could have been passPriority that had locked UI.
It could have been passPriority that had locked UI.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Developing Bugs
by Sloth » 25 May 2013, 21:47
I played some games with r21679 and did not get the "input locked" error. Thanks Max.Max mtg wrote:Try with 21678 or newer.
It could have been passPriority that had locked UI.
But i had this error duo pop up again (had them a few days ago too). They did freeze the game.
- ArrayIndexOutOfBoundsException | Open
- Code: Select all
Forge Version: SVN
Operating System: Windows 7 6.1 amd64
Java Version: 1.6.0_38 Sun Microsystems Inc.
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.add(Unknown Source)
at forge.Card.addSpellAbility(Card.java:2515)
at forge.game.GameActionUtil.grantBasicLandsManaAbilities(GameActionUtil.java:697)
at forge.game.GameAction.checkStaticAbilities(GameAction.java:897)
at forge.game.GameAction.checkStateEffects(GameAction.java:930)
at forge.card.mana.ManaPool.add(ManaPool.java:89)
at forge.card.spellability.AbilityManaPart.produceMana(AbilityManaPart.java:125)
at forge.card.ability.effects.ManaEffect.resolve(ManaEffect.java:169)
at forge.card.ability.AbilityApiBased.resolve(AbilityApiBased.java:62)
at forge.card.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1057)
at forge.card.ability.AbilityUtils.resolve(AbilityUtils.java:1034)
at forge.game.ai.ComputerUtilMana.payManaCost(ComputerUtilMana.java:164)
at forge.game.ai.ComputerUtilMana.payManaCost(ComputerUtilMana.java:55)
at forge.card.cost.CostPartMana.payAI(CostPartMana.java:160)
at forge.card.cost.CostPayment.payComputerCosts(CostPayment.java:190)
at forge.game.ai.ComputerUtil.handlePlayingSpellAbility(ComputerUtil.java:119)
at forge.game.ai.AiController.playSpellAbilities(AiController.java:899)
at forge.game.ai.AiController.onPriorityRecieved(AiController.java:847)
at forge.game.ai.AiInputCommon$1.run(AiInputCommon.java:73)
at forge.control.input.InputQueue$1.run(InputQueue.java:222)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
- ArrayIndexOutOfBoundsException | Open
- Code: Select all
Forge Version: SVN
Operating System: Windows 7 6.1 amd64
Java Version: 1.6.0_38 Sun Microsystems Inc.
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.fastRemove(Unknown Source)
at java.util.ArrayList.remove(Unknown Source)
at forge.Card.removeSpellAbility(Card.java:2534)
at forge.game.GameActionUtil.grantBasicLandsManaAbilities(GameActionUtil.java:684)
at forge.game.GameAction.checkStaticAbilities(GameAction.java:897)
at forge.game.GameAction.checkStateEffects(GameAction.java:930)
at forge.card.mana.ManaPool.add(ManaPool.java:89)
at forge.card.spellability.AbilityManaPart.produceMana(AbilityManaPart.java:125)
at forge.card.ability.effects.ManaEffect.resolve(ManaEffect.java:169)
at forge.card.ability.AbilityApiBased.resolve(AbilityApiBased.java:62)
at forge.card.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1057)
at forge.card.ability.AbilityUtils.resolve(AbilityUtils.java:1034)
at forge.game.ai.ComputerUtilMana.payManaCost(ComputerUtilMana.java:164)
at forge.game.ai.ComputerUtilMana.payManaCost(ComputerUtilMana.java:55)
at forge.card.cost.CostPartMana.payAI(CostPartMana.java:160)
at forge.card.cost.CostPayment.payComputerCosts(CostPayment.java:190)
at forge.game.ai.ComputerUtil.handlePlayingSpellAbility(ComputerUtil.java:119)
at forge.game.ai.AiController.playSpellAbilities(AiController.java:899)
at forge.game.ai.AiController.onPriorityRecieved(AiController.java:847)
at forge.game.ai.AiInputCommon$1.run(AiInputCommon.java:73)
at forge.control.input.InputQueue$1.run(InputQueue.java:222)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Later i had this error (which caused no problem):
- NullPointerException | Open
- Code: Select all
Forge Version: SVN
Operating System: Windows 7 6.1 amd64
Java Version: 1.6.0_38 Sun Microsystems Inc.
java.lang.NullPointerException
at forge.control.input.InputBase.stop(InputBase.java:65)
at forge.control.input.InputSelectManyBase.onOk(InputSelectManyBase.java:84)
at forge.control.input.InputSyncronizedBase.selectButtonOK(InputSyncronizedBase.java:46)
at forge.gui.InputProxy.selectButtonOK(InputProxy.java:96)
at forge.gui.match.controllers.CMessage$2.actionPerformed(CMessage.java:61)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at forge.gui.toolbox.FButton$1.keyPressed(FButton.java:87)
at java.awt.Component.processKeyEvent(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(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.AccessControlContext$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)
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Developing Bugs
by Max mtg » 25 May 2013, 22:06
the first couple is bit out of scope of my current work. ATM I have no idea how to fix them.
The last one belongs to the code that I have already changed locally - it won't happen again after my next commit (there might be a different one though
)
The last one belongs to the code that I have already changed locally - it won't happen again after my next commit (there might be a different one though

Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Who is online
Users browsing this forum: No registered users and 33 guests