Automatic deck creator ?
Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!
PLEASE DO NOT REPORT BUGS HERE!
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
Automatic deck creator ?
by Gargaroz » 04 Mar 2012, 14:00
I was wondering : has anyone attempted to make an external utility that converts a csv-like file with a deck list in a standard format to a .dck file ?
I'm planning to add an avatard-like card that would do that in game, but if someone could do it as external program, I wouldn't bother.
I'm planning to add an avatard-like card that would do that in game, but if someone could do it as external program, I wouldn't bother.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Automatic deck creator ?
by Dave » 04 Mar 2012, 19:25
Doesn't seem that difficult to me. As long as the csv order of columns doesn't change.
You have an example of which csv to convert?
You have an example of which csv to convert?
Re: Automatic deck creator ?
by Gargaroz » 05 Mar 2012, 01:05
I was thinking something like this :
Llanowar Elves;4
Forest;56
The program will read a file called "custom_deck.txt" and produce "custom_deck.dck". We could add a graphic shell later.
In this way, one could easily copy a decklist from the net, make some simply arrangements and then directly convert that into a playable deck, without the hassle of making it thru the Deck Editor.
Llanowar Elves;4
Forest;56
The program will read a file called "custom_deck.txt" and produce "custom_deck.dck". We could add a graphic shell later.
In this way, one could easily copy a decklist from the net, make some simply arrangements and then directly convert that into a playable deck, without the hassle of making it thru the Deck Editor.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Automatic deck creator ?
by stassy » 05 Mar 2012, 04:15
Well, by random google searching you often get this deck sort like this :
http://www.mtgvault.com/ViewDeck.aspx?DeckID=301005
http://www.magic-league.com/deck/76121/ ... Wins117161
http://www.mtgdecks.net/decks/view/2698 ... e_the_fold
http://magic.tcgplayer.com/db/deck.asp?deck_id=985661
http://www.moxdiamond.com/Magic-The-Gat ... Deck-.html
The number is before the card name, and on some case you even get different deck software format, the most useful I see is the printable one.
http://www.mtgvault.com/ViewDeck.aspx?DeckID=301005
http://www.magic-league.com/deck/76121/ ... Wins117161
http://www.mtgdecks.net/decks/view/2698 ... e_the_fold
http://magic.tcgplayer.com/db/deck.asp?deck_id=985661
http://www.moxdiamond.com/Magic-The-Gat ... Deck-.html
The number is before the card name, and on some case you even get different deck software format, the most useful I see is the printable one.
- stassy
- Moderator
- Posts: 5274
- Joined: 25 Feb 2009, 07:06
- Has thanked: 471 times
- Been thanked: 337 times
Re: Automatic deck creator ?
by CirothUngol » 05 Mar 2012, 13:41
Hmm... I'm about to release the PDAnalyser v0.2 which already converts Apprentice, MagicWorkStation, OCTaGoN and MtG:IE decks to Manalink's PlayDeck format. I looked at the links that stassy provided and a simple copy\paste provides this:
This, however, is a good idea. I'll try to work it in before release.
- Code: Select all
2x Sensei's Divining Top
2x Elixir of Immortality
Enchantments
2x Cast Through Time
Land
4x Underground Sea
2x Strip Mine
2x The Tabernacle at Pendrell Vale
3x Cabal Coffers
2x Urborg, Tomb of Yawgmoth
5x Island
5x Swamp
Spells
2x Choice of Damnations
3x Glimpse the Unthinkable
4x Demonic Tutor
4x Dark Ritual
3x Extirpate
2x Damnation
3x Bitter Ordeal
2x Profane Command
3x Thoughtseize
2x Nightmare Incursion
3x Sadistic Sacrament
4x Counterspell
-----
3 Venser, the Sojourner
3 Unburial Rites
1 Ratchet Bomb
2 Oblivion Ring
3 Mana Leak
4 Faithless Looting
4 Desperate Ravings
2 Day of Judgment
3 Sun Titan
3 Stonehorn Dignitary
3 Phantasmal Image
1 Inferno Titan
2 Elesh Norn, Grand Cenobite
1 Swamp
4 Sulfur Falls
4 Seachrome Coast
2 Plains
2 Mountain
2 Island
2 Ghost Quarter
4 Evolving Wilds
3 Clifftop Retreat
2 Whipflare
-----
2 Leonin Relic-Warder
2 Grand Abolisher
3 Fiend Hunter
4 Hero of Bladehold
3 Mirran Crusader
4 Doomed Traveler
2 Loyal Cathar
4 Champion of the Parish
2 Geist of Saint Traft
Instant [2]
2 Mana Leak
Enchantment [8]
2 Oblivion Ring
4 Honor of the Pure
2 Angelic Destiny
Artifact [1]
1 Sword of War and Peace
Land [23]
11 Plains
4 Glacial Fortress
4 Seachrome Coast
4 Moorland Haunt
-----
2 Copper Myr
2 Gold Myr
2 Iron Myr
2 Leaden Myr
4 Myr Battlesphere
4 Myr Galvanizer
2 Palladium Myr
2 Silver Myr
4 Steel Overseer
Creatures [24]1 Darksteel Forge
4 Myr Matrix
2 Myr Reservoir
4 Myr Turbine
2 Storage Matrix
2 Temple Bell
4 Thoughtcast
2 Unwinding Clock
2 Voltaic Key
Spells [23]2 Ancient Den
4 Darksteel Citadel
2 Great Furnace
8 Island
4 Seat of the Synod
2 Tree of Tales
2 Vault of Whispers
-----
Interrupts
4
Mindcrank
Enchantments
4
Bloodchief Ascension
Instants
4
Lightning Bolt
4
Searing Blaze
4
Incinerate
3
Terminate
Sorceries
4
Sign in Blood
2
Earthquake
4
Bump in the Night
2
Blightning
2
Pyroclasm
1
Demonfire
Creatures
4
Grim Lavamancer
Lands
4
Dragonskull Summit
8
Mountain
3
Terramorphic Expanse
6
Swamp
This, however, is a good idea. I'll try to work it in before release.
"I thought the day had brought enough horrors for our ragged band, but the night was far worse."
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-
CirothUngol - Programmer
- Posts: 431
- Joined: 13 May 2009, 21:34
- Location: Gulf Coast, Texas, USA
- Has thanked: 106 times
- Been thanked: 108 times
Re: Automatic deck creator ?
by Gargaroz » 05 Mar 2012, 14:26
Yup, perhaps is truly better with the number before the name, something like "number;card name".
@ Cirith Ungol : the problem is that you'll need to import cards.dat (pure raw data) to be able to know the ID of the cards, which is needed for the .dck format. If you're able to do that, just add that feature to your program.
@ Cirith Ungol : the problem is that you'll need to import cards.dat (pure raw data) to be able to know the ID of the cards, which is needed for the .dck format. If you're able to do that, just add that feature to your program.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Automatic deck creator ?
by CirothUngol » 01 Apr 2012, 20:08
Is this still requested? Is anyone working on it?
I recently discovered the LibertyBASIC Booster that will automatically convert my JustBASIC program to and compile it in BBC BASIC to a single .exe with a packed-in runtime. This reduces the PDAnalyser from 10 files @ 2.9Mb to 1 file @ 158Kb. Nearly all aspects of the program run 2-3 times faster... except for the main "Rebuild Playdecks" routine, which runs 2-3 times slower. However, converting a single PlayDeck should be plenty fast.
I wrote some routines a few months ago to read the Pre-2K-limit Cards.dat, with the goal of documenting the DAT format and converting the early Cards.dat to CSV. The new format looks similar enough for me to use those because all I currently read from the CSV is CardID#, CardName, CardColor and CodedStatus. I've found and identified all of the earlier Manalink.csv values except for the CodedStatus. Is this value stored in the Cards.dat? It's quite necessary, since you don't want to use a PlayDeck containing NonCoded cards. Otherwise, this could be very doable. I could insert some commandline options for GUI On\Off, LogFile On\Off, FileName In\Out, etc.
Please let me know if you know where to find the CodedStatus in the Card.dat and if you'd like me to put this together.
I recently discovered the LibertyBASIC Booster that will automatically convert my JustBASIC program to and compile it in BBC BASIC to a single .exe with a packed-in runtime. This reduces the PDAnalyser from 10 files @ 2.9Mb to 1 file @ 158Kb. Nearly all aspects of the program run 2-3 times faster... except for the main "Rebuild Playdecks" routine, which runs 2-3 times slower. However, converting a single PlayDeck should be plenty fast.
I wrote some routines a few months ago to read the Pre-2K-limit Cards.dat, with the goal of documenting the DAT format and converting the early Cards.dat to CSV. The new format looks similar enough for me to use those because all I currently read from the CSV is CardID#, CardName, CardColor and CodedStatus. I've found and identified all of the earlier Manalink.csv values except for the CodedStatus. Is this value stored in the Cards.dat? It's quite necessary, since you don't want to use a PlayDeck containing NonCoded cards. Otherwise, this could be very doable. I could insert some commandline options for GUI On\Off, LogFile On\Off, FileName In\Out, etc.
Please let me know if you know where to find the CodedStatus in the Card.dat and if you'd like me to put this together.
"I thought the day had brought enough horrors for our ragged band, but the night was far worse."
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-
CirothUngol - Programmer
- Posts: 431
- Joined: 13 May 2009, 21:34
- Location: Gulf Coast, Texas, USA
- Has thanked: 106 times
- Been thanked: 108 times
Re: Automatic deck creator ?
by Dave » 01 Apr 2012, 21:16
Why don't you just read from the csv ? The order of the columns (and their meaning) will not change overnight, otherwise Gargaroz can't create the cards.dat anymore
Re: Automatic deck creator ?
by CirothUngol » 02 Apr 2012, 00:37
There is a push to use only the Cards.dat for all operations, as I believe all the current Manalink executables have removed all dependency on the CSV, making it officially unnecessary for the program to run.
I can agree to this, but only if one of the dat files contain the Coded\NonCoded information.Otherwise, no one can do this without the Manalink.csv. Mystery solved by Snako.
I can agree to this, but only if one of the dat files contain the Coded\NonCoded information.
Last edited by CirothUngol on 04 Apr 2012, 02:11, edited 1 time in total.
"I thought the day had brought enough horrors for our ragged band, but the night was far worse."
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-
CirothUngol - Programmer
- Posts: 431
- Joined: 13 May 2009, 21:34
- Location: Gulf Coast, Texas, USA
- Has thanked: 106 times
- Been thanked: 108 times
Re: Automatic deck creator ?
by Gargaroz » 03 Apr 2012, 13:03
As I already wrote in the other thread, ask Mok.
And of course this will be a great feature, even if you cannot get in touch with Mok try to finish it and then add a disclaimer which state clear that you can convert succesfully only deck with all cards coded.
And of course this will be a great feature, even if you cannot get in touch with Mok try to finish it and then add a disclaimer which state clear that you can convert succesfully only deck with all cards coded.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Automatic deck creator ?
by CirothUngol » 05 Apr 2012, 18:31
Good news! I found the issue with LibertyBASIC Booster that was slowing down my app, and now the PDAnalyser is a single executable that's 20 times smaller and 5 times faster than the original. Assuming that the info in the new Cards.dat is in the same places as the old one, I'll just need to get some parameters before trying to make this little program.
Where will the executable to located? In the main Magic Program folder? If so, using the entire PDAnalyser might not be a good idea since it makes lots of folders and uses the "PlayDeck" folder for importing decks... it probably shouldn't be ran from the Main Program folder. Have you looked at the PDAnalyser? Check out the "Import NetDeck" option in the menu... I've already built a GUI for this sorta thing. It currently makes a "NetDeck" folder and writes everything in there (original text file, Apprentice.dec, Manalink.dck and a LogFile). I thought I might strip out just the NetDeck Dialog and add some commandline options like I mentioned earlier. Whadda think?
Also, where will the custom_deck.txt be and where should the custom_deck.dck go? I'll leave these as default filenames, but may install an option to name the folder\filename specifically just for forward compatibility. Currently, the NetDeck Dialog uses the format "CardQty<SPACE>CardName", but I can also create a commandline switch to use a different delimeter (eg ";").
Lemme know what you think and I'll start putting it together next week. Go grab the PlayDeck Analyser and check out the NetDeck Dialog to see if I should try to add\change anything.
Where will the executable to located? In the main Magic Program folder? If so, using the entire PDAnalyser might not be a good idea since it makes lots of folders and uses the "PlayDeck" folder for importing decks... it probably shouldn't be ran from the Main Program folder. Have you looked at the PDAnalyser? Check out the "Import NetDeck" option in the menu... I've already built a GUI for this sorta thing. It currently makes a "NetDeck" folder and writes everything in there (original text file, Apprentice.dec, Manalink.dck and a LogFile). I thought I might strip out just the NetDeck Dialog and add some commandline options like I mentioned earlier. Whadda think?
Also, where will the custom_deck.txt be and where should the custom_deck.dck go? I'll leave these as default filenames, but may install an option to name the folder\filename specifically just for forward compatibility. Currently, the NetDeck Dialog uses the format "CardQty<SPACE>CardName", but I can also create a commandline switch to use a different delimeter (eg ";").
Lemme know what you think and I'll start putting it together next week. Go grab the PlayDeck Analyser and check out the NetDeck Dialog to see if I should try to add\change anything.
"I thought the day had brought enough horrors for our ragged band, but the night was far worse."
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-
CirothUngol - Programmer
- Posts: 431
- Joined: 13 May 2009, 21:34
- Location: Gulf Coast, Texas, USA
- Has thanked: 106 times
- Been thanked: 108 times
Re: Automatic deck creator ?
by Gargaroz » 06 Apr 2012, 13:44
Yup, a separate folder will be the best. There's already too much stuff in the main Magic folder.
A command line like "pdanalyser -c (as "convert") netdeck.txt" will be great. I also suggest you to copy the original filename and only change the extension (so, "t2_pod.txt" will became "t2_pod.dck"), this will save us the time to rename.
This utility will have a greater usage, as with the upcoming patch the set location in Manalink.csv is slightly altered (especially for recent sets), so probably many user will found their deck screwed.
This was a bitter decision to take, but it'll be an one-time medicine, I promise you (unless we have to "compact" the database for space, but this will happend in a distant future).
When this tool will be stable enough, I want to add it to the standard patch structure, are you OK with this ?
A command line like "pdanalyser -c (as "convert") netdeck.txt" will be great. I also suggest you to copy the original filename and only change the extension (so, "t2_pod.txt" will became "t2_pod.dck"), this will save us the time to rename.
This utility will have a greater usage, as with the upcoming patch the set location in Manalink.csv is slightly altered (especially for recent sets), so probably many user will found their deck screwed.
This was a bitter decision to take, but it'll be an one-time medicine, I promise you (unless we have to "compact" the database for space, but this will happend in a distant future).
When this tool will be stable enough, I want to add it to the standard patch structure, are you OK with this ?
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Automatic deck creator ?
by CirothUngol » 20 Apr 2012, 13:26
Sure, I was hoping it would prove useful. I've added a commandline routine that skips the GUI and acts as you describe (currently, the only commands are \? and \c). If you don't provide a path, it will look for the file in the current folder. Either way, it produces the .dck in the same folder as the .txt file. It will load the settings from the .ini file and use whatever settings you had the last time the GUI was used, and it still produces a NameOfDeck.log so you can see what it did.When this tool will be stable enough, I want to add it to the standard patch structure, are you OK with this ?
The "compiled" version is much quicker without the GUI, but it still takes a couple of seconds to load the Cards.dat before processing the PlayDeck, so I might have it produce it's own .vod file to speed-up loading (it would check to see if the Cards.dat has changed, and produce a new .vod file if it has).
Should I keep the folder name as "PlayDeckAnalyser"? It's not too long and places the folder just below the "PlayDeck" folder in the directory listing (which is nice). It also only does 1 .dck file at a time in CommandLine mode... I'm assuming this is the desired behavior. Are there any other commands/switches you think may be useful?
Also, is there any way to determine if a Challenge Card is still locked? If not, can the list of Challenge Cards be found in a DAT\CSV somewhere? With the latest Manalink Update I get tons of PlayDecks with no NonCoded cards (over 2500), but many contain locked challenge cards and I'd like to be able to filter those as well.
Work has been kicking my butt this week so I haven't had any time to play with this, but I hope to finish a few things on it this weekend and start getting it ready for a v0.3 release before I try to tackle a few big issues with the app... like completely re-writing the ignorant way I've implimented the Banned\Restricted\Substitute lists. It'll be quicker, easier, more versatile and make more sense, but it'll take some time.
"I thought the day had brought enough horrors for our ragged band, but the night was far worse."
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-
CirothUngol - Programmer
- Posts: 431
- Joined: 13 May 2009, 21:34
- Location: Gulf Coast, Texas, USA
- Has thanked: 106 times
- Been thanked: 108 times
Re: Automatic deck creator ?
by Gargaroz » 27 Apr 2012, 13:18
As for the cards locked, if you're familiar with C code check the "is_unlocked" function in "src\bin\functions\challenge_mode.c".
For the rest, it's all OK for now
For the rest, it's all OK for now

----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Automatic deck creator ?
by CirothUngol » 28 Apr 2012, 05:26
I'm actually quite unfamiliar with C and the entire OOP paradigm (although I did use a little Pascal in the '80s), but I understand enough to see how it works. Thanx for pointing me to the right piece of code (I had to install Code::Blocks just so I could read it). ^_^
This is one of several things that'll have to wait until I re-write the Ban\Rest\Sub part of the app... it won't make it into v0.3. Again, thanx for the helpful info.
Edit-
Just a heads-up, the new version of PDAnalyser is available here.
This is one of several things that'll have to wait until I re-write the Ban\Rest\Sub part of the app... it won't make it into v0.3. Again, thanx for the helpful info.
Edit-
Just a heads-up, the new version of PDAnalyser is available here.
"I thought the day had brought enough horrors for our ragged band, but the night was far worse."
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-Lucilde Fiksdotter
Shandalar 2012 Revisited
Magic: The Gathering Abandonware
-
CirothUngol - Programmer
- Posts: 431
- Joined: 13 May 2009, 21:34
- Location: Gulf Coast, Texas, USA
- Has thanked: 106 times
- Been thanked: 108 times
15 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 10 guests