It is currently 04 Sep 2025, 00:59
   
Text Size

Developing Bugs

Post MTG Forge Related Programming Questions Here

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

Re: Developing Bugs

Postby 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

Postby Sloth » 23 May 2013, 07:27

Max mtg wrote:AI played Yamivaya Ants, they were gaining age counters each upkeep, after they obtained 3 counters, they got buried
That is to be expected with Cumulative Upkeep. Where's the bug?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Developing Bugs

Postby Max mtg » 23 May 2013, 08:42

Sloth wrote:That is to be expected with Cumulative Upkeep. Where's the bug?
Looks like I've mixed up these age counters with time ones. :( As if a card without suspend started to get counters designed for suspended cards.

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

Postby Sloth » 23 May 2013, 16:40

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
You forgot to convert cards that gain suspend from effects: Epochrasite and Delay.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Developing Bugs

Postby 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):
| 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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Developing Bugs

Postby moomarc » 23 May 2013, 21:33

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.
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.
-Marc
User avatar
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

Postby RedDeckWins » 23 May 2013, 22:10

Sloth wrote:
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
You forgot to convert cards that gain suspend from effects: Epochrasite and Delay.
K, I'll fix that up. Good catch.
User avatar
RedDeckWins
 
Posts: 35
Joined: 20 Apr 2013, 16:45
Has thanked: 8 times
Been thanked: 10 times

Re: Developing Bugs

Postby 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.
User avatar
RedDeckWins
 
Posts: 35
Joined: 20 Apr 2013, 16:45
Has thanked: 8 times
Been thanked: 10 times

Re: Developing Bugs

Postby Max mtg » 24 May 2013, 09:48

Sloth wrote:There are a few bugs related to hitting enter very fast:
I've just managed to skip my upkeep by repeatedly pressing Enter.

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

Postby 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

Postby Max mtg » 25 May 2013, 18:45

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.
Try to reproduce any of these now. (r21673+)
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

Postby 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)
)
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Developing Bugs

Postby Max mtg » 25 May 2013, 20:20

Try with 21678 or newer.
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

Postby Sloth » 25 May 2013, 21:47

Max mtg wrote:Try with 21678 or newer.
It could have been passPriority that had locked UI.
I played some games with r21679 and did not get the "input locked" error. Thanks Max.

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)
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Developing Bugs

Postby 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 ;) )
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 33 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form