Very Necessary Request
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
Very Necessary Request
by HarryPitfall » 27 Feb 2009, 17:41
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
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
- HarryPitfall
- AI Programmer
- Posts: 175
- Joined: 31 May 2008, 00:14
- Has thanked: 1 time
- Been thanked: 3 times
Re: Very Necessary Request
by Draggamor » 28 Feb 2009, 14:27
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)
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
by Draggamor » 01 Mar 2009, 00:12
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)
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
by HarryPitfall » 01 Mar 2009, 00:55
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!
Tks draggamor, tks very much!
- HarryPitfall
- AI Programmer
- Posts: 175
- Joined: 31 May 2008, 00:14
- Has thanked: 1 time
- Been thanked: 3 times
Re: Very Necessary Request
by jatill » 02 Mar 2009, 00:52
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
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Very Necessary Request
by Snacko » 02 Mar 2009, 09:13
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
This is not an answer how the variables are set out but an overall advice and
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)
.....
This is not an answer how the variables are set out but an overall advice and
Re: Very Necessary Request
by jatill » 02 Mar 2009, 13:14
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.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
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Very Necessary Request
by Incantus » 02 Mar 2009, 13:54
You should use a wiki (maybe use http://www.wikia.com) to set up a specific manalink wiki..
Re: Very Necessary Request
by jatill » 02 Mar 2009, 15:02
That, sir, is a fantastic idea.incantus1 wrote:You should use a wiki (maybe use http://www.wikia.com) to set up a specific manalink wiki..
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Very Necessary Request
by HarryPitfall » 02 Mar 2009, 15:28
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...
; 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...
- HarryPitfall
- AI Programmer
- Posts: 175
- Joined: 31 May 2008, 00:14
- Has thanked: 1 time
- Been thanked: 3 times
Re: Very Necessary Request
by jatill » 02 Mar 2009, 15:58
What is a .mac file? A Macro?
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Very Necessary Request
by Bog Wraith » 02 Mar 2009, 16:35
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.incantus1 wrote:You should use a wiki (maybe use http://www.wikia.com) to set up a specific manalink wiki..
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.
'Twas in the bogs of Cannelbrae
My mate did meet an early grave
'Twas nothing left for us to save
In the peat-filled bogs of Cannelbrae.
My mate did meet an early grave
'Twas nothing left for us to save
In the peat-filled bogs of Cannelbrae.
-
Bog Wraith - Global Mod 1 (Ret)
- Posts: 1108
- Joined: 28 May 2008, 22:40
- Location: Shandalar
- Has thanked: 425 times
- Been thanked: 153 times
Re: Very Necessary Request
by jatill » 04 Mar 2009, 13:27
Harry-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...
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.
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
13 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 34 guests