Manalink BETA update : 2000 limit NO MORE !
Posted: 01 Jan 2012, 15:59
And now, for something completely different... The "2000 limit no more" Manalink version ! No, seriously, this is only a "beta" release, everything seems fine, but we still need to test it. In fact, please backup your original Magic folder, just in case something goes wrong.
As Mok reported in the development subforum, our original hopes for a version with 30.000 slots is undoable as now, but we still have this version, which has 16384 (!) slots, which are more that the actually existing magic cards and will suffice for some years of new expansions.
There are some changes in the standard Deckbuilder (new symbols available for Phyrexian mana, XX and more), but the greatest changes are in the way we'll have to edit this version from now on. Unfortunately, the classic SkyMagic editor cannot read correcyly the "exe" part of the new executable, so in this version you'll find a new folder called "magic_updater", in which there are the CSV (in both Excel and CSV version) and another file called "ct_all" (this too in Excel and CSV) that host all the data of the Exe part, which finally undisclose many of the mysteries linked to the infamous "Reserved infos".
So, if you want to change something, just modify the CSV files (or edit their Excel counterparts and then convert them to CSV), doubleclick on the "Magic_updater.bat" and copy to the main Magic directory the files you'll find in the "updated_files" folder. If something goes wrong, check the "ERRORS.txt" (there's everytime something in there, but usually are only harmless differences). You'll notice a new file that is created every time, "cards_id.h" : it's an enumerator file used by the C functions to get the ID of specific files without parsing the entire CSV.
Now, for more infos about the changes, here's directly Mok (aka The Genius) for you :
Manalink.csv is changed a bit. There's a new column that contains text representation of card casting cost. The old "calculated" mana cost was not suitable for many newer cards and things like |X|X|1.
The rest of the file is a bit moved around.
In the first columns, I left the things necessary for the card to work (this ends at legacy effect texts).
Unless you use them in C code, the majority of AI_* columns are *ONLY* used by the non-working sealed deck construction code and are now moved after the important data. These don't need to be filled at all for the card to work, but might be needed if you ever get the original sealed deck part fixed/upgraded. Mana Source Colors isn't used by other code either, but I left it in the "important" side, as it should be used, instead of the lame hardcoded stuff in the original engine.
After these, there's 10 columns of data used only by the deck builder. DB_CardType2, NumOfDBAbilities, and DBAbilities 1-8. These are no longer stored in cards.dat but more about it later.
And at the end, theres 104 columns with expansion rarity. Yes, it's a lot of useless/obsolete "expansions" but since we don't care about a few bytes of memory and all the cards are already filled, there was no need to get rid of them and it made it much easier to convert from gatherer dump. The only expansions that are gone are unhinged and unglued. Promo rarity is at the very end.
csv2dat.exe will now dump 3 .dat files. Cards.dat with the usual stuff, dbinfo.dat with the 10 columns for deck builder and rarity.dat with the expansion rarity. I modified deck builder to load dbinfo.dat already but rarity.dat is currently not used at all. It's format is very simple: it starts with a long int containing the number of cards, then a long int with number of expansions, and then raw data for all cards. Each expansion takes 3 bits, so to calculate the amount of bytes each card uses, you count (number_of_expansions*3+7)/8. I hope it will be usuful for the main code but so far, it's just that, an extra file. The 3-bit rarity is currently defined like this:
NONE = 0
COMMON = 1
UNCOMMON = 2
RARE = 3
MYTHIC = 4
LAND = 5
SPECIAL = 6
value 7 is unused. To get card's original expansion you can simply look for a first non-zero byte and from that get the expansion position. A couple of cards do not have any expansions set though (like goblin tutor, and probably that card from the unreleased expansion, and the data/empty stuff).
There's now 7 extra columns before old Subtype1 and Subtype2. These are new and incompatible with the old subtypes. Originally I planned only to expand old subtypes, but that would only prolong the bugs in the current code like treating other types/subtypes like creature types whenever a card is animated and so on. The "new" definition is in file "stypes.h". The old subtypes are unchanged and currently no code uses new types at all (except deckbuilder to find artifact creatures as you removed creature subtype from artifacts in your versions which was used by the db).
Ok, let's test this !
http://www.mediafire.com/?1h58d4zkvf58x3q
---- BUGS FIXED / IMPROVEMENTS / CARDS RECODED ----
* Fixed code for Consuming Vapors.
* Fixed code and activation cost for Cellar's Door.
* Fixed code for Blazing Torch.
* Fixed code for Dragon Arch
* Fixed code for Memory's Journey
* Fixed code for Angelic Overseer.
* Fixed code for Shriekhorn.
* Fixed code for Gutter Grime.
* Fixed crashing due to Adaptive Automaton when Ai plays it.
* Fixed code for Garruk Relentless.
* Fixed code for Creepy Doll.
* Fixed code for Tree of Redemption.
* Fixed code for Kiln Walker.
* Fixed code for Gaea's Blessing.
* Fixed code for Time Reversal.
* Fixed subtype for tokens of Conqueror's Pledge and Nomads' Assembly.
* Fixed code for Angelic Destiny and Rancor.
* Fixed code for Myr Propagator.
* Fixed code for Elder of Laurels.
* Fixed code for Mortis Dogs.
* Fixed code for Life's Finale.
* Fixed code for Nezumi Shortfag / Stabwhisker the Odious.
* Fixed the interaction between Kozilek's Predator, Nest Invader and Acidic Slime with Torpor Orb.
* Fixed code for Apostle's Blessing.
* Fixed code for Trepanation Blade.
* Fixed code for Ghoulcaller's Chant.
* Fixed code for Sphere of the Suns.
* Fixed code for Oona's Blackguard.
* Fixed code for Cloistered Youth / Unholy Fiend
* Fixed interaction between Phantasmal Image and Fiend Hunter / Faceless Butcher.
* Fixed "false targeting" bug when a Phantasmal Image try to copy another Phantasmal Image.
* Fixed code for Kessig Cagebreakers.
As Mok reported in the development subforum, our original hopes for a version with 30.000 slots is undoable as now, but we still have this version, which has 16384 (!) slots, which are more that the actually existing magic cards and will suffice for some years of new expansions.
There are some changes in the standard Deckbuilder (new symbols available for Phyrexian mana, XX and more), but the greatest changes are in the way we'll have to edit this version from now on. Unfortunately, the classic SkyMagic editor cannot read correcyly the "exe" part of the new executable, so in this version you'll find a new folder called "magic_updater", in which there are the CSV (in both Excel and CSV version) and another file called "ct_all" (this too in Excel and CSV) that host all the data of the Exe part, which finally undisclose many of the mysteries linked to the infamous "Reserved infos".
So, if you want to change something, just modify the CSV files (or edit their Excel counterparts and then convert them to CSV), doubleclick on the "Magic_updater.bat" and copy to the main Magic directory the files you'll find in the "updated_files" folder. If something goes wrong, check the "ERRORS.txt" (there's everytime something in there, but usually are only harmless differences). You'll notice a new file that is created every time, "cards_id.h" : it's an enumerator file used by the C functions to get the ID of specific files without parsing the entire CSV.
Now, for more infos about the changes, here's directly Mok (aka The Genius) for you :
Manalink.csv is changed a bit. There's a new column that contains text representation of card casting cost. The old "calculated" mana cost was not suitable for many newer cards and things like |X|X|1.
The rest of the file is a bit moved around.
In the first columns, I left the things necessary for the card to work (this ends at legacy effect texts).
Unless you use them in C code, the majority of AI_* columns are *ONLY* used by the non-working sealed deck construction code and are now moved after the important data. These don't need to be filled at all for the card to work, but might be needed if you ever get the original sealed deck part fixed/upgraded. Mana Source Colors isn't used by other code either, but I left it in the "important" side, as it should be used, instead of the lame hardcoded stuff in the original engine.
After these, there's 10 columns of data used only by the deck builder. DB_CardType2, NumOfDBAbilities, and DBAbilities 1-8. These are no longer stored in cards.dat but more about it later.
And at the end, theres 104 columns with expansion rarity. Yes, it's a lot of useless/obsolete "expansions" but since we don't care about a few bytes of memory and all the cards are already filled, there was no need to get rid of them and it made it much easier to convert from gatherer dump. The only expansions that are gone are unhinged and unglued. Promo rarity is at the very end.
csv2dat.exe will now dump 3 .dat files. Cards.dat with the usual stuff, dbinfo.dat with the 10 columns for deck builder and rarity.dat with the expansion rarity. I modified deck builder to load dbinfo.dat already but rarity.dat is currently not used at all. It's format is very simple: it starts with a long int containing the number of cards, then a long int with number of expansions, and then raw data for all cards. Each expansion takes 3 bits, so to calculate the amount of bytes each card uses, you count (number_of_expansions*3+7)/8. I hope it will be usuful for the main code but so far, it's just that, an extra file. The 3-bit rarity is currently defined like this:
NONE = 0
COMMON = 1
UNCOMMON = 2
RARE = 3
MYTHIC = 4
LAND = 5
SPECIAL = 6
value 7 is unused. To get card's original expansion you can simply look for a first non-zero byte and from that get the expansion position. A couple of cards do not have any expansions set though (like goblin tutor, and probably that card from the unreleased expansion, and the data/empty stuff).
There's now 7 extra columns before old Subtype1 and Subtype2. These are new and incompatible with the old subtypes. Originally I planned only to expand old subtypes, but that would only prolong the bugs in the current code like treating other types/subtypes like creature types whenever a card is animated and so on. The "new" definition is in file "stypes.h". The old subtypes are unchanged and currently no code uses new types at all (except deckbuilder to find artifact creatures as you removed creature subtype from artifacts in your versions which was used by the db).
Ok, let's test this !
http://www.mediafire.com/?1h58d4zkvf58x3q
---- BUGS FIXED / IMPROVEMENTS / CARDS RECODED ----
* Fixed code for Consuming Vapors.
* Fixed code and activation cost for Cellar's Door.
* Fixed code for Blazing Torch.
* Fixed code for Dragon Arch
* Fixed code for Memory's Journey
* Fixed code for Angelic Overseer.
* Fixed code for Shriekhorn.
* Fixed code for Gutter Grime.
* Fixed crashing due to Adaptive Automaton when Ai plays it.
* Fixed code for Garruk Relentless.
* Fixed code for Creepy Doll.
* Fixed code for Tree of Redemption.
* Fixed code for Kiln Walker.
* Fixed code for Gaea's Blessing.
* Fixed code for Time Reversal.
* Fixed subtype for tokens of Conqueror's Pledge and Nomads' Assembly.
* Fixed code for Angelic Destiny and Rancor.
* Fixed code for Myr Propagator.
* Fixed code for Elder of Laurels.
* Fixed code for Mortis Dogs.
* Fixed code for Life's Finale.
* Fixed code for Nezumi Shortfag / Stabwhisker the Odious.
* Fixed the interaction between Kozilek's Predator, Nest Invader and Acidic Slime with Torpor Orb.
* Fixed code for Apostle's Blessing.
* Fixed code for Trepanation Blade.
* Fixed code for Ghoulcaller's Chant.
* Fixed code for Sphere of the Suns.
* Fixed code for Oona's Blackguard.
* Fixed code for Cloistered Youth / Unholy Fiend
* Fixed interaction between Phantasmal Image and Fiend Hunter / Faceless Butcher.
* Fixed "false targeting" bug when a Phantasmal Image try to copy another Phantasmal Image.
* Fixed code for Kessig Cagebreakers.