It is currently 27 Apr 2024, 13:09
   
Text Size

development questions

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

development questions

Postby joemuz » 16 Nov 2009, 19:17

hey jatill: yep, got my first question already. :D i saw your post just now, so i'll post my question here and just start this thread because i'm pretty sure i'll have a lot more. :?: :?: :?:

ok, so i'm trying to add a new card and in the tutorial, it says to find the highest ID not taken and use that ID for the card... the oldest manalink.csv and magic.exe i have is 09/22/2009 and all the slots are taken. can i just delete a card and use that ID to practice making cards? or will that cause errors?

or more simply, does anyone have an old manalink.csv and magic.exe with empty slots in it that i can have to practice programming cards? thanks.
joemuz
 
Posts: 88
Joined: 12 Oct 2009, 17:06
Has thanked: 0 time
Been thanked: 0 time

Re: development questions

Postby jatill » 16 Nov 2009, 20:29

joemuz wrote:hey jatill: yep, got my first question already. :D i saw your post just now, so i'll post my question here and just start this thread because i'm pretty sure i'll have a lot more. :?: :?: :?:

ok, so i'm trying to add a new card and in the tutorial, it says to find the highest ID not taken and use that ID for the card... the oldest manalink.csv and magic.exe i have is 09/22/2009 and all the slots are taken. can i just delete a card and use that ID to practice making cards? or will that cause errors?

or more simply, does anyone have an old manalink.csv and magic.exe with empty slots in it that i can have to practice programming cards? thanks.
There are still at least 50 empty slots in the csv. Just look for things with coded_card = 0. Glyph of* are 5 free slots that I know of off hand.

In general, you could also replace any old card for practicing. 2% of the time something weird will happen because of hardcoded id's, though, so stick to replacing basic cards with no abilities.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby Tapani » 16 Nov 2009, 21:00

I am borrowing this thread for some of my ponderings. In case you don't know I am digging inside Shandalar and not adding cards to Manalink -- and have no idea how anything inside Manalink works.

How are multicoloured cards represented? Especially their casting cost?

Shandalar's card representation of this is three bytes:
1 bitmask of card colour
1 byte for colorless mana required to cast
1 byte for coloured mana required

It would appear as it is not possible to have multicoloured cards in Shandalar, withour major changes. How did you do that in Manalink?

//Tapani
User avatar
Tapani
 
Posts: 24
Joined: 13 Nov 2009, 15:49
Has thanked: 0 time
Been thanked: 0 time

Re: development questions

Postby joemuz » 16 Nov 2009, 22:30

thanks jatill... another question.. in the tutorial, you say "put the total colorless cost into 'Card CC 1', and the total colored cost into 'Card CC 2'" but after looking at various examples, it appears to be the reverse. should it be the other way around or am i mistaken? for example, raging goblin has

Card CC 1 ===> 1
Card CC 2 ===> 0

and skyknight legionnaire has

Card CC 1 ===> 2
Card CC 2 ===> 1

so it seems that Card CC 1 indicates the total colored cost and Card CC 2 indicates total colorless cost.
joemuz
 
Posts: 88
Joined: 12 Oct 2009, 17:06
Has thanked: 0 time
Been thanked: 0 time

Re: development questions

Postby joemuz » 16 Nov 2009, 22:38

and just to clarify... since i'm replacing a card, when i go to the magic.exe tab, i should not use a dummy slot for my test card right? i should go to the card i'm replacing and "save record" there right? as in your example, i made a test card in slot 1917 in the manalink.csv tab which is occupied by ill-gotten gains which is uncoded. then i went to the magic.exe tab and went to raging goblin, typed in the new information and instead of saving to a dummy slot, i overwrote the ill-gotten gains slot (1917)
joemuz
 
Posts: 88
Joined: 12 Oct 2009, 17:06
Has thanked: 0 time
Been thanked: 0 time

Re: development questions

Postby jatill » 16 Nov 2009, 22:39

joemuz wrote:thanks jatill... another question.. in the tutorial, you say "put the total colorless cost into 'Card CC 1', and the total colored cost into 'Card CC 2'" but after looking at various examples, it appears to be the reverse. should it be the other way around or am i mistaken? for example, raging goblin has

Card CC 1 ===> 1
Card CC 2 ===> 0

and skyknight legionnaire has

Card CC 1 ===> 2
Card CC 2 ===> 1

so it seems that Card CC 1 indicates the total colored cost and Card CC 2 indicates total colorless cost.
I don't think it actually matters which order you put it in. But when looking for examples, I'd start by looking at the more recent cards (i.e. Zendikar) since I knew what I was doing when I wrote those :)
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby joemuz » 17 Nov 2009, 00:09

ok, i'm starting to get the hang of things.. i made a level 0 and a level 1 card... but just to make sure, my skymagic editor is in its separate directory... at the bottom of your tutorial, you imply that these 4 files get patched after i run csv2dat.exe:

[1] magic.exe
[2] manalink.csv
[3] cards.dat
[4] ManalinkEx.dll

so i copied the latest versions of these files from my c:\magic directory and put them in my skymagic directory before running the editor. and after creating my test card, i copied these 4 files back to my c:\magic directory and everything went smooth. i ran the program and my test card was there and it worked fine.

but what about these files?

[5] BinaryCards.dat
[6] ManalinkEh.dll

what are they for? do i need to do anything with them? i noticed they weren't modified after i ran csv2dat.exe. do i need to worry about these?
joemuz
 
Posts: 88
Joined: 12 Oct 2009, 17:06
Has thanked: 0 time
Been thanked: 0 time

Re: development questions

Postby jatill » 17 Nov 2009, 00:12

csv2dat.exe only updates cards.dat, hich is the data from manalink.csv. The second tab of the editor edits Magic.exe. I'd recommend putting the editor in the same directory. The other files are updated by build.pl (you need perl installed to run this)
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby jatill » 17 Nov 2009, 00:13

Tapani wrote:I am borrowing this thread for some of my ponderings. In case you don't know I am digging inside Shandalar and not adding cards to Manalink -- and have no idea how anything inside Manalink works.

How are multicoloured cards represented? Especially their casting cost?

Shandalar's card representation of this is three bytes:
1 bitmask of card colour
1 byte for colorless mana required to cast
1 byte for coloured mana required

It would appear as it is not possible to have multicoloured cards in Shandalar, withour major changes. How did you do that in Manalink?

//Tapani
I guess Shandalar was never retrofitter for multicolored cards. Cards for duels have a byte for each color of mana in the CC. Check out the level 0 cards tutorial for details about what's what in Manalink.

http://www.slightlymagic.net/wiki/ManaLink_2.0
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby gmzombie » 17 Nov 2009, 00:17

i guess shandy would need a full rebuild to use the same engine as the current engine we have for duels. if there only was a way to rip the shandy part from the exe and paste in the duels part...lol if only it was that easy
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.
gmzombie
 
Posts: 857
Joined: 26 Feb 2009, 01:05
Location: Wyoming, Mi
Has thanked: 200 times
Been thanked: 51 times

Re: development questions

Postby joemuz » 17 Nov 2009, 18:32

jatill:

okay, so i added the code for a card in red_creatures.c, ran "perl build.pl test_card", got the address for the code pointer, everything compiled without errors, then went to skymagic editor. on the manalink.csv tab, i put in the relevant info into a slot that had an uncoded card and overwrote it (in slot #1962 - Flagstones of Trokair).

NOW here's my question. what exactly is the "reserved information in the magic.exe tab? i'm not sure if i can overwrite directly into #1962 because my test card is not similar to flagstones of trokair and i'm wondering if the "reserved information" slot would cause problems.

in the tutorial, you say think of a card with the same ability to use as the template card before overwriting into the dummy slot. so in your example, when creating skyknight legionnaire, you said to use raging goblin. i assume this is so that when creating the skyknight, we "borrow" the "codepointer" and the "reserved information" values from raging goblin and use those in skyknight.

now with my test card (rorix_bladewing), the codepointer is no problem as i got that when i ran build.pl BUT i'm thinking that it wouldn't be right to use the reserved information from flagstones of trokair as the two cards are not similar. so what should my template card be in the magic.exe tab?
joemuz
 
Posts: 88
Joined: 12 Oct 2009, 17:06
Has thanked: 0 time
Been thanked: 0 time

Re: development questions

Postby jatill » 17 Nov 2009, 18:41

joemuz wrote:now with my test card (rorix_bladewing), the codepointer is no problem as i got that when i ran build.pl BUT i'm thinking that it wouldn't be right to use the reserved information from flagstones of trokair as the two cards are not similar. so what should my template card be in the magic.exe tab?
Right, don't use Flagstones. The relavent abilities are "haste" and "legendary", so I'd probably use Akroma in this case. Or just Raging Goblin, since I happen to know from experience that none of the reserved information has anything to do with legendary.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby joemuz » 17 Nov 2009, 19:39

well i don't know if this is of any use to you but i made this list comparing reserved info for different creatures. i should have just looked up rorix (duh) to find another creature to use as the template but i did this so maybe it will be useful in showing which abilities have to do with the RI and which ones don't.

000000FF01010001000000 1269 Rorix Bladewing - legend flying haste dragon
000000FF01010001000000 0718 Kiki-Jiki, Mirror Breaker - legend goblin haste |T: token
000000FF01010001000000 0691 Ichorid - horror haste sacrifice at end
000000FF01010001000000 1122 Raging Goblin - goblin berserker haste
000000FF01010001000000 1047 Goblin Chariot - goblin warrior haste
000000FF01010001000000 0295 Ball Lightning - elemental trample haste sacrifice at end
000000FF01010001000000 0646 Bloodbraid Elf - elf berserker haste cascade
000000FF01010001000000 1067 Lava Hounds - hound haste 4 damage
000000FF01010001000000 1299 Spirit of the Night - legend FLY/TRA/HAS/PRB/FSWHENATTACK
000000FF01010001000000 1561 Eron the Relentless - rogue haste regen for RRR legend
000000FF01010001000000 1235 Skyknight Legionnaire - flying haste human knight
000000FF48010002000000 0378 Hellkite Overlord - dragon flying trample haste firebreathing
000000FF09010003000000 1198 Akroma, Angel of Wrath - legend FLY/FS/TR/HAS/PRB/PRR/VIG
000000FF01100002000000 1221 Blazing Specter - Specter flying haste discard
000000FF01100002000000 1225 Lightning Angel - angel flying vigilance haste
000000FF01010002000000 1329 Bull Cerodon -beast vigilance haste
000000FF0F010000000000 1594 Volcanic Dragon - fly, haste dragon
000000FFF1010003000000 1603 Jeska, Warrior Adept - legend first strike haste |T: 1 dam

interestingly, akroma is different.. is that because of the vigilance?
joemuz
 
Posts: 88
Joined: 12 Oct 2009, 17:06
Has thanked: 0 time
Been thanked: 0 time

Re: development questions

Postby jatill » 17 Nov 2009, 19:48

Dunno. Someone actually made a list of what all those bits stand for, but I think it has been lost forever.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby joemuz » 17 Nov 2009, 19:54

also jatill, looking in skymagic editor, magic.exe tab, i notice A LOT of cards have incorrect values next to CC1 and CC2... but haven't seen anything wrong in the actual game sooo... i don't know. just thought i'd point it out.
joemuz
 
Posts: 88
Joined: 12 Oct 2009, 17:06
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 26 guests


Who is online

In total there are 26 users online :: 0 registered, 0 hidden and 26 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 26 guests

Login Form