Sealed Deck development part 2
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
52 posts
• Page 2 of 4 • 1, 2, 3, 4
Re: Sealed Deck development part 2
by RumbleBBU » 11 Sep 2012, 12:27
Bad news first...I still haven't figured out why my Eclipse doesn't want to 'Branch'.
Then the good news - that might not matter anymore. Functionally, Stage 1 is now complete. The code could use some cleanup (e.g., removal of test printouts and unused variables and imports) and more extensive comments, plus there is one perceived oddity: if you start a new Sealed Deck tournament with n rounds and there is a previously created tournament with p rounds (where p > n) that used the same name, the new tournament turns into a p-round tournament and the previous decks are used for rounds after n.
Other than that, it seems to work as intended.
Then the good news - that might not matter anymore. Functionally, Stage 1 is now complete. The code could use some cleanup (e.g., removal of test printouts and unused variables and imports) and more extensive comments, plus there is one perceived oddity: if you start a new Sealed Deck tournament with n rounds and there is a previously created tournament with p rounds (where p > n) that used the same name, the new tournament turns into a p-round tournament and the previous decks are used for rounds after n.
Other than that, it seems to work as intended.
Re: Sealed Deck development part 2
by RumbleBBU » 11 Sep 2012, 15:06
D'oh. Dumb question time.
I'm ready to commit what I've done so far but apparently I cannot commit my two new classes (two new java files) because they are "not under version control".
How do I bring them under version control?
I'm ready to commit what I've done so far but apparently I cannot commit my two new classes (two new java files) because they are "not under version control".
How do I bring them under version control?
Re: Sealed Deck development part 2
by moomarc » 11 Sep 2012, 15:11
From Package Explorer: Right-click file > Team > Add to Version ControlRumbleBBU wrote:D'oh. Dumb question time.
I'm ready to commit what I've done so far but apparently I cannot commit my two new classes (two new java files) because they are "not under version control".
How do I bring them under version control?
From Synchronize perspective: Right-click > Add to Version Control (or via Team)
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Sealed Deck development part 2
by RumbleBBU » 11 Sep 2012, 15:17
Thanks, Marc!
Actually I'm using the command line client but that was the keyword I needed - "add".
I've committed the current version now. I've cleaned out most testing printouts but there seem to be some unnecessary imports left. Plus the issue (multiple tournaments with similar names and different numbers of rounds) needs to be ironed out before the next beta.
Addendum.
The first commit was, for some reason, incomplete. But it should work now, with the mod to ViewWinLose.java.
Actually I'm using the command line client but that was the keyword I needed - "add".
I've committed the current version now. I've cleaned out most testing printouts but there seem to be some unnecessary imports left. Plus the issue (multiple tournaments with similar names and different numbers of rounds) needs to be ironed out before the next beta.
Addendum.
The first commit was, for some reason, incomplete. But it should work now, with the mod to ViewWinLose.java.
Re: Sealed Deck development part 2
by friarsol » 11 Sep 2012, 16:03
I would highly recommend installing Tortoise SVN.RumbleBBU wrote:Thanks, Marc!
Actually I'm using the command line client but that was the keyword I needed - "add".
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Sealed Deck development part 2
by RumbleBBU » 14 Sep 2012, 10:44
Progress report...
I'm currently trying to add a sideboarding option between games/matches. Adding a "Sideboard" button to the custom panel (to launch an editor) was easy enough.
However, some problems arose....
Problem 1:
The button launched a new editor view, yes, but it appeared behind the semi-transparent WinLose view. I couldn't find any way to bring it to the front. Until...
I hacked FControl.java and added DECK_EDITOR_GAUNTLET option. (I also had to add it to SLayoutIO.java or I would get a layout exception/crash.) I also added a different listener. So basically it would work like this: when the sideboard button is pushed, the WinLose view is hidden (SOverlayUtils.hideOverlay();) and we see the editor. When the editor is closed, the view is displayed again (the window closing/exit listener in FControl.java catches that).
That led to problem 2...
Problem 2 (and 3, 4...):
Well, the Win/Lose view is displayed again all right. Unfortunately, it's completely blank now!
I tried various ways of 'redisplaying' the contents, and failed. Ultimately I decided to try a shortcut: instead of trying to redisplay everything, just create a new ViewWinLose(); in the windowAdapter in FControl.java. That seemed to work at first...the Win/Lose view appeared again and looked like it should. At least almost...
However, the match win/loss statistics kept increasing after every sideboarding. Of course - since they are recalculated in the populate function in GauntletWinLose. To solve this, I split the ViewWinLose constructor into two different constructors (a "()" version and a "(boolean)" version which allows me to tell the constructor that a new game was not played) plus a separate init function to do most of the stuff. Now the statistics didn't change every time a new view was created.
But I seem to have run into a more fundamental problem. After sideboarding & exiting the editor, the program seems to lose track of the game status and forget that we were in the middle of a match. (Or just completed one.) If you hit press 'Continue' now, you always get game "1 of 3" and after that game, no matter whether you win or lose, you always get "Won: 0, Lost: 0".
Please tell me I've been trying to do this the hard way and there's an easier way that I just can't figure out...
I'm currently trying to add a sideboarding option between games/matches. Adding a "Sideboard" button to the custom panel (to launch an editor) was easy enough.
However, some problems arose....
Problem 1:
The button launched a new editor view, yes, but it appeared behind the semi-transparent WinLose view. I couldn't find any way to bring it to the front. Until...
I hacked FControl.java and added DECK_EDITOR_GAUNTLET option. (I also had to add it to SLayoutIO.java or I would get a layout exception/crash.) I also added a different listener. So basically it would work like this: when the sideboard button is pushed, the WinLose view is hidden (SOverlayUtils.hideOverlay();) and we see the editor. When the editor is closed, the view is displayed again (the window closing/exit listener in FControl.java catches that).
That led to problem 2...
Problem 2 (and 3, 4...):
Well, the Win/Lose view is displayed again all right. Unfortunately, it's completely blank now!
I tried various ways of 'redisplaying' the contents, and failed. Ultimately I decided to try a shortcut: instead of trying to redisplay everything, just create a new ViewWinLose(); in the windowAdapter in FControl.java. That seemed to work at first...the Win/Lose view appeared again and looked like it should. At least almost...
However, the match win/loss statistics kept increasing after every sideboarding. Of course - since they are recalculated in the populate function in GauntletWinLose. To solve this, I split the ViewWinLose constructor into two different constructors (a "()" version and a "(boolean)" version which allows me to tell the constructor that a new game was not played) plus a separate init function to do most of the stuff. Now the statistics didn't change every time a new view was created.
But I seem to have run into a more fundamental problem. After sideboarding & exiting the editor, the program seems to lose track of the game status and forget that we were in the middle of a match. (Or just completed one.) If you hit press 'Continue' now, you always get game "1 of 3" and after that game, no matter whether you win or lose, you always get "Won: 0, Lost: 0".
Please tell me I've been trying to do this the hard way and there's an easier way that I just can't figure out...
Re: Sealed Deck development part 2
by friarsol » 14 Sep 2012, 12:08
Why not wait until the person presses continue on the screen and then ask if they want to Sideboard anything?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Sealed Deck development part 2
by RumbleBBU » 14 Sep 2012, 12:45
Not a bad idea...just tried that.
The main problem with that approach seems to be that since the deck editor process is launched concurrently, the game meanwhile proceeds to the actual game with your old deck (since you pressed Continue/Next Round/Restart). I think I might be able to find a way around that, though.
Addendum - yes! I think I've made it work now, like you suggested. Thanks, Sol!
I will need to test it a bit more (and clean up the code) before I dare to commit anything, though.
Addendum2 - good thing I decided to test it first. It seems that in certain circumstances (as yet unknown) the code will spawn an indefinite number of new games after you exit the sideboard editor...
The main problem with that approach seems to be that since the deck editor process is launched concurrently, the game meanwhile proceeds to the actual game with your old deck (since you pressed Continue/Next Round/Restart). I think I might be able to find a way around that, though.
Addendum - yes! I think I've made it work now, like you suggested. Thanks, Sol!
I will need to test it a bit more (and clean up the code) before I dare to commit anything, though.
Addendum2 - good thing I decided to test it first. It seems that in certain circumstances (as yet unknown) the code will spawn an indefinite number of new games after you exit the sideboard editor...
Re: Sealed Deck development part 2
by RumbleBBU » 14 Sep 2012, 18:11
NOT finding a solution. I'm starting to think that adding a 'Gauntlet' listener to FControl.java (for when you exit the deck editor) is not working like I thought it would. Currently it's returning to GauntletWinLose (after clicking Continue/Next Round) to perform the final rites, and unexpected stuff arises like extra games spawned.
Maybe I should call the deck editor after the onContinue function stuff has been done - but if I do that, where should I go (what should I do) when the deck editor exits?
Maybe I should call the deck editor after the onContinue function stuff has been done - but if I do that, where should I go (what should I do) when the deck editor exits?
Re: Sealed Deck development part 2
by moomarc » 14 Sep 2012, 20:48
I'm not an experienced coder by any means so forgive me if I'm completely off-base, but wouldn't it be easier to use a modified version of Sol's dual list box instead of a full new editor. Just move the fifteen cards you want to swap out across, then replace those with the sideboard cards.
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Sealed Deck development part 2
by friarsol » 14 Sep 2012, 23:12
We could definitely add a sideboard mode to dual lost box. It should be much easier than dealing with the deck editor and it does force the calling object to wait for it to finish
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Sealed Deck development part 2
by RumbleBBU » 15 Sep 2012, 16:42
Well, if somebody wants to give it a try it with dual listboxes, be my guest...
ATM, I'm slightly frustrated with sideboarding after two failed attempts (both of which took quite a bit of work). I think I'll work on something different next.
ATM, I'm slightly frustrated with sideboarding after two failed attempts (both of which took quite a bit of work). I think I'll work on something different next.
Re: Sealed Deck development part 2
by friarsol » 15 Sep 2012, 17:33
Yea sideboarding is quite an endeavor. One of the reasons I started doing the Dual List Box was to see if I could get Sideboarding working, but figured I wouldn't be taking a look at it for another month or so. I should be able to add some code into DLB to have better support for using it with sideboards.RumbleBBU wrote:Well, if somebody wants to give it a try it with dual listboxes, be my guest...
ATM, I'm slightly frustrated with sideboarding after two failed attempts (both of which took quite a bit of work). I think I'll work on something different next.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Sealed Deck development part 2
by Max mtg » 16 Sep 2012, 14:49
Just two options: continue with the same deck or change deck and continue (quit and restart don't involve deck changes anyway)friarsol wrote:Why not wait until the person presses continue on the screen and then ask if they want to Sideboard anything?
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: Sealed Deck development part 2
by RumbleBBU » 18 Sep 2012, 10:34
Told you I'd be working on something different next...
Here's what I've been doing since I gave up (at least for now) the sideboarding development, another Sealed Deck enhancement I've long dreamed of: MetaSets! The basic idea is that instead of adding a regular card set to your fantasy block, you could add a special "set" that generates a booster based on a) the combined cardpool of several sets, b) a custom cardpool (a cube), or c) the full cardpool available in the game. The following comment perhaps explains it best:
When this is finished, you could have a sealed deck game where all players receive, for example, an M13 starter pack, one booster from the full cardpool, one booster from the combined cardpool of (e.g.) the Mirrodin block, and one booster from the juzamjedi cube. Only your imagination will limit the cardbase available in your sealed deck games!
Here's what I've been doing since I gave up (at least for now) the sideboarding development, another Sealed Deck enhancement I've long dreamed of: MetaSets! The basic idea is that instead of adding a regular card set to your fantasy block, you could add a special "set" that generates a booster based on a) the combined cardpool of several sets, b) a custom cardpool (a cube), or c) the full cardpool available in the game. The following comment perhaps explains it best:
- Code: Select all
/**
* The class MetaSet. This class is used to define 'special'
* sets within a (fantasy) block, like custom sets (cubes),
* combination sets (sub-blocks), and full cardpool.
*
* NOTE: The format of a MetaSet definition is as follows
* (in a blocks definition file):
*
* "MetaX A/B/C"
*
* where "X" is an integer from 0...8 (just like for sets)
*
* "A" is either "cube", "meta", or "full".
*
* "full" uses all available cards for this booster, just like
* the full cardpool option. The values of "B" and "C" are not
* relevant ("B" is not used at all, and the displayed name is
* always "*FULL").
*
* "meta" uses a cardpool that is combined from several
* editions. The parameter "B" is a list of 3-letter
* edition codes, separated with commas, e.g.
* "2ED,ARN,ATQ". The parameter "C" is the name
* that is displayed for this meta-booster in the
* set selection menu.
*
* "cube" uses a previously defined custom sealed deck
* deck cube as the cardpool for this booster. The cube
* definition file must be in res/sealed/ and have a
* ".sealed" extension. The related .dck file must be
* in the res/decks/cube directory.
* "B" is the name of the cube definition file without
* the ".sealed" extension, e.g. "juzamjedi".
* "C" is the name that is displayed for this meta-booster
* in the set selection menu.
*
*/
When this is finished, you could have a sealed deck game where all players receive, for example, an M13 starter pack, one booster from the full cardpool, one booster from the combined cardpool of (e.g.) the Mirrodin block, and one booster from the juzamjedi cube. Only your imagination will limit the cardbase available in your sealed deck games!
52 posts
• Page 2 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 8 guests