It is currently 08 Sep 2025, 19:20
   
Text Size

Developing Bugs

Post MTG Forge Related Programming Questions Here

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

Re: Developing Bugs

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

Re: Developing Bugs

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

Postby 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

Postby Max mtg » 06 Oct 2012, 17:51

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.
Yet, I do have them.
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);
Causes no error
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 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

Postby Max mtg » 06 Oct 2012, 18:39

friarsol wrote:That doesn't make any sense. That parameter that youre casting has been there for a week or two already
Would you like me to make a screenshot to proove that there emerges a compile error?

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);
                }
I have already refactored see r17372.

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

Postby Max mtg » 06 Oct 2012, 19:23

ArsenalNut wrote:
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.
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. [-X
It is now possible to start a new game.
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 Doublestrike » 08 Oct 2012, 00:59

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
Getting quite a few of these (during match play).
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Developing Bugs

Postby friarsol » 08 Oct 2012, 01:43

Doublestrike wrote:forge.card.spellability.SpellAbility.chooseTargetAI(SpellAbility.java:211)
at forge.game.player.ComputerUtil.handlePlayingSpellAbility(ComputerUtil.java:160)
Oh god, chooseTargetAI? I think only hardcoded cards use that garbage.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Developing Bugs

Postby 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.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Developing Bugs

Postby Max mtg » 08 Oct 2012, 06:32

friarsol wrote:
Doublestrike wrote:forge.card.spellability.SpellAbility.chooseTargetAI(SpellAbility.java:211)
at forge.game.player.ComputerUtil.handlePlayingSpellAbility(ComputerUtil.java:160)
Oh god, chooseTargetAI? I think only hardcoded cards use that garbage.
That was mine. Already fixed
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 » 08 Oct 2012, 07:35

friarsol wrote:Oh god, chooseTargetAI? I think only hardcoded cards use that garbage.
Challenge accepted. :D
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Developing Bugs

Postby 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.)
User avatar
RumbleBBU
 
Posts: 394
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 66 times

Re: Developing Bugs

Postby Max mtg » 08 Oct 2012, 08:09

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.)
The reason is removal of global variable HUMAN_DECK (because global variables are evil and there won't be an only human in game)

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

Postby 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
User avatar
RumbleBBU
 
Posts: 394
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 66 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 34 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form