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 » 30 Nov 2011, 15:53
ill update the csv when I go home for lunch. do u hace an updated csv2dat u can upload so i can test this new csv so that i dont screw up the csv too much 

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 » 30 Nov 2011, 16:08
Well, the AI is not really making any "decisions" it just attempts to "play" as many card combinations in a limited time (yeah, the time is constant) and then picks the one that got the highest "score". Imagine what happens when it has several cards that use your get_id_by_name, especially checking for the ones that are far in the list. A lot of time "thinking" is wasted by comparing your wanted card name with the whole card list. It's crazy in my opinionGargaroz wrote:I think you've misunderstood : that function is vital for us, as now we have 2 main versions (Costructed and Limited) and two "mod" versions (Golden Years and New Limited), and all share the 2000 card limited, so we need that function to know if a specific card "is there" and make all cards works nicely if they're moved from a version to another.Mok wrote:And a nitpick... get_id_by_name? whoa, really I imagine AI is not important but that thing is crazy)
And I don't really see why this will bother the AI at all. For my part, I constantly working on improving the AI of the new cards coded in C.


Re: 2000 cards limit
by Mok » 30 Nov 2011, 16:14
Sure, but the new version is not really different as it only dumps the small coded cards struct for the number of actual cards instead of always 2000, the old one should work too (as far as converting).gmzombie wrote:ill update the csv when I go home for lunch. do u hace an updated csv2dat u can upload so i can test this new csv so that i dont screw up the csv too much
Edit: small bugfix update for the converter.
- Attachments
-
csv2dat_v3.rar
- (1.87 KiB) Downloaded 356 times
Re: 2000 cards limit
by Gargaroz » 30 Nov 2011, 16:41
Mok, you've to understant that when me and Jatill go further in the coding process of modern cards, we have no more than 25% of your info on the source.
For example, I had no idea that there was a "time" limit for the AI (a pretty stupid idea for the original programmers, but I guess it was OK for the time ).
So, we tried to do the best we could with the little we have. And I'm perfectly aware that a more expanded card list will render impossible to use the "get_id_by_name" function, but when we'll have an unique CSV, there will be no need to use it, as every card will have his own unique place.
And about this : what we could expect as limit for the expanded CSV ? 65536 cards (8 bit) ? Or more ?
For example, I had no idea that there was a "time" limit for the AI (a pretty stupid idea for the original programmers, but I guess it was OK for the time ).
So, we tried to do the best we could with the little we have. And I'm perfectly aware that a more expanded card list will render impossible to use the "get_id_by_name" function, but when we'll have an unique CSV, there will be no need to use it, as every card will have his own unique place.
And about this : what we could expect as limit for the expanded CSV ? 65536 cards (8 bit) ? Or more ?
----
- 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 » 30 Nov 2011, 16:51
Aaaargh, sorry I really was only nitpicking not complaining. Computers at the moment are way faster than 10 years ago anyway and since you didn't notice anything I guess it's not important. But why do you say you have less info? I thought by now someone simply did what I did ie. run magic.exe thru ida and try to decipher it... I'm sure there's a lot of errors in my old code (both in my understanding of the original code and in my additions) as I never was a really good programmer and I hate C.Gargaroz wrote:Mok, you've to understant that when me and Jatill go further in the coding process of modern cards, we have no more than 25% of your info on the source.
For example, I had no idea that there was a "time" limit for the AI (a pretty stupid idea for the original programmers, but I guess it was OK for the time ).
So, we tried to do the best we could with the little we have. And I'm perfectly aware that a more expanded card list will render impossible to use the "get_id_by_name" function, but when we'll have an unique CSV, there will be no need to use it, as every card will have his own unique place.
And about this : what we could expect as limit for the expanded CSV ? 65536 cards (8 bit) ? Or more ?
I think 30000 cards is a good start. I could make it unlimited (probably), but that would require a lot more changes to the code and since CT (card_data_t) was already relocated by someone and is sized for 30000, I'll leave it at that. It's going to be enough hassle to make it work initially

Re: 2000 cards limit
by Gargaroz » 30 Nov 2011, 17:37
No problem, Mok, really, as I'm the completly opposite of you as a programmer : I don't understand a line of ASM and I like C, too bad I'm a n00b (I began programming in C with my first cards for Manalink on 2008). I recently got the decompiled "magic.c" from Jatill, but it's really too complex to understant for my skills.
30.000 cards will be like a dream, I hope we'll succeed !
30.000 cards will be like a dream, I hope we'll succeed !
----
- 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 » 30 Nov 2011, 17:38
TBH I don't rememberGargaroz wrote:By the way, thanx a lot for the very useful infos, I think the stuff I requested you is either "CT_CardFlags2 dd" or "CT_PlayActivatePhases" in "card_data_t". What exactly they are for ?

; enum ACTPHASES (bitfield)
P_BEFORECOMBAT = 1
P_BEFOREBLOCKERS = 2
P_AFTERBLOCKERS = 4
P_AFTERCOMBAT = 8
A_BEFORECOMBAT = 10h
A_BEFOREBLOCKERS = 20h
A_AFTERBLOCKERS = 40h
A_AFTERCOMBAT = 80h
Re: 2000 cards limit
by Mok » 30 Nov 2011, 17:46
Hm. If someone wanted to decompile the exe to C (there was no decompiler at the time I started), the best bet would be to use original magic.exe from version 1.3 or 1.3.2. The original exe was compiled with no optimizations making a lot of code bloated and hard to read in asm and I ended up rewriting a lot of code or converting to asm macros. This surely looks like **** after decompilation since it was never compiled in the first place. While the original code is not really compatible with todays version, it may look a LOT better when decompiled as it was originally C. But you'd still need to rename/define all the structs/enums/labels before attempting it as the decompiled code with variables like a, b, c and so on is as readable as raw asmGargaroz wrote:No problem, Mok, really, as I'm the completly opposite of you as a programmer : I don't understand a line of ASM and I like C, too bad I'm a n00b (I began programming in C with my first cards for Manalink on 2008). I recently got the decompiled "magic.c" from Jatill, but it's really too complex to understant for my skills.

Re: 2000 cards limit
by gmzombie » 30 Nov 2011, 18:54
looks like i might not get a lunch today so with that I will jump on the csv as soon as i get home. as far as the original magic.exe to c I could produce it since i have ida with hex rays addon. i think i might have done this before but there is alot of errors in the data..but I will give it a check if needed. also im excited like a kid at christmas about finslly figuring this problem out
Last edited by gmzombie on 30 Nov 2011, 19:15, 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 » 30 Nov 2011, 19:07
Nah, I was talking in theory only. Just loading exe and decompiling it is useless without all the labels, function names, structs and enums. It will be hardly readable.gmzombie wrote:as far as the original magic.exe to c I could produce it since i have ida with hex rays addon. i think i might have done this before but there is alot of errors in the data..but I will give it a check if needed
Re: 2000 cards limit
by 0rion79 » 30 Nov 2011, 20:12
Guys, do you think that game's occasional freezings with AI "still thinking", or weird behavior where the AI doesn't play any card discards basic lands from turn 1, may be connected with get_id_by_name? Even if nowdays computers are much more powerful, the game is still old and hardly can use 100% of that power so maybe the two things may be related.
-
0rion79 - Posts: 1520
- Joined: 24 Feb 2009, 18:33
- Location: Italy
- Has thanked: 94 times
- Been thanked: 61 times
Re: 2000 cards limit
by Mok » 30 Nov 2011, 20:43
I don't think so. Slow AI gets aborted early as there's a fixed time for AI calculation. It's more likely some card is buggy only in AI mode.0rion79 wrote:Guys, do you think that game's occasional freezings with AI "still thinking", or weird behavior where the AI doesn't play any card discards basic lands from turn 1, may be connected with get_id_by_name? Even if nowdays computers are much more powerful, the game is still old and hardly can use 100% of that power so maybe the two things may be related.
Re: 2000 cards limit
by Mok » 30 Nov 2011, 22:00
Edit: Disregard this. It seems I'm making a mistake somewhere.gmzombie wrote:I dont know if it would help but i have your original modded deck builder that u made to test db's back then.
Re: 2000 cards limit
by p0nk0 » 30 Nov 2011, 22:18
Just my 2 cents
First of all I'm not trying to undermine anyone's work on MTG cause everybody who has contributed some code is awesome. I just think since we already have a fast easy way of adding new cards to the system, wouldn't it be better to take the original magic.exe with the original cards mok added and remove the 2000 limitation from there and then add as many cards as we want. I'm not talking about the original version without the graphic improvements or changes that allow card implantations, i'm just talking about using the original card sets that came with mok's version and add on top of that. That way we'd keep less bugs because of errors and from 2001 we can add cards to our hearts desire.
Either way you approach this I am glad for all that you guys have been able to do so far.
I just want to take the oportunity to personally thank you Mok because by the time I discovered your updated version you were already gone from the scene.
First of all I'm not trying to undermine anyone's work on MTG cause everybody who has contributed some code is awesome. I just think since we already have a fast easy way of adding new cards to the system, wouldn't it be better to take the original magic.exe with the original cards mok added and remove the 2000 limitation from there and then add as many cards as we want. I'm not talking about the original version without the graphic improvements or changes that allow card implantations, i'm just talking about using the original card sets that came with mok's version and add on top of that. That way we'd keep less bugs because of errors and from 2001 we can add cards to our hearts desire.
Either way you approach this I am glad for all that you guys have been able to do so far.
I just want to take the oportunity to personally thank you Mok because by the time I discovered your updated version you were already gone from the scene.
- p0nk0
- Posts: 2
- Joined: 11 Aug 2008, 23:40
- Has thanked: 0 time
- Been thanked: 0 time
Re: 2000 cards limit
by Mok » 30 Nov 2011, 23:07
No, it would require the same amount of work. If I had an intact IDA database from back then, I'd be tempted to port the changes to it and create a clean new exe, but that's impossible. Anyway, I haven't played the new version or even checked it properly... Are there any serious problems there? Checking the amount of added cards/code it seems it's doing greatp0nk0 wrote:First of all I'm not trying to undermine anyone's work on MTG cause everybody who has contributed some code is awesome. I just think since we already have a fast easy way of adding new cards to the system, wouldn't it be better to take the original magic.exe with the original cards mok added and remove the 2000 limitation from there and then add as many cards as we want. I'm not talking about the original version without the graphic improvements or changes that allow card implantations, i'm just talking about using the original card sets that came with mok's version and add on top of that. That way we'd keep less bugs because of errors and from 2001 we can add cards to our hearts desire.

Who is online
Users browsing this forum: No registered users and 2 guests