It is currently 25 Apr 2024, 14:15
   
Text Size

Manalink update 2009-03-11

The latest Manalink updates are posted here.
PLEASE DO NOT BUMP OLD UPDATES!

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

Manalink update 2009-03-11

Postby LoneFox » 11 Mar 2009, 18:19

Download link: http://www.savefile.com/files/2035991

New functions:
  • int count_graveyard(int player) at 0x4E9564, returns the number of cards in player's graveyard.

New cards:

Fixes:
  • Kami of the Crescent Moon is now works when tapped and is legendary.
  • Many cards were missing flavor text. I updated them all with a perl script.
  • Fixed several typos in card names, found by the script mentioned above.
  • Fixed Algae Gharial's mana cost in the csv (was 4G)

New known bugs:
  • Basic land types of shockduals don't work for things like landwalk.

No art included, I assume someone else takes care of it.

The new cards are coded in C (!), and their source is available here.
LoneFox
Programmer
 
Posts: 71
Joined: 08 Mar 2009, 13:43
Has thanked: 0 time
Been thanked: 7 times

Re: Manalink update 2009-03-11

Postby jatill » 11 Mar 2009, 18:57

In C?!?! How!!! I can see your .C files, but beyond that, I don't remember a thing about C or compiling (it's been 10 years for me). Could you give me the 10,000 foot overview or some links to follow?

It would appear we are on the threshhold of making magic cards ridiculously easy to make (for programmers).

PS: Pun alert - apparently threshhold will be very easy to code now.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: Manalink update 2009-03-11

Postby Th3 H4xX » 11 Mar 2009, 19:20

Yay Bottle Gnomes ! Me likes ^^
Th3 H4xX
 
Posts: 9
Joined: 10 Mar 2009, 20:51
Has thanked: 0 time
Been thanked: 0 time

Re: Manalink update 2009-03-11

Postby jatill » 11 Mar 2009, 19:44

Here's what I've got so far...

1) Install perl (http://www.activestate.com)
2) Install a c compiler (??????)

Is there any particular compiler I need to use to run your build script? I tried MinGW but it pukes on the params in your build script.

3) Update the build script to point to your own block of memory
4) Add you cards in manalink.csv and magic.exe
5) Add your card to cards.cfg
6) Code some card as a .c file (I chose nimble mongoose as a trivial example)
7) Run build.pl
9) Profit

I am only guessing at steps 3+, since I'm still stuck on step 2 right now.
Last edited by jatill on 11 Mar 2009, 20:05, edited 1 time in total.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: Manalink update 2009-03-11

Postby mathusalem » 11 Mar 2009, 20:01

By golly some update that is :shock:
User avatar
mathusalem
 
Posts: 459
Joined: 24 Feb 2009, 21:00
Has thanked: 6 times
Been thanked: 4 times

Re: Manalink update 2009-03-11

Postby HarryPitfall » 11 Mar 2009, 20:13

Well well... people don't stop finding better ways to coding cards... what's next? Add iactivescript/lua support?
I really like your code, so now, i have more macros to build... trigger_source? amazing... this is what i'm trying to figure...

All information is good for us!

Jatill... i have here gcc.exe, ld.exe and yasm.exe, is the bare bones to make cards in assembler...
Try to get a install of gcc, (Gnu C Compiler) for win32, and copy only gcc.exe... try to compile, and see what files gcc request, and move one for one... (isn't that hard as it sounds)
HarryPitfall
AI Programmer
 
Posts: 175
Joined: 31 May 2008, 00:14
Has thanked: 1 time
Been thanked: 3 times

Re: Manalink update 2009-03-11

Postby LoneFox » 11 Mar 2009, 20:26

First, a short explanation for jatill:

A C compiler is actually chain of several programs:
  • preprocessor, which handles #include and #define directives
  • compiler, which turns C source into assembler code
  • assembler, which turns assembler code into binary object file
  • linker, which adds required libraries and some startup code and produces a working executable or library file

You can break this chain at any point (there are command line switches for it) and take its output. In fact, if you have multiple source files it is normal practice to compile them to separate object files and then run the linker as separate command.

The compiler stage needs to know what functions and global variables are available. These are collected into manalink.h header file. There aren't very many of them yet, but enough to get the sample cards compiled into objects.

The linker needs to know memory addresses of all functions and variables used, and the start address of the code being linked. Most of the magic (pun alert here too!) is in manalink.lds, which is a custom linker script that tells the linker where everything is and commands it to produce a plain binary blob instead of normal executable. Each card or function is turned into binary separately. It is possible to put all code into one file, but then finding the code pointers for cards in the middle would require extra work. With separate files we can simply add the size of previous file to its start address.

jatill wrote:Is there any particular compiler I need to use to run your build script? I tried MinGW but it pukes on the params in your build script.
I guess you are missing glib, which is used by the tool I wrote for injecting the binary blobs into the excutable or dll. I believe the developer installation of camelbox includes everything you need, but I'm not sure. I compiled the cards in linux...
LoneFox
Programmer
 
Posts: 71
Joined: 08 Mar 2009, 13:43
Has thanked: 0 time
Been thanked: 7 times

Re: Manalink update 2009-03-11

Postby mathusalem » 11 Mar 2009, 20:39

I see Orion's cards are still in the CSV. so you didn't destroy them ?
User avatar
mathusalem
 
Posts: 459
Joined: 24 Feb 2009, 21:00
Has thanked: 6 times
Been thanked: 4 times

Re: Manalink update 2009-03-11

Postby LoneFox » 11 Mar 2009, 20:54

mathusalem wrote:I see Orion's cards are still in the CSV. so you didn't destroy them ?
I copied them in, but didn't test them (except Sol'kanar, which was in my shockland test deck) so I don't know if they work.
LoneFox
Programmer
 
Posts: 71
Joined: 08 Mar 2009, 13:43
Has thanked: 0 time
Been thanked: 7 times

Re: Manalink update 2009-03-11

Postby Snacko » 11 Mar 2009, 21:08

I like the C part however most if not all of the perl script could be made into a Makefile (never really liked perl). Plus you could make make it behave with mingw ;) pkg-config is not really a tool you would use under windows.
Also if you compiled it under linux I would have some worries as gcc uses ELF binary format for the object files and under windows it's COFF or a derivative and this could lead to code not working.
Edit:
I see you use binary output from ld so all is fine.
Last edited by Snacko on 11 Mar 2009, 21:26, edited 1 time in total.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: Manalink update 2009-03-11

Postby HarryPitfall » 11 Mar 2009, 21:23

None of the shocklands are recognized as basic lands, i look at csv and magic.exe slots, and they are equal of dual lands... :/
I'm sorry to say, but, this ISN'T a bug of my code...
The shocklands are just a chain code of a comes into play window, that you pay 2 life or tap the card, and the original CODE of dual lands... so, temple garden call savannah code!
There is a really major flaw on this, since temple garden, the first card (that i didn't code), isn't recognize... this isn't good, since kird ape, wild nacatl, matca rioters, landwalkers, blanchwood armor will not recognize it...
We need a fix, urgently...
The bouncelands have a huge cheat bug... just press 'cancel' two or more times when asked to bounce a land... and you don't need to return a land... (AI do it versus me...)
And the signets add mana on 'paying cost' events... not when resolves.... (ok, they are mana abilities, but the timing of add mana is very wrong)
HarryPitfall
AI Programmer
 
Posts: 175
Joined: 31 May 2008, 00:14
Has thanked: 1 time
Been thanked: 3 times

Re: Manalink update 2009-03-11

Postby mathusalem » 11 Mar 2009, 21:46

Ok I finished the image processing ; here is the link
I'll post it in the graphic sticky as well

http://rapidshare.com/files/208118228/CardArtNew_.rar
User avatar
mathusalem
 
Posts: 459
Joined: 24 Feb 2009, 21:00
Has thanked: 6 times
Been thanked: 4 times

Re: Manalink update 2009-03-11

Postby jatill » 11 Mar 2009, 22:16

HarryPitfall wrote:None of the shocklands are recognized as basic lands, i look at csv and magic.exe slots, and they are equal of dual lands... :/
I'm sorry to say, but, this ISN'T a bug of my code...
The shocklands are just a chain code of a comes into play window, that you pay 2 life or tap the card, and the original CODE of dual lands... so, temple garden call savannah code!
There is a really major flaw on this, since temple garden, the first card (that i didn't code), isn't recognize... this isn't good, since kird ape, wild nacatl, matca rioters, landwalkers, blanchwood armor will not recognize it...
We need a fix, urgently...
The bouncelands have a huge cheat bug... just press 'cancel' two or more times when asked to bounce a land... and you don't need to return a land... (AI do it versus me...)
And the signets add mana on 'paying cost' events... not when resolves.... (ok, they are mana abilities, but the timing of add mana is very wrong)
I don't have a clue how to fix the shocklands, sadly. Even if you take off the chain and just call the dual land code, the land type doesn't count. I suspect that the ids are hard-coded, but I haven't tested.

I didn't notice that there was a cancel button for the bouncelands. I think I can remove this. Stupid cheating AI :)

Is there something actually wrong with the signets? They should add mana as part of the effect, not the resolution. Mana abilities don't use the stack.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: Manalink update 2009-03-11

Postby jatill » 11 Mar 2009, 22:25

Snacko wrote:I like the C part however most if not all of the perl script could be made into a Makefile (never really liked perl). Plus you could make make it behave with mingw ;) pkg-config is not really a tool you would use under windows.
Also if you compiled it under linux I would have some worries as gcc uses ELF binary format for the object files and under windows it's COFF or a derivative and this could lead to code not working.
Edit:
I see you use binary output from ld so all is fine.
I'll try installing the camelbox thing and get the compiler working from windows, but man, if someone get get this to "just work" via Makefile or whatever, I'd be so thrilled. Rather, more thrilled, since this new way of programming is going to make development probably 10 times faster for simple cards.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: Manalink update 2009-03-11

Postby Th3 H4xX » 11 Mar 2009, 22:29

Hey I dont want to bug you but I would really like to be able to play sealed mode with the standard amount of max90 cards instead of 892417,3 cards :(
Th3 H4xX
 
Posts: 9
Joined: 10 Mar 2009, 20:51
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Patches

Who is online

Users browsing this forum: No registered users and 32 guests


Who is online

In total there are 32 users online :: 0 registered, 0 hidden and 32 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 32 guests

Login Form