2000 cards limit
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
Re: 2000 cards limit
by gmzombie » 05 Dec 2011, 02:04
this is great. i just tried ot and created the cards.dat file and nothing errored out. i cant believe all the cards that were coded..i didnt expect so many.
of course as Mok said it dont work with anything yet..but what we have here friends is the first part of the solution
of course as Mok said it dont work with anything yet..but what we have here friends is the first part of the solution

can I maze of ith your snowstorm?
http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
- gmzombie
- Posts: 857
- Joined: 26 Feb 2009, 01:05
- Location: Wyoming, Mi
- Has thanked: 200 times
- Been thanked: 51 times
Re: 2000 cards limit
by Sonic » 05 Dec 2011, 03:37
What I’ve done is to create a standard coma delimited csv file (AllCards.csv) which should load into any spreadsheet. It contains a single card entry for all the current cards in the manalink.csv files included in the 1st December release (typos, and known parameter errors corrected).gmzombie wrote:anything can help sonic that would be great..so it is a list of all currently created cards in the system?
AllCards.zip: http://www.mediafire.com/?dgk4w3e32unvje1
The file has an extra column to identify which of the csv files the entry was extracted from and the ID field contains its current slot number within the listed file. The file is currently sorted by Full Name entry.
If they are any use to you – I’ve included my current csv files in the archive.
Hope it helps
All the best… Sonic
Working On: Life, the Universe, and Everything.
Re: 2000 cards limit
by 0rion79 » 05 Dec 2011, 06:43
After a short look, few cards are missing but nothing special. They were mostly vanilla cards that may be re-added in a second time.
-
0rion79 - Posts: 1520
- Joined: 24 Feb 2009, 18:33
- Location: Italy
- Has thanked: 94 times
- Been thanked: 61 times
Re: 2000 cards limit
by Sonic » 05 Dec 2011, 09:23
Which ones? Useful to know so I can check for errors.0rion79 wrote:After a short look, few cards are missing but nothing special. They were mostly vanilla cards that may be re-added in a second time.
Working On: Life, the Universe, and Everything.
Re: 2000 cards limit
by 0rion79 » 05 Dec 2011, 09:30
It is not an error, Sonic. It is just an effec of cards replacement in Constructed. While several modders have changed the basic game, replacing weak cards with new ones, some of those replaced cards have NOT been included in the limited version or in any other version and so have been "lost" even if their code is usually active in the DLL. In fact, there is no track of cards from Scalebane's Elite, Abbey Gargoyles, the several "Voice of..." and so on in ANY version of the game.
Still, since there are some players that enjoy sealed, tribe-based and block-based decks, it would be nice to re-add even those cards.
Still, since there are some players that enjoy sealed, tribe-based and block-based decks, it would be nice to re-add even those cards.
-
0rion79 - Posts: 1520
- Joined: 24 Feb 2009, 18:33
- Location: Italy
- Has thanked: 94 times
- Been thanked: 61 times
Re: 2000 cards limit
by Sonic » 05 Dec 2011, 10:59
Ah, with you now.0rion79 wrote:It is not an error, Sonic. It is just an effec of cards replacement in Constructed. While several modders have changed the basic game, replacing weak cards with new ones, some of those replaced cards have NOT been included in the limited version or in any other version and so have been "lost" even if their code is usually active in the DLL. In fact, there is no track of cards from Scalebane's Elite, Abbey Gargoyles, the several "Voice of..." and so on in ANY version of the game.
Still, since there are some players that enjoy sealed, tribe-based and block-based decks, it would be nice to re-add even those cards.
Working On: Life, the Universe, and Everything.
Re: 2000 cards limit
by Sonic » 05 Dec 2011, 11:00
OK, scrub my earlier posted zip – I’ve come up with a better idea.
The naming of the cards with an asterisk (* = currently buggy, or an approximation of the original card) is inconsistent in the manalink.csv files.
Mok’s ‘MakeNewCsv.exe’ can’t take account of cards marked with and asterisk, and so creates duplicate entries. Also the ‘LAST AVAILABLE SLOT’ entry in the manalink files will be included in the output manalink.csv
I originally got round this with my spreadsheet by manually removing the duplicates and the LAST AVAILABLE SLOT entry before producing the ‘AllCards.csv’ file.
Anyway, I’ve now created a set of current manalink.csv files with the asterisk marked cards corrected in all the files, and the LAST AVAILABLE SLOT entries removed - Mok’s ‘MakeNewCsv.exe’ should now only produces valid single entries.
MakeNewTestFiles.zip: http://www.mediafire.com/?43u6fvlljc0yk66
All the best... Sonic
The naming of the cards with an asterisk (* = currently buggy, or an approximation of the original card) is inconsistent in the manalink.csv files.
Mok’s ‘MakeNewCsv.exe’ can’t take account of cards marked with and asterisk, and so creates duplicate entries. Also the ‘LAST AVAILABLE SLOT’ entry in the manalink files will be included in the output manalink.csv
I originally got round this with my spreadsheet by manually removing the duplicates and the LAST AVAILABLE SLOT entry before producing the ‘AllCards.csv’ file.
Anyway, I’ve now created a set of current manalink.csv files with the asterisk marked cards corrected in all the files, and the LAST AVAILABLE SLOT entries removed - Mok’s ‘MakeNewCsv.exe’ should now only produces valid single entries.
MakeNewTestFiles.zip: http://www.mediafire.com/?43u6fvlljc0yk66
All the best... Sonic
Working On: Life, the Universe, and Everything.
Re: 2000 cards limit
by Gargaroz » 05 Dec 2011, 11:26
Guys, you're really amazing 
I'm currently putting down a mega-list of cards to code, so I'll be ready for the day we could finally overcome the 2000 limit.

I'm currently putting down a mega-list of cards to code, so I'll be ready for the day we could finally overcome the 2000 limit.
----
- 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: 2000 cards limit
by Mok » 05 Dec 2011, 11:34
Yeah choose/prepare any csv you want. The only requirement from my side is to keep the order of initial cards as I really don't want to trace all the code that accesses the cards by their ID in the old code.Gargaroz wrote:Guys, you're really amazing
I'm currently putting down a mega-list of cards to code, so I'll be ready for the day we could finally overcome the 2000 limit.
Re: 2000 cards limit
by gmzombie » 05 Dec 2011, 12:02
here is the csv that mmoks program made after going through all the csvs which i think is a better idea as it changes and gives you a log of everything..dl the program and try it out but here is the manalink i got out of the program.
- Attachments
-
csv new.rar
- has my log file in it too.
- (522.42 KiB) Downloaded 312 times
can I maze of ith your snowstorm?
http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
- gmzombie
- Posts: 857
- Joined: 26 Feb 2009, 01:05
- Location: Wyoming, Mi
- Has thanked: 200 times
- Been thanked: 51 times
Re: 2000 cards limit
by Mok » 05 Dec 2011, 13:19
Just to start things a bit, here is an updated deck builder (v1) that will support cards.dat without 2k limit (with an example cards.dat file of 4000+ cards). Make a COPY of your manalink Program directory and unpack the archive there. Then run deck.exe to get it working - it will crash magic.exe as it doesn't support the big .dat files yet, so make sure you use copy of your manalink
You'll notice that skin is reverted and cards use ugly old manalink 1.3 backgrounds. Read on.
While updating the DLLs for new card limit I have decided to reorganize them a bit. I have moved all image decompression code to an external image.dll and modified the other files to use it. That means that whenever cardartlib.dll, drawcardlib.dll, deckdll.dll (and soon magic.exe and shandalar.exe) attempts to load a .pic, .pcx, .jpg or .bmp file it will all go through the same call to image.dll. The library doesn't care about file extension so replacing an old image is very easy, just name your file like the old one and it should work. Currently image.dll supports jpg, png, pcx, bmp and pic(microprose) files (some rarely used combinations are not supported like progressive png). To use it (in case you'd like to rewrite it or use in another file) just call LoadImage(Filename, PaletteHandle, Width, Height). Filename is the full path of image to load, PaletteHandle is a global Palette handle from the calling application. This one is needed only if you want to support original .pic files as these most of the time do not contain palette otherwise set to 0. Width and Height are either 0 for original image dimensions or set to get a resized image. Returned is a DIB handle of loaded image (or 0 if failed). It's always 32-bit rgb image (regardless of the source).
So... to get new deck builder skinned just like your old one, you'll need to go to CardArt subdir and copy the .bmps over the original .pics (after maybe compressing them into .pngs first) - this will get card backgrounds back to my old manalink 2.0 versions and then go to DBArt and do the same with all skin .bmps too - rename them to .pic. Running deck.exe should show deck builder with the new graphics.
The other changes are done to cardartlib.dll. It will now load the images either by their number like before or in the format similar to the one proposed by Snacko in his dll rewrite: "<cardname>.jpg" and "<cardname> (<subpic>).jpg" (of course the images only need to be called .jpg but can be of any format supported by image.dll as listed above). The new format names are checked first. The difference is that I strip the accented characters from the filenames because not all windows locales accept all special characters in file names. I know mine will not allow some of them. That's done crudely with a simple table replacing accented character with another one and then stripping some of the illegal characters like "*/\? and so on. For that purpose I include a small renaming tool. Run it from command line for example like this:
RenPics.exe CardL.dat CardArtLim CardArtLim_new
and it will COPY (not move) the images from CardArtLim to CardArtLim_new with the new names (the output directory will be created if it does not exist). You can run it over any combination of .dat and source gfx directory. Then you can simply merge the images from CardArtLim_new with all other ones and finally replace the CardArtNew with a version that only have newly named files. I plan to write another small tool, that will scan the CardArtNew and then run though cards.dat and update the subpictures number for any card based on actual existing images. That will make it easy for anyone to have own images without constantly updating csv file.
Disclaimer: I do not mean these are the final solution to anything. When Snacko completes his dll rewrites, you are free to use them, I'm here only to remove the 2k limit and not to hinder the progress of the game especially when I'll be gone soon. And it's better to have cleanly written new versions instead of resourced crap.

While updating the DLLs for new card limit I have decided to reorganize them a bit. I have moved all image decompression code to an external image.dll and modified the other files to use it. That means that whenever cardartlib.dll, drawcardlib.dll, deckdll.dll (and soon magic.exe and shandalar.exe) attempts to load a .pic, .pcx, .jpg or .bmp file it will all go through the same call to image.dll. The library doesn't care about file extension so replacing an old image is very easy, just name your file like the old one and it should work. Currently image.dll supports jpg, png, pcx, bmp and pic(microprose) files (some rarely used combinations are not supported like progressive png). To use it (in case you'd like to rewrite it or use in another file) just call LoadImage(Filename, PaletteHandle, Width, Height). Filename is the full path of image to load, PaletteHandle is a global Palette handle from the calling application. This one is needed only if you want to support original .pic files as these most of the time do not contain palette otherwise set to 0. Width and Height are either 0 for original image dimensions or set to get a resized image. Returned is a DIB handle of loaded image (or 0 if failed). It's always 32-bit rgb image (regardless of the source).
So... to get new deck builder skinned just like your old one, you'll need to go to CardArt subdir and copy the .bmps over the original .pics (after maybe compressing them into .pngs first) - this will get card backgrounds back to my old manalink 2.0 versions and then go to DBArt and do the same with all skin .bmps too - rename them to .pic. Running deck.exe should show deck builder with the new graphics.
The other changes are done to cardartlib.dll. It will now load the images either by their number like before or in the format similar to the one proposed by Snacko in his dll rewrite: "<cardname>.jpg" and "<cardname> (<subpic>).jpg" (of course the images only need to be called .jpg but can be of any format supported by image.dll as listed above). The new format names are checked first. The difference is that I strip the accented characters from the filenames because not all windows locales accept all special characters in file names. I know mine will not allow some of them. That's done crudely with a simple table replacing accented character with another one and then stripping some of the illegal characters like "*/\? and so on. For that purpose I include a small renaming tool. Run it from command line for example like this:
RenPics.exe CardL.dat CardArtLim CardArtLim_new
and it will COPY (not move) the images from CardArtLim to CardArtLim_new with the new names (the output directory will be created if it does not exist). You can run it over any combination of .dat and source gfx directory. Then you can simply merge the images from CardArtLim_new with all other ones and finally replace the CardArtNew with a version that only have newly named files. I plan to write another small tool, that will scan the CardArtNew and then run though cards.dat and update the subpictures number for any card based on actual existing images. That will make it easy for anyone to have own images without constantly updating csv file.
Disclaimer: I do not mean these are the final solution to anything. When Snacko completes his dll rewrites, you are free to use them, I'm here only to remove the 2k limit and not to hinder the progress of the game especially when I'll be gone soon. And it's better to have cleanly written new versions instead of resourced crap.
- Attachments
-
new_db_v1.rar
- (406.78 KiB) Downloaded 331 times
Re: 2000 cards limit
by 0rion79 » 05 Dec 2011, 13:35
It's working!
Thank you so much, Mok!
Since we are taling about decbuilder skin, I'm uploading a revised version of the original skins that is alread in BMP format and also contains some "empty" button. Even if I'm not an expert, I hope it can be included as alternative skin to the gold one (imho, too bright) proposed by Mathusalem time ago.

Since we are taling about decbuilder skin, I'm uploading a revised version of the original skins that is alread in BMP format and also contains some "empty" button. Even if I'm not an expert, I hope it can be included as alternative skin to the gold one (imho, too bright) proposed by Mathusalem time ago.
- Attachments
-
Revised original Decbkuilder Skin.rar
- (1.3 MiB) Downloaded 348 times
-
0rion79 - Posts: 1520
- Joined: 24 Feb 2009, 18:33
- Location: Italy
- Has thanked: 94 times
- Been thanked: 61 times
Re: 2000 cards limit
by Snacko » 05 Dec 2011, 13:37
I'm impressed you got so much dedication to this cause as it involves rigorous editing of all the addresses associated with static size arrays.
The only thing I would like to see is the asm source if you got it to a compilable state as it might be useful in the unforeseeable future and it would be a waste to do the work again to get it if needed (same as the old compilable magic.exe asm would be useful, but was unfortunately lost because it was never shared).
I suppose you recompiled it because it now no longer crashes explorer.exe. It was most likely someone forgot to fix relocation table after an edit.
The only thing I would like to see is the asm source if you got it to a compilable state as it might be useful in the unforeseeable future and it would be a waste to do the work again to get it if needed (same as the old compilable magic.exe asm would be useful, but was unfortunately lost because it was never shared).
I suppose you recompiled it because it now no longer crashes explorer.exe. It was most likely someone forgot to fix relocation table after an edit.
Re: 2000 cards limit
by Mok » 05 Dec 2011, 14:07
Nah, that wasn't really that much work... I had old database of deckdll.dll and the other dlls are pretty short when stripped of image code (unfortunately magic.exe would require redoing it... I have some old backup databases, but too old ones, the more recent ones vanished together with my hd years ago). I will upload the sources when the dlls are in somewhat working state, but be warned - they are really really ugly and use my old variable names not yours from the C framework. Typical for resourced stuff.Snacko wrote:I'm impressed you got so much dedication to this cause as it involves rigorous editing of all the addresses associated with static size arrays.
The only thing I would like to see is the asm source if you got it to a compilable state as it might be useful in the unforeseeable future and it would be a waste to do the work again to get it if needed (same as the old compilable magic.exe asm would be useful, but was unfortunately lost because it was never shared).
I already noticed some problems with my csv merging tool, it should strip some extra characters when comparing names, as duplicates like "Assembly Worker" and "Assembly-Worker" are created now. EDIT: Added updated version of the tool to the original post with MakeNewCsv.
Re: 2000 cards limit
by Gargaroz » 05 Dec 2011, 16:06
Mok, as I mentioned before I'm a n00b in both C and ASM department, so if you've more infos like the ones you posted before when I asked about the "Reseved infos" stuff, please share them.
They will help me a lot when programming the AI of the new cards and we could produce a more complete Editor program. If you don't want to flood this thread, PM me and I'll give you my e-mail address. I'm planning to Wiki all this stuff, I wonder why nobody has done this before...
They will help me a lot when programming the AI of the new cards and we could produce a more complete Editor program. If you don't want to flood this thread, PM me and I'll give you my e-mail address. I'm planning to Wiki all this stuff, I wonder why nobody has done this before...
----
- 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
Who is online
Users browsing this forum: No registered users and 2 guests