It is currently 08 Sep 2025, 11:35
   
Text Size

Forge version 1.5.16

Post MTG Forge Related Programming Questions Here

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

Re: Forge version 1.5.16

Postby KrazyTheFox » 20 Apr 2014, 02:57

Chris H. wrote:I attempted to do a snapshot build and deploy without turning the tests off and I got a test error:

I've been playing around with it to see what's wrong, and it appears to be GuiBase not getting an instance to use before the test is run. Adding the following at the start of DeckHintsTest.java results in a successful build on my computer (with tests on):
Code: Select all
@BeforeTest
void setup() {
    GuiBase.setInterface(new GuiDesktop());
}
I'm not really familiar with this part of the code base, so this may not be the "correct" solution, but it does appear to do the trick.


I'm still getting errors in FSkin.java, however, and I'm not sure how to fix this yet. I've tracked it down to "bimPreferredSprite" being null when the tests are run.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Forge version 1.5.16

Postby drdev » 20 Apr 2014, 03:15

That solution sounds right to me. forge-gui must be initialized with an instance of a class implementing IGuiBase in order to function. The technique I used was the only way much of the code I left in forge-gui could be re-used for both the desktop and mobile games.

As for your issues in FSkin, have you checked whether FSkin.loadLight and FSkin.loadFull are being called?
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.16

Postby Chris H. » 20 Apr 2014, 03:36

KrazyTheFox wrote:Edit: I'm also going to hijack my own post a little. I've been making a bunch of modifications and was wondering if anyone would be interested in any of the following:
  • Antes are not removed from decks until after each game. (This most likely interferes with cards that alter antes)
  • Antes are always of the same rarity. (Exceptions made for things like Time Shifted cards)
  • Fat Packs and Booster Boxes are optionally opened 1 booster at a time. (Sample Image, accounts for additional cards, such as 40 land cards)
  • Booster Boxes in addition to Fat Packs available in the quest shop. I've removed this from my own game, but I have all the code for it still. Would not recommend using without the single-booster-at-a-time option.
  • Large card art in card viewers as an option. (For use with mtgimage.com, affects all card viewers, see above screenshot and this screenshot)
  • Separate credits on win screen into opponent strength and bonus credits for number of previous wins. (See this screenshot)
  • Credits awarded for win-by-turns is no longer a threshold, but a calculation of credits per turn. Would need lots of balancing. (In other words, turn 1 might award 5000 credits, turn 2 might award 750 credits, turn 3 might award 300 credits, turn 5 might award 100 credits, turn 10 might award 35 credits, turn 30 might award 1 credit.)
  • Turns passed when awarding credits are calculated based on how many turns the player has played, not how many total turns have passed. Would need balancing.
 
I have given you commit privileges but it may take a few days/hours for this to take effect. Welcome to the team. 8)
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: Forge version 1.5.16

Postby KrazyTheFox » 20 Apr 2014, 05:11

Chris H. wrote:
KrazyTheFox wrote:I have given you commit privileges but it may take a few days/hours for this to take effect. Welcome to the team. 8)
Awesome, thanks!

I've narrowed down the last bug in the test to a couple of things. The first is that FSkin did need initializing, so I added in a method to load the application enough to get that done. GUIProgressBarWindowTest.java needs:
Code: Select all
    @BeforeTest
    void setup() {
        GuiBase.setInterface(new GuiDesktop());
        Singletons.initializeOnce(true);
        FSkin.loadFull(true);
    }

After that, the following part of the actual test method also has a NullPointerException since the BufferedImage referenced is disposed of when loading. Removing it allows the test to proceed.
Code: Select all
FSkin.Colors.updateAll();

This leads me to the final problem (for me). In FTitleBar.java, the following method...
Code: Select all
    private void updatePreferredSize() {
        int width = skinFont.measureTextWidth(JOptionPane.getRootFrame().getGraphics(), this.lblTitle.getText());
        if (this.lblTitle.getIcon() != null) {
            width += this.lblTitle.getIcon().getIconWidth() + this.lblTitle.getIconTextGap();
        }
        width += btnClose.getPreferredSize().width;
        this.setPreferredSize(new Dimension(width + 10, visibleHeight));
    }
...tries to grab a Graphics context (JOptionPane.getRootFrame().getGraphics()) that returns null, leading to another NullPointerException. I haven't actually done any UI development outside of JavaFX, so I think I'm going to have to pass this one along to someone who knows a bit more about what's going on here.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Forge version 1.5.16

Postby timmermac » 20 Apr 2014, 13:15

@KrazyTheFox: When you've got commit privileges, could you please put your booster box code in? I like that idea.
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: Forge version 1.5.16

Postby friarsol » 20 Apr 2014, 14:33

Krazy please don't change the ante code. As your two changes could lead to issues. Breaking cards like jeweled bird. And playing a pauper deck vs all rare deck. Maybe the matching rarity could be ok as a preference with a fall back to just whatever. But ante pretty much needs to remove the card from your deck to make other ante cards function.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Forge version 1.5.16

Postby drdev » 20 Apr 2014, 16:00

@KrazyTheFox - Instead of calling FSkin.loadFull directly, could you call Singletons.getControl().initialize() instead? That would better model what Main.java is doing.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.16

Postby KrazyTheFox » 20 Apr 2014, 17:20

timmermac wrote:@KrazyTheFox: When you've got commit privileges, could you please put your booster box code in? I like that idea.
Will do!

friarsol wrote:Krazy please don't change the ante code.
I wasn't planning on messing with this until I can find a way around it (if there's a non-buggy way around it). It works fine for my own use, but would definitely not be suitable for public consumption. I've heavily tested the rarity matching and it works well, as it only modifies the antes chosen and none of the other functionality. The fallbacks are already in place (if it can't match rarities, it falls back to the current system).

drdev wrote:call Singletons.getControl().initialize() instead?
This gets the same result.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Forge version 1.5.16

Postby drdev » 20 Apr 2014, 17:47

Is FView's private constructor called? That should be calling JOptionPane.setRootFrame(frmDocument). Or am I misunderstanding what's null?
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.16

Postby Chris H. » 20 Apr 2014, 19:24

Thank you KrazyTheFox, rev 25533 fixes the problem and I was able to do a snapshot build and deploy with tests enabled to cardforge. :)
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: Forge version 1.5.16

Postby Chris H. » 20 Apr 2014, 19:43

I just examined both of the uncompressed archive files. The Mac archive contains the files:

CHANGES.txt
LICENSE.txt
README.txt

but the windows-linux archive does not include these three files.
 
Attachments
Screen Shot.jpg
root window when the windows-linux forge archive is extracted
Screen Shot Mac dmg.jpg
root window when the Mac forge archive is extracted and the dmg file is mounted
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: Forge version 1.5.16

Postby KrazyTheFox » 20 Apr 2014, 20:00

Chris H. wrote:I just examined both of the uncompressed archive files. The Mac archive contains the files:

CHANGES.txt
LICENSE.txt
README.txt

but the windows-linux archive does not include these three files.
 
Ah, whoops. Let me stash some changes real quick and I'll fix that right up.

Edit: Committed.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Forge version 1.5.16

Postby KrazyTheFox » 20 Apr 2014, 23:33

I've added booster boxes to the game. Since there's no images hosted for them yet, I've attached a .zip file containing them (plus one for Journey into Nyx). They're currently priced at 8750 credits (a slight discount from Fat Pack prices on a per-pack basis) each and all contain 36 booster packs. There's one for each set that also has a Fat Pack (to prevent things like cheap LEA boxes).
boosterboxes.zip
(6.8 MiB) Downloaded 249 times


With this addition comes an optional way to open the booster packs individually. It's disabled by default and can be enabled in the game's preferences (under Graphic Options). Hitting the "Open All Remaining" button defaults to the standard Forge card viewer for the rest of the packs/additional cards in the box or Fat Pack.
boxes.jpg


I'll compile a list of changes that would need to be made for the Android version to support them soon.
Last edited by KrazyTheFox on 21 Apr 2014, 01:46, edited 1 time in total.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Forge version 1.5.16

Postby timmermac » 20 Apr 2014, 23:45

KrazyTheFox wrote:I've added booster boxes to the game. Since there's no images hosted for them yet, I've attached a .zip file containing them (plus one for Journey into Nyx). They're currently priced at 8750 credits (a slight discount from Fat Pack prices on a per-pack basis) each and all contain 36 booster packs. There's one for each set that also has a Fat Pack (to prevent things like cheap LEA boxes).
boosterboxes.zip


With this addition comes an optional way to open the booster packs individually. It's disabled by default and can be enabled in the game's preferences (under Graphic Options). Hitting the "Open All Remaining" button defaults to the standard Forge card viewer for the rest of the packs/additional cards in the box or Fat Pack.
boxes.jpg


I'll compile a list of changes that would need to be made for the Android version to support them soon.
I like the idea, but there some changes I would like to propose. I would have there be boxes for all sets that have boosters, and I would increase the prices from a minimum of 25000 credits for Modern sets to 500000 credits for a box of Alpha/Beta/Unlimited.

Edit: Can we get a snapshot with this, or is the beta about to come out?
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: Forge version 1.5.16

Postby KrazyTheFox » 21 Apr 2014, 01:44

timmermac wrote:I like the idea, but there some changes I would like to propose. I would have there be boxes for all sets that have boosters, and I would increase the prices from a minimum of 25000 credits for Modern sets to 500000 credits for a box of Alpha/Beta/Unlimited.
Done! I've just committed changes that add boxes to the rest of the sets and have prices that range from 25k to 500k, depending on how old the set is, with more recent sets having lower price increases. This is all a little arbitrary, so feel free to make suggestions or tweak prices as you see fit. I do have a couple concerns about the price still, however. Fat Packs are far more economical than the boxes at this price point, so I'm guessing it fits in more as a convenience tax? When selling full boxes of duplicates (using all-prices.txt), the average trade-in is around 11000 credits, so you'd not be breaking anywhere close to even.

Since this adds new boxes, here's an updated file with all the images (except LEA and LEB boxes):
boosterboxes.zip
(6.8 MiB) Downloaded 222 times
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 83 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form