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 excessum » 26 Jul 2016, 05:18
I have a feeling that this is one of those long-standing issues with auto mana payment where the arrangement of multi-color sources prevent certain combinations from being paid. You can double check by setting up a game state with the same set of lands and trying to auto-pay either of those spells from hand.Agetian wrote:r31699: Here's a weird glitch that put the AI at a rather serious disadvantage, I think it may have something to do with the way mana payment option detection works for the AI (I may be wrong though): my opponent has Anafenza, the Foremost and Abzan Charm in its hand (as confirmed via a Duress) and it does NOT play either card despite having untapped Sunken Hollow, Canopy Vista and Shambling Vent in play for three consecutive turns (these are the only lands it had). Not sure if there was enough reason to play Abzan Charm at that moment but playing Anafenza sure seemed like a good option (I was whacking at the AI with my 2/2 tokens while the AI's battlefield was creatureless).
- Agetian
Assuming that I am correct, the solution requires some serious math-fu to compute the optimal order for paying coloured mana and is probably much more complicated than the current implementation which is good enough for most cases.
Re: Bug Reports (snapshot builds)
by Hanmac » 26 Jul 2016, 05:42
Hm while not about the optimal way,
But a little fix might be if it fails to find the right mana sources to pay the cost and the cost does require multiple colors, it should try to rearrange them.
The better way would be if it does count the mana sources per color first. Then he would notice that G can only be paid with one source and should try to pay that color first.
But a little fix might be if it fails to find the right mana sources to pay the cost and the cost does require multiple colors, it should try to rearrange them.
The better way would be if it does count the mana sources per color first. Then he would notice that G can only be paid with one source and should try to pay that color first.
Re: Bug Reports (snapshot builds)
by Agetian » 26 Jul 2016, 08:11
Did something change relatively recently with the way AI handles non-stacking keywords? Recently I've seen the AI put 3 Aqueous Form on a single creature while it had other valid targets in play. Another time the AI spammed a First Strike-granting ability 6 times on the same creature until it ran out of mana.
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Bug Reports (snapshot builds)
by friarsol » 26 Jul 2016, 12:49
Hanmac, are you using 1.8 as your compiler? I'm getting errors in CostAdjustment -
final String color = params.getOrDefault("Cost", params.get("Color"));
getOrDefault is not legal in 1.7.
final String color = params.getOrDefault("Cost", params.get("Color"));
getOrDefault is not legal in 1.7.
- 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 Hanmac » 26 Jul 2016, 13:08
@friarsol huch it isnt? Ah good to know I will fix that this instant.
Re: Bug Reports (snapshot builds)
by tjtillman » 26 Jul 2016, 14:25
Description: CPU had Ulrich on the board, on his turn played nothing, and when Ulrich transformed I got the crash report below.
- RuntimeException | Open
- Code: Select all
Forge Version: 1.5.55-SNAPSHOT-r31692
Operating System: Windows 8 6.2 amd64
Java Version: 1.8.0_31 Oracle Corporation
java.lang.RuntimeException: AbilityFactory : getAbility -- no API in Ulrich, Uncontested Alpha:
at forge.game.ability.AbilityFactory.getAbility(AbilityFactory.java:106)
at forge.game.trigger.TriggerHandler.runSingleTrigger(TriggerHandler.java:500)
at forge.game.trigger.TriggerHandler.runNonStaticTriggersForPlayer(TriggerHandler.java:366)
at forge.game.trigger.TriggerHandler.runWaitingTrigger(TriggerHandler.java:330)
at forge.game.trigger.TriggerHandler.runWaitingTriggers(TriggerHandler.java:290)
at forge.game.zone.MagicStack.unfreezeStack(MagicStack.java:167)
at forge.game.zone.MagicStack.finishResolving(MagicStack.java:569)
at forge.game.zone.MagicStack.resolveStack(MagicStack.java:518)
at forge.game.phase.PhaseHandler.startFirstTurn(PhaseHandler.java:974)
at forge.game.GameAction.startGame(GameAction.java:1460)
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)
Re: Bug Reports (snapshot builds)
by tjtillman » 26 Jul 2016, 14:27
r31692
Turn 2 CPU played Pale Rider of Trostad, discarding Twins of Maurer Estate. Twins went into exile as the madness trigger went on the stack, CPU couldn't pay the madness cost as it was tapped out, but then for the rest of the game Twins of Maurer Estate remained in exile rather than go to the graveyard.
Turn 2 CPU played Pale Rider of Trostad, discarding Twins of Maurer Estate. Twins went into exile as the madness trigger went on the stack, CPU couldn't pay the madness cost as it was tapped out, but then for the rest of the game Twins of Maurer Estate remained in exile rather than go to the graveyard.
Re: Bug Reports (snapshot builds)
by Hanmac » 26 Jul 2016, 14:57
some new cards has implementation errors:
DevMode caused this:
- Creeping Dread: currently it does damage all other players, but it should not damage allies
- Thirsting Axe: the remembered seems wrong, there might be cases when the equipment is moved or it does enter the battlefield after combat.
i though something like "DealtCombatDamageToThisTurn Creature" would be a more clean way to do it.
DevMode caused this:
- Code: Select all
Game-1 > java.lang.NullPointerException
at forge.game.zone.MagicStack.addAllTriggeredAbilitiesToStack(MagicStack.java:795)
at forge.player.PlayerControllerHuman$DevModeCheats$7.run(PlayerControllerHuman.java:1835)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Last edited by Hanmac on 26 Jul 2016, 15:05, edited 1 time in total.
Re: Bug Reports (snapshot builds)
by fmartel » 26 Jul 2016, 15:01
r-31713 AI3 killed AI 1, game froze, with Java taking 80%+ of CPU Usage, and over 1.2GB RAM......
- fmartel
- Posts: 281
- Joined: 31 Dec 2013, 19:27
- Location: Québec City
- Has thanked: 8 times
- Been thanked: 4 times
Re: Bug Reports (snapshot builds)
by friarsol » 26 Jul 2016, 15:12
It's not wrong, the Axe tracks the remember even when it's not on the battlefield. Moving it in response to the trigger is a corner case that doesn't work currently.Hanmac wrote:[*]Thirsting Axe: the remembered seems wrong, there might be cases when the equipment is moved or it does enter the battlefield after combat.
"DealtCombatDamageToThisTurn Creature" doesn't exist in DamageHistory, if you want to add it and change the script feel free.
- 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 » 26 Jul 2016, 15:57
This is not just an AI issue, I can confirm this happens for the human player too whenever Ulrich of the Krallenhorde transforms. It's one more of those rather nondescript "no API" errors... :/tjtillman wrote:Description: CPU had Ulrich on the board, on his turn played nothing, and when Ulrich transformed I got the crash report below.
- RuntimeException | Open
- Code: Select all
Forge Version: 1.5.55-SNAPSHOT-r31692
Operating System: Windows 8 6.2 amd64
Java Version: 1.8.0_31 Oracle Corporation
java.lang.RuntimeException: AbilityFactory : getAbility -- no API in Ulrich, Uncontested Alpha:
at forge.game.ability.AbilityFactory.getAbility(AbilityFactory.java:106)
at forge.game.trigger.TriggerHandler.runSingleTrigger(TriggerHandler.java:500)
at forge.game.trigger.TriggerHandler.runNonStaticTriggersForPlayer(TriggerHandler.java:366)
at forge.game.trigger.TriggerHandler.runWaitingTrigger(TriggerHandler.java:330)
at forge.game.trigger.TriggerHandler.runWaitingTriggers(TriggerHandler.java:290)
at forge.game.zone.MagicStack.unfreezeStack(MagicStack.java:167)
at forge.game.zone.MagicStack.finishResolving(MagicStack.java:569)
at forge.game.zone.MagicStack.resolveStack(MagicStack.java:518)
at forge.game.phase.PhaseHandler.startFirstTurn(PhaseHandler.java:974)
at forge.game.GameAction.startGame(GameAction.java:1460)
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)
EDIT: The same crash occurs with a similar card Huntmaster of the Fells.
EDIT 2: Ok, the reason for this error is that the "Transformed" trigger makes no distinction between the "face" of the card (original/transformed), which leads to it trying to locate (and activate) an ability from a SVar from a different face than expected. In r31719 I added the relevant test to the code and the card scripts and it seems to work fine now. That being said, I'm not sure if maybe there's a bigger underlying issue as to why this is happening. If so, feel free to revert my hotfix and commit a better solution.
- Agetian
- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Bug Reports (snapshot builds)
by Hanmac » 26 Jul 2016, 17:03
Agentian: hm imo that should not happen.
i worked recently with the Huntmaster and i could blink him and the Trigger does still happen like it should.
you need to checkout if it does still work with the Eldrazi Displacer
PS: i did something for Charm Effects,
the SpellDescription now can be generated from the choices.
i worked recently with the Huntmaster and i could blink him and the Trigger does still happen like it should.
you need to checkout if it does still work with the Eldrazi Displacer
PS: i did something for Charm Effects,
the SpellDescription now can be generated from the choices.
Re: Bug Reports (snapshot builds)
by Agetian » 26 Jul 2016, 17:14
I tested it with Eldrazi Displacer and it appears to work ok, as long as Huntmaster must return to the battlefield in its original state even if it was blinked transformed (that's what happens - not sure if it's correct), otherwise the correct trigger (for the original face) fires as long as the card face is specified in the trigger.Hanmac wrote:Agentian: hm imo that should not happen.
i worked recently with the Huntmaster and i could blink him and the Trigger does still happen like it should.
you need to checkout if it does still work with the Eldrazi Displacer
PS: i did something for Charm Effects,
the SpellDescription now can be generated from the choices.
I have no idea what makes the trigger fail to detect which side it refers to in the first place, and what bigger consequences this might have for other cards with alternate faces... Moreover, I'm not sure where to even look for the possible cause. Can you please take a look when/if you have some time?
- Agetian
- Agetian
- Programmer
- Posts: 3489
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: Bug Reports (snapshot builds)
by Hanmac » 26 Jul 2016, 17:27
i will take a look at it, but probably earliest Tomorrow (but we can leave your hotfix for now)
i try to make it a bit difference in what i do,
something new, and then something old recoded (like reworking keywords), then something new again.
when i finish Collective Brutality, which is only more copy & paste,
then only Gisa and Geralf is missing with the MayPlay problem ...
but i already have some idea how it need to be rewritten.
the only thing i am unsure about is if i should use StaticEffect object or use the StaticAbility object for counting.
i try to make it a bit difference in what i do,
something new, and then something old recoded (like reworking keywords), then something new again.
when i finish Collective Brutality, which is only more copy & paste,
then only Gisa and Geralf is missing with the MayPlay problem ...
but i already have some idea how it need to be rewritten.
the only thing i am unsure about is if i should use StaticEffect object or use the StaticAbility object for counting.
Re: Bug Reports (snapshot builds)
by fmartel » 26 Jul 2016, 18:25
Description: [in a commander game, before AI2's turn, at his Upkeep, Crash occured]
I read it's in relation with commander Ulrich of the Krallenhorde
I read it's in relation with commander Ulrich of the Krallenhorde
- RuntimeException | Open
- Code: Select all
Forge Version: 1.5.55-SNAPSHOT-r31713
Operating System: Windows 7 6.1 amd64
Java Version: 1.7.0_25 Oracle Corporation
java.lang.RuntimeException: AbilityFactory : getAbility -- no API in Ulrich, Uncontested Alpha:
at forge.game.ability.AbilityFactory.getAbility(AbilityFactory.java:106)
at forge.game.trigger.TriggerHandler.runSingleTrigger(TriggerHandler.java:500)
at forge.game.trigger.TriggerHandler.runNonStaticTriggersForPlayer(TriggerHandler.java:366)
at forge.game.trigger.TriggerHandler.runWaitingTrigger(TriggerHandler.java:330)
at forge.game.trigger.TriggerHandler.runWaitingTriggers(TriggerHandler.java:290)
at forge.game.zone.MagicStack.unfreezeStack(MagicStack.java:167)
at forge.game.zone.MagicStack.finishResolving(MagicStack.java:569)
at forge.game.zone.MagicStack.resolveStack(MagicStack.java:518)
at forge.game.phase.PhaseHandler.startFirstTurn(PhaseHandler.java:974)
at forge.game.GameAction.startGame(GameAction.java:1460)
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)
- fmartel
- Posts: 281
- Joined: 31 Dec 2013, 19:27
- Location: Québec City
- Has thanked: 8 times
- Been thanked: 4 times
Who is online
Users browsing this forum: No registered users and 44 guests