Page 1 of 1

Very Necessary Request

PostPosted: 27 Feb 2009, 17:41
by HarryPitfall
ok, one of the fields inside magic.exe, is called 'reserved info', this is a info not 'know' about cards.
this info have something about activated ability, can't block, or attack if able... some extra abilities.
I can't decode it alone, so, i really NEED help, all info about that part of the card is welcome.
I decode finally what card cc #3 does, it's enabled/disable cost increase/reduction for that card. This small info opens door to affinity card (and maybe, fix the buddy cards)
I repeat, I really need all info about that space on card, the last 'reserved info', is very, very important to have more and well done cards

Re: Very Necessary Request

PostPosted: 28 Feb 2009, 14:27
by Draggamor
I managed to find that the fist two bytes of that string are related with abilities.

When a card has an activated ability the first bytes are always 0100, except if its a mana ability. Black Lotus and the Moxes have 8011 instead. When its a mana ability, such as that of Sisters of the Flame, the first two bytes are 0010.

I also found a pattern in ALL cards about the LAST 8 bytes, they form always a number between -2 (FEFFFFFF) and 3 (03000000). Could this be ralated also with Shandalar? (rarity of appearence in the dens for instance)

Re: Very Necessary Request

PostPosted: 01 Mar 2009, 00:12
by Draggamor
Additional information:

The first byte of the reserved information has the following table:

01 - Generic activated ability (instant speed)
02 - Generic activated ability (interrupt speed)
04 - Damage prevention
08 - Power pumper
10 - Toughness pumper
20 - Deals with counters (self only)
40 - Unknown
80 - Unknown

I found some cards with code 40 and 80, but could not find any logic with those. Also although these are 90% correct, I also found some cards that did not respect this table, such as Rock Hydra, that shoul have code 25, but only had 05.

Some examples: Shivan Dragon 09 (power pumper + activated ability), Carrion Ants 19 (both power and toughness pumper + activated ability), Lifeforce 02 (activated ability int speed), Healing Salve 04 (damage prevention), Clockwork Beast 21 (works with counters + activated ability)

Re: Very Necessary Request

PostPosted: 01 Mar 2009, 00:55
by HarryPitfall
These informations are crucial to have better and better cards... If you know what the card can do or not... :)
Tks draggamor, tks very much!

Re: Very Necessary Request

PostPosted: 02 Mar 2009, 00:52
by jatill
Since you're doing so well decoding other pieces, maybe you can solve another mystery for us. When you call GetCardInfo, the data gets returned into ESI. How much of the data that gets put into ESI can we decode? For example, we know that 1 bit means tapped/untapped, another is summon sick, etc. What is all the data? I'm particularly interested in knowing where creature type, converted mana cost, and number of counters are stored. I haven't done any research on those yet. Maybe if someone can figure it out, I can make modular when I come back to this project :)

Re: Very Necessary Request

PostPosted: 02 Mar 2009, 09:13
by Snacko
The value you're getting into esi is a pointer to a struct. As I don't know much about this actual struct other than it contains a bitfield indicating the status of the card ex. tapped, summoning sickness.
Pseudo C code
Code: Select all
num Status //up to 32 status bits, at least 17
            {
            Tapped = 1 << 4,
            SummoningSickness = 1 << 17
            }
 struct  Card
            {
                   ......
                   int bitfield;
                   .....
                   other variables
            };
struct Card* c = GetCardInfo(eax=PlayerID, ecx=CardID)
if (c->bitfield & (Status.Tapped | Status.SummoningSickness ) != 0)
    .....
Most likely it contains all the data from the dat. This is one of the reasons you should have a proper documentation so that once a person figures something out (useful function, pointer to global status, struct layout) he can add it for others to use.
This is not an answer how the variables are set out but an overall advice and

Re: Very Necessary Request

PostPosted: 02 Mar 2009, 13:14
by jatill
Snacko wrote:This is one of the reasons you should have a proper documentation so that once a person figures something out (useful function, pointer to global status, struct layout) he can add it for others to use.
This is not an answer how the variables are set out but an overall advice and
I've been trying to capture everything we learn in the tutorial. Until we figure out how to document the code, like you mention, that's the best we can do.

Re: Very Necessary Request

PostPosted: 02 Mar 2009, 13:54
by Incantus
You should use a wiki (maybe use http://www.wikia.com) to set up a specific manalink wiki..

Re: Very Necessary Request

PostPosted: 02 Mar 2009, 15:02
by jatill
incantus1 wrote:You should use a wiki (maybe use http://www.wikia.com) to set up a specific manalink wiki..
That, sir, is a fantastic idea.

Re: Very Necessary Request

PostPosted: 02 Mar 2009, 15:28
by HarryPitfall
i found lots of things about manacosts on effects... i'm adding everything on a .mac file :)

; HaveManaOrJump QtyColorless, QtyBlack, QtyBlue, QtyGreen, QtyRed, QtyWhite, Label
; cylian sunsinger example: rwg
; HaveManaOrJump 0, 0, 0, 1, 1, 1, CantActivate
; aethersworn example: 1wb
; HaveManaOrJump 1, 1, 0, 0, 0, 1, CantActivate
%macro HaveManaOrJump 7
mov byte [0x55cf10], %1
mov byte [0x55cf11], %2
mov byte [0x55cf12], %3
mov byte [0x55cf13], %4
mov byte [0x55cf14], %5
mov byte [0x55cf15], %6
push PlayerID
call 0x402be0
add esp, 4
test eax, eax
jz %6
%endmacro

this is a alternate way to check if there is mana avaiable... it's appear the microprose programmers did it for they legends with strange costs on abilities (BR, GRW)...
Also, these cards use the old call to pay mana, using 'zero' colorless mana as parameter, and fill only the extra color cost pointers... :)

Re: Very Necessary Request

PostPosted: 02 Mar 2009, 15:58
by jatill
What is a .mac file? A Macro?

Re: Very Necessary Request

PostPosted: 02 Mar 2009, 16:35
by Bog Wraith
incantus1 wrote:You should use a wiki (maybe use http://www.wikia.com) to set up a specific manalink wiki..
I've sent a PM to Huggy and hopefully we will be setting up a wiki for all the info from all the programmers/developers to be able to post and access all of the pertinent info.

Stay tuned...!


-------------------------------------------------

Will have to look further into it. Time constraints do not allow me the time right now.

If anyone else wants to look into this, report progress.

Re: Very Necessary Request

PostPosted: 04 Mar 2009, 13:27
by jatill
HarryPitfall wrote:i found lots of things about manacosts on effects... i'm adding everything on a .mac file :)

; HaveManaOrJump QtyColorless, QtyBlack, QtyBlue, QtyGreen, QtyRed, QtyWhite, Label
; cylian sunsinger example: rwg
; HaveManaOrJump 0, 0, 0, 1, 1, 1, CantActivate
; aethersworn example: 1wb
; HaveManaOrJump 1, 1, 0, 0, 0, 1, CantActivate
%macro HaveManaOrJump 7
mov byte [0x55cf10], %1
mov byte [0x55cf11], %2
mov byte [0x55cf12], %3
mov byte [0x55cf13], %4
mov byte [0x55cf14], %5
mov byte [0x55cf15], %6
push PlayerID
call 0x402be0
add esp, 4
test eax, eax
jz %6
%endmacro

this is a alternate way to check if there is mana avaiable... it's appear the microprose programmers did it for they legends with strange costs on abilities (BR, GRW)...
Also, these cards use the old call to pay mana, using 'zero' colorless mana as parameter, and fill only the extra color cost pointers... :)
Harry-
Have you done any more work with macros since this? I had a giant idea about how make card building very easy, but I want to make sure we're not working on the same thing.