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

Complete: Deck set assignment deck converter

Post MTG Forge Related Programming Questions Here

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

Re: Complete: Deck set assignment deck converter

Postby Diogenes » 05 May 2013, 21:51

Hi Xitax. I tried your latest build (still doesn't work on Vista, unfortunately,) and it looks like mtg-data.txt is corrupted somehow (7zip tells me that it has an unsupported compression format, all the other files extract correctly - downloaded twice to make sure.) The mtg-data.txt in your April 18 archive extracts without a problem.

Out of curiosity, how hard would it be to integrate this functionality into Forge itself?

Thanks for doing this, and continuing to support it. :)
Diogenes
 
Posts: 201
Joined: 12 Jul 2012, 00:54
Has thanked: 39 times
Been thanked: 23 times

Re: Complete: Deck set assignment deck converter

Postby Xitax » 06 May 2013, 07:16

Diogenes wrote:Hi Xitax. I tried your latest build (still doesn't work on Vista, unfortunately,) and it looks like mtg-data.txt is corrupted somehow (7zip tells me that it has an unsupported compression format, all the other files extract correctly - downloaded twice to make sure.) The mtg-data.txt in your April 18 archive extracts without a problem.

Out of curiosity, how hard would it be to integrate this functionality into Forge itself?

Thanks for doing this, and continuing to support it. :)
Ok, I've updated the archive in the last post.

As to your Vista problem, I think the .exe probably only will work on a x64 Windows because it used datafiles from a x64 version of strawberry perl. If there's some demand, I might try to get a x32 executable compiled.

Integration into Forge? That would be cool, but I don't have the programming chops. The logic is pretty straightforward, though.
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Re: Complete: Deck set assignment deck converter

Postby Xitax » 11 May 2013, 20:42

Repackaged for 32-bit and all Windows with Par::Packer. This version should work better for all Windows users. The previous version only worked for x64 Windows. :)

| Open
Updated to deal with split cards and some other things.

I've decided to maintain my own datafiles, so mtg-data and setdata are now no longer the same as the files that are used elsewhere.

For anyone new: This Perl script assigns sets to Forge deck files. It finds the earliest date at which all cards could have been printed and assigns each card the nearest printing to that date. Generally, it produces a realistic set assignment for any extended or limited deck, probably less realistic for decks whose cards span the whole range.
TO use: Unzip somewhere. Put deck files into the folder with it and run decksetfix. If you can't run it, you can run the Perl script (requires Perl, obv). Converted decks will be in /output.
Gotchas - Some errors I've seen crop up:
-extra blank lines at the end of deck files mess it up
-[main] and [sideboard] must be the last two sections in the deck file. I may fix at some point, but all the decks I've converted only a few were not that way.
-Case sensitivity: All card names are case sensitive. I've seen misspelled cards in the past.
Last edited by Xitax on 09 Aug 2013, 01:18, edited 1 time in total.
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Re: Complete: Deck set assignment deck converter

Postby Diogenes » 11 May 2013, 21:48

Thank you Xitax! It works perfectly.

This solves my issue where only one land image shows up per basic land type (honestly, I should write this up again today. I'll do that in a bit.) Ever since 12.11 or so I have had the choice of either seeing one image per basic land per game or checking the "randomize card art" option and getting all the basics from one set but all other cards are completely random. The "randomize card art" option doesn't pull random art if a card is specified to be in a certain set in the decklist, so now I can leave the option on and get all 5 basics along with all the cards displaying images from the proper set.

Again, thank you Xitax!
Diogenes
 
Posts: 201
Joined: 12 Jul 2012, 00:54
Has thanked: 39 times
Been thanked: 23 times

Re: Complete: Deck set assignment deck converter

Postby Diogenes » 12 May 2013, 21:58

An extra empty line at the end of a decklist causes Decksetfix problems. If it tries to process a file with any extra lines, it keeps spitting out the following three messages endlessly:

Use of uninitialized value $temp2 in index at script/decksetfix.pl line 173.
Use of uninitialized value $temp2 in substr at script/decksetfix.pl line 173.
substr outside of string at script/decksetfix.pl line 173.

Thanks again for making a 32-bit build, I've been enjoying it immensely. :)
Diogenes
 
Posts: 201
Joined: 12 Jul 2012, 00:54
Has thanked: 39 times
Been thanked: 23 times

Re: Complete: Deck set assignment deck converter

Postby Xitax » 13 May 2013, 05:22

Thanks for the bug report. 8) It's a known issue. I haven't gotten around to fixing it because only a few of gos' deck files had this.

I was motivated to create this script for the same reasons - I got tired of seeing the same lands and set assignments all the time.
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Re: Complete: Deck set assignment deck converter

Postby Xitax » 09 Aug 2013, 01:17

Update for MMA and M14
Last edited by Xitax on 30 Sep 2013, 02:42, edited 1 time in total.
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Re: Complete: Deck set assignment deck converter

Postby Marek14 » 09 Aug 2013, 06:08

I wonder if it would be a good idea to add the FTV sets as Reprint sets. Maybe not Duel Decks, since those cards could be simply assigned to their relevant decks, but FTV might have its place.
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times

Re: Complete: Deck set assignment deck converter

Postby Marek14 » 09 Aug 2013, 07:13

OK, I decided to try and make a setdata file that would actually support all sets in Forge including the minor ones.
Changes:
1. Swapped Portal: Second Age and Exodus. The ordering in deck editor puts P2 first, plus: P2 cards don't have color-coded expansion symbols and collector numbers, both innovations that started with Exodus.
2. Swapped Portal: Three Kingdoms and Urza's Destiny. PTK is mentioned to be in 1999-05 while Urza's Destiny has release1 date as 1999-06-07, definitely after.
3. Swapped Starter 2000 and Prophecy. Prophecy is recorded as 2000-06-05 while Starter 2000 is 2000-07

Elves vs. Goblins inserted between Lorwyn/Morningtide
From the Vault: Dragons inserted between Eventide/Shards of Alara
Jace vs. Chandra inserted between Shards of Alara/Conflux
Divine vs. Demonic inserted between Conflux/Alara Reborn
From the Vault: Exiled and Planechase inserted between Magic 2010/Zendikar
Garruk vs. Liliana and Slivers inserted between Zendikar/Worldwake
Phyrexia vs. the Coalition inserted between Worldwake/Rise of the Eldrazi
Archenemy inserted between Rise of the Eldrazi/Magic 2011
From the Vault: Relics and Elspeth vs. Tezzeret inserted between Magic 2011/Scars of Mirrodin
Fire and Lightning inserted between Scars of Mirrodin/Mirrodin Besieged
Knights vs. Dragons inserted between Mirrodin Besieged/New Phyrexia
From the Vault: Legends and Ajani vs. Nicol Bolas inserted between Magic 2012/Innistrad
Graveborn inserted between Innistrad/Dark Ascension
Venser vs. Koth inserted between Dark Ascension/Avacyn Restored
From the Vault: Realms and Izzet vs. Golgariˇ inserted between Magic 2013/Return to Ravnica
Commander's Arsenal inserted between Return to Ravnica/Gatecrash
Sorin vs. Tibalt inserted between Gatecrash/Dragon's Maze

Set data for Sorin vs. Tibalt added to your mtg-data.txt

Do the set numbers have to be consecutive? If they don't have to be, people could mix-and-match their favorite sets simply by deleting the unwanted lines.

As an aside, following special sets are currently missing from Forge: Beatdown, Battle Royale. Perhaps Anthologies?
Attachments
modified.zip
(260.93 KiB) Downloaded 308 times
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times

Re: Complete: Deck set assignment deck converter

Postby Max mtg » 09 Aug 2013, 10:54

consider using the edition description files provided by the forge itself.
You might event want to use the code that reads the edition files into classes
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: Complete: Deck set assignment deck converter

Postby Xitax » 10 Aug 2013, 00:47

The file simply reads the sets in by order in the file. It assumes new sets are lower down than old sets, so sets at the top will get assigned first but overwritten by reprints from sets read in later. If you wanted a different set preference, you'd just change the order of the sets as you did. Currently I hadn't added in any of the Duel Deck or PDS sets simply because I don't prefer to see them, but you're welcome to do as you please with it.

Some of the set order swaps you did wouldn't make any difference because the two sets don't have any common cards, if you see what I mean.

I haven't changed the layout or the file source because I don't really have a compelling reason to.
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Re: Complete: Deck set assignment deck converter

Postby Marek14 » 16 Aug 2013, 20:56

One change that should be definitely made, though: TSB should be before TSP. When it's after, decks made purely of Time Spiral cards will use old versions of the TSB reprints.
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times

Re: Complete: Deck set assignment deck converter

Postby Xitax » 17 Aug 2013, 17:16

That's a good point. I'll swap those 2 positions.
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Re: Complete: Deck set assignment deck converter

Postby Xitax » 30 Sep 2013, 02:43

Update for Theros.
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Re: Complete: Deck set assignment deck converter

Postby Xitax » 10 Nov 2013, 22:08

Update for Commander 2013
Attachments
decksetfix.zip
(1.54 MiB) Downloaded 289 times
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 54 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form