Developing Bugs
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Developing Bugs
by friarsol » 29 May 2015, 18:00
I have admin privileges on the old server. I'll send you an export of all the May issues.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.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Developing Bugs
by KrazyTheFox » 29 May 2015, 18:15
Export worked great. May's issues are now in the new tracker.
-
KrazyTheFox - Programmer
- Posts: 725
- Joined: 18 Mar 2014, 23:51
- Has thanked: 66 times
- Been thanked: 226 times
- Agetian
- Programmer
- Posts: 3474
- Joined: 14 Mar 2011, 05:58
- Has thanked: 677 times
- Been thanked: 563 times
Re: Developing Bugs
by Agetian » 19 Jul 2015, 05:12
I tried compiling r29804 and I get many test failures now during compilation... does anyone know what's up?
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3474
- Joined: 14 Mar 2011, 05:58
- Has thanked: 677 times
- Been thanked: 563 times
Re: Developing Bugs
by Agetian » 02 Oct 2015, 06:35
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
- Agetian
- Agetian
- Programmer
- Posts: 3474
- Joined: 14 Mar 2011, 05:58
- Has thanked: 677 times
- Been thanked: 563 times
Re: Developing Bugs
by kudit » 06 Nov 2015, 18:39
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!
Please give feedback on our card database at http://www.deckmaster.info
Send comments via PM here or info@deckmaster.info
Send comments via PM here or info@deckmaster.info
Re: Developing Bugs
by Agetian » 30 Dec 2015, 06:26
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:
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
- 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...
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
- Agetian
- Programmer
- Posts: 3474
- Joined: 14 Mar 2011, 05:58
- Has thanked: 677 times
- Been thanked: 563 times
Re: Developing Bugs
by Agetian » 31 Dec 2015, 17:46
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
- Programmer
- Posts: 3474
- Joined: 14 Mar 2011, 05:58
- Has thanked: 677 times
- Been thanked: 563 times
Re: Developing Bugs
by Myrd » 31 Dec 2015, 20:20
Sorry about that, fixing now.Agetian wrote:It looks like as of r30554, the Manifest test is still failing, but it's now failing differently:- Agetian
- 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
EDIT: Fixed.
Re: Developing Bugs
by Myrd » 03 Jan 2016, 06:51
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:
I've narrowed the above down to this difference between Human and AI logic.
AI logic (CostPayment.java):
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?
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
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;
}
// ...
}
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
by friarsol » 04 Jan 2016, 02:51
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).
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).
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Developing Bugs
by Hanmac » 25 Apr 2016, 08:51
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.
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
by excessum » 26 Apr 2016, 09:11
I believe submitting a patch somewhere on this forum and waiting for one of the devs with admin-access to approve it will do.Hanmac wrote:what do i need to do to get (write)access to the svn?
Re: Developing Bugs
by Hanmac » 26 Apr 2016, 09:41
@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.
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
by friarsol » 26 Apr 2016, 12:52
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.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.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Who is online
Users browsing this forum: No registered users and 10 guests