Page 31 of 32

Re: Developing Bugs

PostPosted: 29 May 2015, 18:00
by friarsol
KrazyTheFox wrote:It looks like there's a plugin to import/export issues as xml, but would require administrator access to the old server to install. Even then I'm not sure how compatible it'd be. We'd have to export and try importing to find out.
I have admin privileges on the old server. I'll send you an export of all the May issues.

Re: Developing Bugs

PostPosted: 29 May 2015, 18:15
by KrazyTheFox
Export worked great. May's issues are now in the new tracker.

Re: Developing Bugs

PostPosted: 29 May 2015, 18:17
by Agetian
Thanks! :) This is awesome!

- Agetian

Re: Developing Bugs

PostPosted: 19 Jul 2015, 05:12
by Agetian
I tried compiling r29804 and I get many test failures now during compilation... does anyone know what's up?

- Agetian

Re: Developing Bugs

PostPosted: 02 Oct 2015, 06:35
by Agetian
Does anyone know what would be the best way to retrieve a list of card's mana abilities when the card is still in the hand (e.g. in the AI opponent's hand)? (or otherwise determine what colors of mana the land can potentially produce). The cards on the battlefield return mana abilities via getManaAbilities(), but for the cards still in hand this function returns an empty list (which, I guess, kinda makes sense because those cards don't have active mana abilities "yet"), and I haven't found any other way to determine what color of mana the card can potentially produce. Is it doable in any way?

- Agetian

Re: Developing Bugs

PostPosted: 06 Nov 2015, 18:39
by kudit
Can someone edit the original post so the links are correct? The links in the original post are broken so it might be helpful to either archive and start a new thread or add an update edit so the current information is easy to find without wading through 31 pages of posts. Thanks!

Re: Developing Bugs

PostPosted: 30 Dec 2015, 06:26
by Agetian
I wanted to report something that may be up in the current trunk. For some reason, if tests are enabled (as they are by default), one of the tests in forge.ai.simulation.GameSimulatorTest fails - in particular, I get this result:

Code: Select all
Tests run: 20, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 95.506 sec <<< FAILURE! - in TestSuite
testManifest on testManifest(forge.ai.simulation.GameSimulatorTest)(forge.ai.simulation.GameSimulatorTest)  Time elapsed: 0.014 sec  <<< FAILURE!
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
        at java.lang.String.substring(String.java:1911)
        at forge.game.card.CardFactoryUtil.abilityManifestFaceUp(CardFactoryUtil.java:200)
        at forge.game.card.Card.manifest(Card.java:460)
        at forge.game.ability.effects.ManifestEffect.resolve(ManifestEffect.java:37)
        at forge.game.ability.SpellApiBased.resolve(SpellApiBased.java:50)
        at forge.game.ability.AbilityUtils.resolveApiAbility(AbilityUtils.java:1251)
        at forge.game.ability.AbilityUtils.resolve(AbilityUtils.java:1233)
        at forge.game.zone.MagicStack.resolveStack(MagicStack.java:503)
        at forge.ai.simulation.GameSimulator$1.run(GameSimulator.java:214)
        at forge.game.player.Player.runWithController(Player.java:2451)
        at forge.ai.simulation.GameSimulator.resolveStack(GameSimulator.java:206)
        at forge.ai.simulation.GameSimulator.simulateSpellAbility(GameSimulator.java:170)
        at forge.ai.simulation.GameSimulator.simulateSpellAbility(GameSimulator.java:129)
        at forge.ai.simulation.GameSimulatorTest.testManifest(GameSimulatorTest.java:344)


Results :

Failed tests:
  GameSimulatorTest.testManifest:344 » StringIndexOutOfBounds String index out o...
The line it's pointing at tries to test the Manifest SA. I tried playing Manifest cards, as well as making the AI play Manifested cards, and they seem to work fine... But as of right now, the game won't even compile unless tests are disabled (I use -DskipTests to pass the above-mentioned error).

I couldn't find anything wrong with Manifest at the moment, so I'm not sure what's up (I'm not very good at the game simulation code to be able to tell if maybe something's up in it instead)...

- Agetian

Re: Developing Bugs

PostPosted: 31 Dec 2015, 17:46
by Agetian
It looks like as of r30554, the Manifest test is still failing, but it's now failing differently:

Code: Select all
Tests run: 20, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 84.57 sec <<< FAILURE! - in TestSuite
testManifest on testManifest(forge.ai.simulation.GameSimulatorTest)(forge.ai.simulation.GameSimulatorTest)  Time elapsed: 0.02 sec  <<< FAILURE!
java.lang.RuntimeException: Game copy error
        at forge.ai.simulation.GameSimulator.<init>(GameSimulator.java:57)
        at forge.ai.simulation.SpellAbilityPicker.chooseSpellAbilityToPlay(SpellAbilityPicker.java:68)
        at forge.ai.simulation.GameSimulator.simulateSpellAbility(GameSimulator.java:194)
        at forge.ai.simulation.GameSimulator.simulateSpellAbility(GameSimulator.java:129)
        at forge.ai.simulation.GameSimulatorTest.testManifest(GameSimulatorTest.java:344)


Results :

Failed tests:
  GameSimulatorTest.testManifest:344 » Runtime Game copy error
- Agetian

Re: Developing Bugs

PostPosted: 31 Dec 2015, 20:20
by Myrd
Agetian wrote:It looks like as of r30554, the Manifest test is still failing, but it's now failing differently:

Code: Select all
Tests run: 20, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 84.57 sec <<< FAILURE! - in TestSuite
testManifest on testManifest(forge.ai.simulation.GameSimulatorTest)(forge.ai.simulation.GameSimulatorTest)  Time elapsed: 0.02 sec  <<< FAILURE!
java.lang.RuntimeException: Game copy error
        at forge.ai.simulation.GameSimulator.<init>(GameSimulator.java:57)
        at forge.ai.simulation.SpellAbilityPicker.chooseSpellAbilityToPlay(SpellAbilityPicker.java:68)
        at forge.ai.simulation.GameSimulator.simulateSpellAbility(GameSimulator.java:194)
        at forge.ai.simulation.GameSimulator.simulateSpellAbility(GameSimulator.java:129)
        at forge.ai.simulation.GameSimulatorTest.testManifest(GameSimulatorTest.java:344)


Results :

Failed tests:
  GameSimulatorTest.testManifest:344 » Runtime Game copy error
- Agetian
Sorry about that, fixing now.

EDIT: Fixed.

Re: Developing Bugs

PostPosted: 03 Jan 2016, 06:51
by Myrd
I've been trying to fix the fact that the AI is able to pay 0 for Marath's ability, even though it shouldn't be allowed.

First, to simplify things, I've made this more simplified version of Marath's ability that still has a problem:

Code: Select all
A:AB$ Token | Cost$ X SubCounter<X/P1P1> | Announce$ X | XCantBe0$ True | TokenAmount$ 1 | TokenName$ Elemental | TokenOwner$ You | TokenPower$ X | TokenToughness$ X | TokenTypes$ Creature,Elemental | TokenColors$ Green | TokenImage$ g x x elemental | References$ X | Defined$ You | SpellDescription$ Put an X/X green Elemental creature token onto the battlefield. X can't be 0.
SVar:X:Count$xPaid
The above still works correctly for the human player, but AI does not play the ability correctly. Although, the problem is slightly different than before. It now plays it for X=3 for example, but fails to remove the actual counters from Marath.

I've narrowed the above down to this difference between Human and AI logic.

AI logic (CostPayment.java):
Code: Select all
        for (final CostPart part : this.cost.getCostParts()) {
            PaymentDecision decision = part.accept(decisionMaker);
            // ...
            decisions.put(part, decision);
        }

        for (final CostPart part : this.cost.getCostParts()) {
            if (!part.payAsDecided(decisionMaker.getPlayer(), decisions.get(part), this.ability)) {
                return false;
            }
            // ...
        }
Whereas, the human logic only has a single pass algorithm. Note the ability has two CostParts - one to pay X mana and a second to remove X counters.

The 1-pass algorithm gets the right result - because first it pays the mana - and then when it gets to removing the counters, it ends up getting the value from getXManaCostPaid() which has been set when the mana was paid. However, the two pass algorithm doesn't work. When it first creates the Decisions, it creates a Decision for paying the X mana but does not pay it (thus does not set XManaCostPaid) - so when it comes to evaluating how many counters to remove, it ends up treating it as 0.

Given, the above, it's easy to see why it doesn't work. But I'm not sure what's the right fix. For example, we can make the AI use a one-pass algorithm like the human, but probably there's a reason it's 2-pass? Or perhaps the card .txt can be adjusted somehow? For example, does X need to be set to Count$xPaid? But if I don't have that line in the txt, it seems the AI can cast it for 0. Or perhaps the right fix is to treat "Count$xPaid" as some special value? i.e. either don't resolve it to a number in the Decision object (i.e. delay its resolution) or calculate it based on existing Decisions?

Another thing to note is that it's not clear to me that there's anything in AI/engine code that looks like "XCantBe0$ True". It seems that maybe only HumanPlaySpellAbility.java looks at that. However, there seems to exist another syntax - which is to put XCantBe0 as an entry in the Cost line. Anyone know what's the difference between these two?

Re: Developing Bugs

PostPosted: 04 Jan 2016, 02:51
by friarsol
Myrd, I'll try to take a look at this post tomorrow if I have time. I wrote the original Cost stuff, but at some point a bunch of it got rewritten and lots of subtle issues in it were added and never resolved by the person who decided it had to be rewritten.

Here's my initial thoughts:

Probably all the XCantBe0 restrictions should be forced announcements as you seem to be attempting, and then we'll just make sure that the AI is testing this restriction. An announcement would simplify your discrepancy, since you won't have that issue with mana currently being paid as 0 in the verification step that all costs can be paid, before the second pass to actually pay the costs (since some costs have trouble rolling back).

Re: Developing Bugs

PostPosted: 25 Apr 2016, 08:51
by Hanmac
hey I don't know if that is the right thread,
but i want to make some changes to forge
(fixing stuff like Champion, improving the AI part, and others)

what do i need to do to get (write)access to the svn?

and for developing, is there a command-line commando i can use to build it?
i added it to my Eclipse but i didn't get it working yet to build or run.
so i thought there would be an easier way to do it.

Re: Developing Bugs

PostPosted: 26 Apr 2016, 09:11
by excessum
Hanmac wrote:what do i need to do to get (write)access to the svn?
I believe submitting a patch somewhere on this forum and waiting for one of the devs with admin-access to approve it will do.

Re: Developing Bugs

PostPosted: 26 Apr 2016, 09:41
by Hanmac
@excessum yeah but sometimes when I notice an error and post it in the snapshot Thread, and add a maybe how it might to get fixed, it's get under the new posts. Like somethings which are months or more old.

Like the thing with Champion or that the Gitrog Monster does not trigger when the Land comes from somewhere else than the library.

Re: Developing Bugs

PostPosted: 26 Apr 2016, 12:52
by friarsol
Hanmac wrote:@excessum yeah but sometimes when I notice an error and post it in the snapshot Thread, and add a maybe how it might to get fixed, it's get under the new posts. Like somethings which are months or more old.

Like the thing with Champion or that the Gitrog Monster does not trigger when the Land comes from somewhere else than the library.
Did you post fixes for them or just report them? "Maybe how it might get fixed" isn't posting a patch. If you haven't noticed, the dev team has been low activity lately. It's just the ebb and flow of an open source project. I can't get to everything.