It is currently 29 Oct 2025, 23:06
   
Text Size

new deck file format

Post MTG Forge Related Programming Questions Here

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

new deck file format

Postby silly freak » 30 Oct 2009, 10:25

that's my suggestion for the deck format:
Code: Select all
Deckname
[general]
constructed
[main]
20 Plains
38 Squire
1 Absolute Grace
Absolute Law
[sideboard]
Every deck starts with a deck name, then come three sections: [general] for the format, [main] for the main deck, [sideboard] for the sideboard. the last one is obviously empty in this example.
The cards are there as a number, a space and the name. If there's no number, it's assumed as one.
what do you think about individual files for each deck, or should it all be in one file?

also, i'm not sure about booster decks. does every one of the 8 decks have a name, or not?
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: new deck file format

Postby Marek14 » 30 Oct 2009, 10:34

silly freak wrote:that's my suggestion for the deck format:
Code: Select all
Deckname
[general]
constructed
[main]
20 Plains
38 Squire
1 Absolute Grace
Absolute Law
[sideboard]
Every deck starts with a deck name, then come three sections: [general] for the format, [main] for the main deck, [sideboard] for the sideboard. the last one is obviously empty in this example.
The cards are there as a number, a space and the name. If there's no number, it's assumed as one.
what do you think about individual files for each deck, or should it all be in one file?

also, i'm not sure about booster decks. does every one of the 8 decks have a name, or not?
I would definitely add a comment rule (like "lines starting with // are ignored") to allow things like commenting on individual cards in deck etc.
Marek14
Tester
 
Posts: 2774
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times

Re: new deck file format

Postby silly freak » 30 Oct 2009, 10:40

comments are a little hard, because currently all decks are written back to the file, and the comment would be dropped. We could add an attribute that takes extra lines before [general], but per card would be hard to store and write back...
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: new deck file format

Postby Chris H. » 30 Oct 2009, 13:52

Rares wants to have deck files as individual text file in version two. He had mentioned wanting to have a comment section for a description. I wonder if Rares has any ideas that might be helpful. It might prevent us from "re-inventing the wheel". :wink:
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: new deck file format

Postby mtgrares » 30 Oct 2009, 17:41

My ideas for version 2 deck file is basically that each deck is stored separately and different directories would hold different "formats" such as sealed, limited, constructed, or anything else that the user wants to create. And to explain this again, there would be a "deck" directory and in that directory it would have the sub-directories "sealed", "limited", "draft" and "constructed". Also, I think that by putting each deck in a separate file would make downloading new decks easy, because the file is downloaded and doesn't have to be added to the "central repository" that holds all decks. AND the user could download a zip file with tons of decks and could easily unzip them into a new directory. (Putting the decks in a new directory would be good because you know that you wouldn't be overwriting any previous decks.)

The user interface (Gui_NewGame and Gui_DeckEditor) would have to be updated to enable the user to change directories.

I've feel that having deck comments would be useful because you could read about a deck that someone else created or make your own comments such as having different versions of the same deck. It would be nice if you could display and edit the comments through the user interface.

If the decks were stored using human, readable plaintext it would be easy to post the decks contents to forums. Currently right now I store the decks in only a computer readable format (I write the Deck object to a HashMap I think, and then write HashMap to the hard drive).

Warning, if you redo MTG Forge's deck system you might have to throw out most (if not all) of the current Deck system. I have done wierd, nastry things to the nice Deck object in order to make it work. On the surface the current Deck class looks very simple but it isn't. In most of the program, I try to use the "higher level" DeckIO class, so if I wanted to update MTG Forge's deck system, I would just write a better DeckIO class.

(This is what I remember that this information may be a little wrong but it will at least point you in the right direction.)

For draft, sealed, and quest I use Deck's object sideboard to hold the total cardpool and I can't remember if the sideboard DOES or DOES NOT include the card that are in the Deck object's main deck. Draft decks are different because they also hold the 8 computer decks that are also generated.

-------------------------------------
And in conclusion, I hope that helps at little. :)

p.s.
You could sideboard during a match if you updated the Deck system to have a sideboard. Gui_WinLose.java would need to have a sideboard button added, Gui_WinLose is what pops up when you win or lose, and Gui_DeckEditor would have to be updated a little.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: new deck file format

Postby mtgrares » 30 Oct 2009, 17:52

Also, i'm not sure about booster decks. does every one of the 8 decks have a name, or not?
No, I forget where I generate the "names" for the computer decks for Gui_NewGame to read, maybe in Gui_BoosterDraft? Also see DeckIO.readBoosterDeck() and writeBoosterDeck() for more details.

You might also want to checkout class BoosterDraft_1 (which is BoosterDraft.java) also controls how the draft works but doesn't do any reading or writing to the hard drive.

And just for kicks check this out from BoosterDraft_1, the blanks is when the user chooses a card.

Code: Select all
  //helps the computer choose which booster packs to pick from
  //the first row says "pick from boosters 1-7, skip 0" since the players picks from 0
  //the second row says "pick from 0 and 2-7 boosters, skip 1" - player chooses from 1
  private final int computerChoose[][] = {
    {  1,2,3,4,5,6,7},
    {0,  2,3,4,5,6,7},
    {0,1,  3,4,5,6,7},
    {0,1,2,  4,5,6,7},
    {0,1,2,3,  5,6,7},
    {0,1,2,3,4,  6,7},
    {0,1,2,3,4,5,  7},
    {0,1,2,3,4,5,6  }
  };
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: new deck file format

Postby silly freak » 01 Nov 2009, 20:42

yeah, that looks nice^^
i've looked it up, only the human deck has the name.
my structure now looks like this:
a normal (constructed/sealed) deck is a single file, ending with ".dck"
a booster draft is a directory ending with ".bdk", and containing files 0.dck to 7.dck, where 0.dck is the player's deck, which contains the human's deck

the .dck files look as described above, with the addition of any number of comment lines between the name and [general]
unfortunately, the comment is currently cleared if you edit a deck, because the deck editor creates a new deck object and discards the old one.
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: new deck file format

Postby silly freak » 08 Nov 2009, 16:44

okay, deck migration is now running and on SVN. maybe that's a reason to release a new beta ;)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: new deck file format

Postby zerker2000 » 08 Nov 2009, 19:27

Since I think I've fixed the reported mana pool bugs, it probably is.
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: new deck file format

Postby DennisBergkamp » 08 Nov 2009, 19:55

I agree, both great reasons :)
Hopefully I'll have time to do it today, otherwise sometime this coming week.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 18 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 18 users online :: 0 registered, 0 hidden and 18 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 18 guests

Login Form