Developing Bugs
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Developing Bugs
by Sloth » 06 Oct 2012, 10:43
I still can't start a game, but i don't (and didn't) have any compiling errors. So where's the problem?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Developing Bugs
by Chris H. » 06 Oct 2012, 11:49
Sloth wrote:I still can't start a game, but i don't (and didn't) have any compiling errors.
I see that same thing as Sloth, no compiling errors and I am able to run forge from within Eclipse, but starting a game will return me to the home view without starting the match.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Developing Bugs
by friarsol » 06 Oct 2012, 12:59
I definitely don't have any compilation errors and no new files were added, maybe your files aren't refreshed? Specifically, GuiChoose which will now take a reference Card parameter.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Developing Bugs
by Max mtg » 06 Oct 2012, 17:51
Yet, I do have them.friarsol wrote:I definitely don't have any compilation errors and no new files were added, maybe your files aren't refreshed? Specifically, GuiChoose which will now take a reference Card parameter.
Have a workaround too: cast nulls to Object[].
- Code: Select all
final List<Object> firstPile = GuiChoose.getOrderChoices("Place into two piles", "Pile 1", -1, pool.toArray(), (Object[])null, card);
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 friarsol » 06 Oct 2012, 17:59
That doesn't make any sense. That parameter that youre casting has been there for a week or two already
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Developing Bugs
by Max mtg » 06 Oct 2012, 18:39
Would you like me to make a screenshot to proove that there emerges a compile error?friarsol wrote:That doesn't make any sense. That parameter that youre casting has been there for a week or two already
Look, the whole DualListBox without parameters and accepting arrays of objects has 2 problems:
1. You have to cast the lists you are passing as parameters to arrays. (and null passed for parameter of type Object[] leads to compilation error)
2. After you've received a list from the routine, you have to cast it to a list of appropriate type, which in turn leads to code duplication - mind the efforts you spend to make a card array
- Code: Select all
List<Object> ordered = GuiChoose.getOrderChoices("Choose Blocking Order", "Damaged First", 0, attackers.asArray(), null, blocker);
orderedAttacker = new ArrayList<Card>();
for(Object o : ordered) {
orderedAttacker.add((Card)o);
}
Please do not hesistate to use generic templates, even if current runtime is discouraging you to do so.
- Code: Select all
class UnsortedListModel<T> extends AbstractListModel { // Java 7 has a generic version. In 6 we have to cast types
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 Max mtg » 06 Oct 2012, 19:23
It is now possible to start a new game.ArsenalNut wrote:Max Mtg's r17360 is the culprit. Max could you please at least try to start a game and play a little before you check in code.Sloth wrote:Using 17364, i can't start a game. Clicking Start with a random deck, fixed deck or quest mode will always return to the home screen after the loading window appears briefly.
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 Doublestrike » 08 Oct 2012, 00:59
Getting quite a few of these (during match play).null
Version:
Forge version SVN
OS: Windows 7 Version: 6.1 Architecture: amd64
Java Version: 1.6.0_34 Vendor: Sun Microsystems Inc.
Detailed error trace:
java.lang.NullPointerException
at forge.card.spellability.SpellAbility.chooseTargetAI(SpellAbility.java:211)
at forge.game.player.ComputerUtil.handlePlayingSpellAbility(ComputerUtil.java:160)
at forge.game.player.ComputerUtil.playSpellAbilities(ComputerUtil.java:111)
at forge.game.player.ComputerAIGeneral.playSpellAbilitiesStackEmpty(ComputerAIGeneral.java:85)
at forge.game.player.ComputerAIGeneral.playSpellAbilities(ComputerAIGeneral.java:340)
at forge.game.player.ComputerAIInput.think(ComputerAIInput.java:113)
at forge.game.player.ComputerAIInput.showMessage(ComputerAIInput.java:74)
at forge.gui.GuiInput.setInput(GuiInput.java:74)
at forge.gui.GuiInput.update(GuiInput.java:60)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.util.MyObservable.updateObservers(MyObservable.java:41)
at forge.game.GameNew.newGame(GameNew.java:60)
..... et cetera
---
A joke is a very serious thing.
A joke is a very serious thing.
-
Doublestrike - UI Programmer
- Posts: 715
- Joined: 08 Aug 2011, 09:07
- Location: Bali
- Has thanked: 183 times
- Been thanked: 161 times
Re: Developing Bugs
by friarsol » 08 Oct 2012, 01:43
Oh god, chooseTargetAI? I think only hardcoded cards use that garbage.Doublestrike wrote:forge.card.spellability.SpellAbility.chooseTargetAI(SpellAbility.java:211)
at forge.game.player.ComputerUtil.handlePlayingSpellAbility(ComputerUtil.java:160)
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Developing Bugs
by Doublestrike » 08 Oct 2012, 02:18
Yeah, I don't do much work in that department so I can't give a helpful report, unfortunately, but it was when I was running various games to test the ante problem and multiblocker UI. I hadn't changed any code yet.
They came up quite often in several different games...that's about as narrow as I can get for now.
They came up quite often in several different games...that's about as narrow as I can get for now.
---
A joke is a very serious thing.
A joke is a very serious thing.
-
Doublestrike - UI Programmer
- Posts: 715
- Joined: 08 Aug 2011, 09:07
- Location: Bali
- Has thanked: 183 times
- Been thanked: 161 times
Re: Developing Bugs
by Max mtg » 08 Oct 2012, 06:32
That was mine. Already fixedfriarsol wrote:Oh god, chooseTargetAI? I think only hardcoded cards use that garbage.Doublestrike wrote:forge.card.spellability.SpellAbility.chooseTargetAI(SpellAbility.java:211)
at forge.game.player.ComputerUtil.handlePlayingSpellAbility(ComputerUtil.java:160)
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 » 08 Oct 2012, 07:35
Challenge accepted.friarsol wrote:Oh god, chooseTargetAI? I think only hardcoded cards use that garbage.

-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Developing Bugs
by RumbleBBU » 08 Oct 2012, 07:53
For some reason, when you try to edit a Quest deck now, you always get an empty deck instead of the deck you are trying to edit. It worked on Friday, and the relevant V&CSubmenus haven't been changed, so the problem is somewhere else.
(...and no, I don't think I caused this either.)
(...and no, I don't think I caused this either.)
Re: Developing Bugs
by Max mtg » 08 Oct 2012, 08:09
The reason is removal of global variable HUMAN_DECK (because global variables are evil and there won't be an only human in game)RumbleBBU wrote:For some reason, when you try to edit a Quest deck now, you always get an empty deck instead of the deck you are trying to edit. It worked on Friday, and the relevant V&CSubmenus haven't been changed, so the problem is somewhere else.
(...and no, I don't think I caused this either.)
Suggested solution: keep the current quest player's deck somewhere in quest-related structures.
A transient field in QuestAssets may be an option.
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 RumbleBBU » 08 Oct 2012, 08:20
Could that also be the underlying cause of the Draft game problem observed by Sloth?
viewtopic.php?f=52&t=8029&start=45#p99790
viewtopic.php?f=52&t=8029&start=45#p99790
Who is online
Users browsing this forum: No registered users and 34 guests