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 Mok » 05 Dec 2011, 17:28
Heh, I don't remember that much to be honest, it's been years. It comes back as I spent quite some time on this game but not sure if I'll be of any help, we'll see after getting rid of 2k problem.Gargaroz wrote: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.
So now my question: can I simply modify directly any magic.exe from your releases and it will be still useful for later card inclusion? I don't have this skyeditor or whatever that is so no idea if it comes with prepared exe to put card_data_t stuff there or you can feed it with any exe version as long as card_data_t is in the same place? Also any exe is suitable? There were several versions of the game and assuming you'd like to put them all together, which exe should I modify?
Edit: Same question about ManalinkEx.dll. Are the versions all the same? I assume there were at some points cards coded directly in asm and inside of this dll. Are they all ported to your C framework? Can I just grab any ManalinkEx.dll and make suitable changes to it?
Re: 2000 cards limit
by Snacko » 05 Dec 2011, 18:13
@Mok
It just expects the data to be in the right place, however it might have a set limit of cards (2000) anyway.
Yes, all changes to ManalinkEx stopped, however some cards weren't ported to C afaik.
It just expects the data to be in the right place, however it might have a set limit of cards (2000) anyway.
Yes, all changes to ManalinkEx stopped, however some cards weren't ported to C afaik.
Re: 2000 cards limit
by Mok » 05 Dec 2011, 18:22
Where can I get that editor to take a look?Snacko wrote:@Mok
It just expects the data to be in the right place, however it might have a set limit of cards (2000) anyway.
Yes, all changes to ManalinkEx stopped, however some cards weren't ported to C afaik.
Are there any places where the old versions of ManalinkEx are available? The 'new' versions don't really have many cards inside.
Re: 2000 cards limit
by gmzombie » 05 Dec 2011, 18:30
ill get the file just got to find it a sec
i forgot you probably dont have a full version of magic to test do you? if so then just tdrop it into the program directory where manalink.csv is and i have to up a secondary file which is for shandalar
updated with good version
Also on the current exes i still believe there is only 1 real magic.exe where as all other ones are cloned ones of that one(i think someone explain if im wrong so i know as well). i believe the real coding has been for the longest time off of the eh.dll. please if im wrong correct me but i believe even some of the original uncoded legends were coded in the eh.dll now. Before you came back Mok i was hoping that we could get some of the original card code out of the exe and recoded into the dll due to i thought at the time it might free up enough code space to find the structs that were needed to fix the 2k problem. at the time I, Foolosopher, and ghost were looking into it but came up short of course. But as i said before any program or update that is needed im here to upload it.
i forgot you probably dont have a full version of magic to test do you? if so then just tdrop it into the program directory where manalink.csv is and i have to up a secondary file which is for shandalar
updated with good version
Also on the current exes i still believe there is only 1 real magic.exe where as all other ones are cloned ones of that one(i think someone explain if im wrong so i know as well). i believe the real coding has been for the longest time off of the eh.dll. please if im wrong correct me but i believe even some of the original uncoded legends were coded in the eh.dll now. Before you came back Mok i was hoping that we could get some of the original card code out of the exe and recoded into the dll due to i thought at the time it might free up enough code space to find the structs that were needed to fix the 2k problem. at the time I, Foolosopher, and ghost were looking into it but came up short of course. But as i said before any program or update that is needed im here to upload it.

- Attachments
-
New Folder.rar
- skymagic editor
- (2.48 MiB) Downloaded 226 times
-
SkyMarshal.rar
- here is i believe the first update that had the extra manalinkex.dll inside
- (3.12 MiB) Downloaded 229 times
Last edited by gmzombie on 06 Dec 2011, 00:20, edited 1 time in total.
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, 19:24
Ok, so it seems just any magic.exe will be fine... I'll continue my changes in some random one.gmzombie wrote:Also on the current exes i still believe there is only 1 real magic.exe where as all other ones are cloned ones of that one(i think someone explain if im wrong so i know as well). i believe the real coding has been for the longest time off of the eh.dll.
I checked the editor briefly and oh boy, you'll have some work to make card_data_t for all of the cards, I thought it's more user friendly than typing some numbers

Re: 2000 cards limit
by Snacko » 05 Dec 2011, 19:31
I think http://www.mediafire.com/?d22nyyznwly is the latest one.
Well considering ManalinkEx.dll there weren't many cards coded in there, because by the time this dll was linked in, we've already switched to coding cards in C. So it might even be possible to mark those cards and recode them (mostly basic cards) and remove the file all together. I also remember that some of the code in that dll was coded in C then injected in, so it's doubled in ManalinkEh.dll anyway.
Well considering ManalinkEx.dll there weren't many cards coded in there, because by the time this dll was linked in, we've already switched to coding cards in C. So it might even be possible to mark those cards and recode them (mostly basic cards) and remove the file all together. I also remember that some of the code in that dll was coded in C then injected in, so it's doubled in ManalinkEh.dll anyway.
Re: 2000 cards limit
by Sonic » 05 Dec 2011, 19:59
Actually, If Mok requires the original cards in their correct slots - the one manalink.csv file we know they are is the one in the ISO, as it's still fully compatible with Shandalar.
I've done a lot of work on the csv file since the ISO was released, so the text is OK. If needed I can always incorporate any updated text from the more recent files into it. And it would also need some modification to the subtype entries to make it fully compatible with the current files.
I've done a lot of work on the csv file since the ISO was released, so the text is OK. If needed I can always incorporate any updated text from the more recent files into it. And it would also need some modification to the subtype entries to make it fully compatible with the current files.
Working On: Life, the Universe, and Everything.
Re: 2000 cards limit
by Mok » 05 Dec 2011, 20:14
Heh, it's not like I 'require' anything, but a lot of cIDs are used in the original engine code. Some of that code was extended to your C framework by a set of hooks, but still check first for some specific cards and then control is passed to your hooks. That means that when you changed the order, cards that for example are not mana sources, are treated as such by the AI and so on. To some extent that's same for Subtypes. These were completely redefined and while not many places used them, I'm pretty sure some code isn't working like it used to do. So you don't have to keep the order but you'd need to replace cIDs in exe and dlls to new values, and finding all such places can be tricky. As for card_data_t order, at least it's used for basic lands, I don't remember if anything else.Sonic wrote:Actually, If Mok requires the original cards in their correct slots - the one manalink.csv file we know they are is the one in the ISO, as it's still fully compatible with Shandalar.
Re: 2000 cards limit
by Mok » 05 Dec 2011, 22:35
So... any chance for help with updated ManalinkEh.dll? I'm not good in C so I can't do it myself. What I expect needs to be done is:
- first, to add a new variable that contains real number of cards in .dat file. That's pretty easy... say we add to Manalink.lds (in the global variables part):
_coded_cards = 0x7375AC; (that's an example name... it's not really cards that are coded)
and in manalink.h:
extern int coded_cards; (in global variables again)
- carefully examine all source files for parts that limit something to 2000 and access cards_ptr. An example: in draft.c function make_rotisserie_pack(), line "for(card=0;card<2000;card++)(" needs to be changed to "for(card=0;card<coded_cards;card++)(". Overall, you need to search all source files for a number 2000 and look at the code to see if it's a card limit related to cards_ptr (or number of cards one way or another) or some other use. Some are easy to spot like card_coded[2000] in functions.c due to their names but some might be not. The code is not very readable too, with direct use of numbers instead of enums in lots of places.
I know that's not so easy to do, but seriously that part I can't do and it's required to get it done. I can fix Magic.exe and ManalinkEx.dll (already have a pre version up and running somewhat) but fixing your sources needs to be done by someone familiar with the code.
- first, to add a new variable that contains real number of cards in .dat file. That's pretty easy... say we add to Manalink.lds (in the global variables part):
_coded_cards = 0x7375AC; (that's an example name... it's not really cards that are coded)
and in manalink.h:
extern int coded_cards; (in global variables again)
- carefully examine all source files for parts that limit something to 2000 and access cards_ptr. An example: in draft.c function make_rotisserie_pack(), line "for(card=0;card<2000;card++)(" needs to be changed to "for(card=0;card<coded_cards;card++)(". Overall, you need to search all source files for a number 2000 and look at the code to see if it's a card limit related to cards_ptr (or number of cards one way or another) or some other use. Some are easy to spot like card_coded[2000] in functions.c due to their names but some might be not. The code is not very readable too, with direct use of numbers instead of enums in lots of places.
I know that's not so easy to do, but seriously that part I can't do and it's required to get it done. I can fix Magic.exe and ManalinkEx.dll (already have a pre version up and running somewhat) but fixing your sources needs to be done by someone familiar with the code.
Re: 2000 cards limit
by foolosopher » 06 Dec 2011, 00:19
I 'm in for this but we 'd better split it, my schedule is stretched and chaotic at this period of time, so I want to take up a small part for starters, that I will be able to deliver shortly. Whatever we plan to do, if it's in C we definately need to assign a couple or few global variables with card_limit, whatever that may be, and replace the 2000, so that we will be able to change it more easily if necessary. Another thing about the csv
you beat me to it but I combined the 20111103_v2_NL_GY-4.5 manalink.csv with the GY (from sonic).
The csv2dat accepts it and produces a dat.
Anyway, I found a lot of duplicates, only with different declared set between constructed and GY.
Also there were "animated" duplicates of certain cards, I guess for their effects.
Another thing is that the CODED CARD bit was set 0 and 1 for some other cards like the ones below.
2675 Invoke Prejudice 0 Invoke Prejudice
2902 Invoke Prejudice 1 Invoke Prejudice
2449 Mox Diamond 1 Mox Diamond
3492 Mox Diamond 0 Mox Diamond
457 Mox Diamond 1 Mox Diamond 0008h
2449 Mox Diamond 1 Mox Diamond 0800h
3492 Mox Diamond 0 Mox Diamond 0100h
3782 Rain of Filth 1 Rain of Filth 0020h
3783 Rain of Filth Effect 0 RoF Effect 0020h
764 Recall 0 Recall 0100h
2753 Recall 1 Recall 0800h
1745 Spirit 0 Spirit 01000h
1453 Spirit (white) 0 Spirit 01000h
1172 Thorn Elemental 1 Thorn Elemental 0040h
3449 Thorn Elemental 1 Thorn Elemental 0020h
3450 Thorn Elemental 0 Thorn Elemental 0020h
And a final rule I found is that for the csv to be valid, IDs have to be from smallest to higher in a completely consecutive order, without gaps.
you beat me to it but I combined the 20111103_v2_NL_GY-4.5 manalink.csv with the GY (from sonic).
The csv2dat accepts it and produces a dat.
Anyway, I found a lot of duplicates, only with different declared set between constructed and GY.
Also there were "animated" duplicates of certain cards, I guess for their effects.
Another thing is that the CODED CARD bit was set 0 and 1 for some other cards like the ones below.
2675 Invoke Prejudice 0 Invoke Prejudice
2902 Invoke Prejudice 1 Invoke Prejudice
2449 Mox Diamond 1 Mox Diamond
3492 Mox Diamond 0 Mox Diamond
457 Mox Diamond 1 Mox Diamond 0008h
2449 Mox Diamond 1 Mox Diamond 0800h
3492 Mox Diamond 0 Mox Diamond 0100h
3782 Rain of Filth 1 Rain of Filth 0020h
3783 Rain of Filth Effect 0 RoF Effect 0020h
764 Recall 0 Recall 0100h
2753 Recall 1 Recall 0800h
1745 Spirit 0 Spirit 01000h
1453 Spirit (white) 0 Spirit 01000h
1172 Thorn Elemental 1 Thorn Elemental 0040h
3449 Thorn Elemental 1 Thorn Elemental 0020h
3450 Thorn Elemental 0 Thorn Elemental 0020h
And a final rule I found is that for the csv to be valid, IDs have to be from smallest to higher in a completely consecutive order, without gaps.
- Attachments
-
Manalink-20111103_v2_GYv4sonic.rar
- (244.81 KiB) Downloaded 204 times
Last edited by foolosopher on 06 Dec 2011, 10:00, edited 1 time in total.
I long for the time where one man could make a difference...
- foolosopher
- Posts: 189
- Joined: 19 May 2010, 20:53
- Location: Greece
- Has thanked: 13 times
- Been thanked: 17 times
Re: 2000 cards limit
by Gargaroz » 06 Dec 2011, 01:55
Mok, I'll do the C part (removing the "2000" from everywere and I've already set the new global variable).
But previously you mentioned also "_cards_ptr needs to be changed from 0x55d0e0 to 0x73bb00", I need to do this too ?
As for the "card_ptr" data you mentioned (is the Magic.exe part in the editor), yeah, that will be a nightmare to do : I typed myself all the latest inserted cars, so I know really well the kind of work we need to do.
For a massive editing like this, pehaps we could set up a csv-like file and then convert it to raw data with a specific tool. I really haven't the knowledge base to do this, so if someone is able to make this kind of stuff, get in touch.
And we surely need an updated version of the editor, I hope Orion could get in contact with the editor's author and get something like a source code, or at least a way to improve it.
But previously you mentioned also "_cards_ptr needs to be changed from 0x55d0e0 to 0x73bb00", I need to do this too ?
As for the "card_ptr" data you mentioned (is the Magic.exe part in the editor), yeah, that will be a nightmare to do : I typed myself all the latest inserted cars, so I know really well the kind of work we need to do.
For a massive editing like this, pehaps we could set up a csv-like file and then convert it to raw data with a specific tool. I really haven't the knowledge base to do this, so if someone is able to make this kind of stuff, get in touch.
And we surely need an updated version of the editor, I hope Orion could get in contact with the editor's author and get something like a source code, or at least a way to improve it.
----
- 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 » 06 Dec 2011, 02:35
Yes, but that can be done when all the other changes are working in the current version. As this one will require already modified magic.exe and ex.dll. All the other changes should work fine in the current exe/dlls.Gargaroz wrote:Mok, I'll do the C part (removing the "2000" from everywere and I've already set the new global variable).
But previously you mentioned also "_cards_ptr needs to be changed from 0x55d0e0 to 0x73bb00", I need to do this too ?
Re: 2000 cards limit
by Snacko » 06 Dec 2011, 10:23
@Gargaroz
this can't be done as Mok suggested as you have global arrays which are constructed way before the variable in magic.exe gets populated with. You have to read cards.dat by yourself then malloc the arrays at dllmain.
Well I can make the changes if you don't change anything in decv2 update.
this can't be done as Mok suggested as you have global arrays which are constructed way before the variable in magic.exe gets populated with. You have to read cards.dat by yourself then malloc the arrays at dllmain.
Well I can make the changes if you don't change anything in decv2 update.
Re: 2000 cards limit
by foolosopher » 06 Dec 2011, 10:47
gmzombie wrote:Also on the current exes i still believe there is only 1 real magic.exe where as all other ones are cloned ones of that one(i think someone explain if im wrong so i know as well). i believe the real coding has been for the longest time off of the eh.dll.
Whatever best suits you, but I'd say use the latest one, since there is c code interacting with the exe, which we will review it seems and is bound to cause trouble, so that we debug and clear it along the way and we don't lose functionality if possible. Randomness in this has already caused troubles in the past.Mok wrote:Ok, so it seems just any magic.exe will be fine... I'll continue my changes in some random one.
[/quote]Mok wrote:I checked the editor briefly and oh boy, you'll have some work to make card_data_t for all of the cards, I thought it's more user friendly than typing some numbersI guess one option would be to dump card_data_t from a couple of executables, join them, sort by name, remove duplicates then put back into one exe... but there's still problem of order (at least some cards need to be in the same place as before ie. basic lands at the very beginning etc.)
If we are to work on this too, let's see how we can also transfer complete sets of card values or better structs info (card_data_t?) from csv to exe, like when choosing a card in the csv the relevant values are loaded in the left screen of the exe tab, so that then they can all be moved directly to the exe.
Cause this is going to save us a lot of time and pain in the future, as editing the exe is a torture and is work that is already being done when editing the csv.
clearing out the code is definately a plus, I'm in for it like I said, it will give us better sources to work from now on, we were trying to do this anyway, but then the exe will have to be changed to see accordingly.Snacko wrote:Well considering ManalinkEx.dll there weren't many cards coded in there, because by the time this dll was linked in, we've already switched to coding cards in C. So it might even be possible to mark those cards and recode them (mostly basic cards) and remove the file all together. I also remember that some of the code in that dll was coded in C then injected in, so it's doubled in ManalinkEh.dll anyway.
There are also a few other people who have worked occasionally and have knowledge of how the code is structured like jatil, Harry Pitfal, stassy or mathousalem I think, can we get their help on this?
Distribute your sources (mostly Mok) we don't want to lose anything from all this work and ensure that someone can pick up the work, once someone drops temporarily or permanently.
Should we setup a cvs like tortoise or in sourceforge for this?
I long for the time where one man could make a difference...
- foolosopher
- Posts: 189
- Joined: 19 May 2010, 20:53
- Location: Greece
- Has thanked: 13 times
- Been thanked: 17 times
Re: 2000 cards limit
by gmzombie » 06 Dec 2011, 12:47
regardless on where the sources end up on i will make sure that they do end up at least a mirror on my little site at the bottom of my posts and on my computer with the rest of everything Manalink related.
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
Who is online
Users browsing this forum: No registered users and 21 guests