Advanced Code Development
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
13 posts
• Page 1 of 1
Advanced Code Development
by HarryPitfall » 01 Mar 2009, 02:43
Event with all my work (that is done), I take some time to look after snacko examples, and, i finally manage to code the first card using yasm... yes, real assembler, compiled into a dll...
Also, I found some bugs with the yasm itself, like stupid code generation about jumps :/ but is fine now...
I'll not post yet the package, since I'm thinking a way to integrate the yasm developmento on the editor...
Magic.exe
ManalinkEx.dll => for hand made code, 2 mb of size, load at $1001000
ManalinkEh.dll => compiled by code, no size restriction, load at $2001000
I'm attaching just the macro and assembler file, to show how the things work...
The card coded is:
Nullify, Instant, 1WG
Remove target artifact or enchantment from the game.
So now, I'm accepting here what people thinks about this... If no one is using the manalinkex.dll, I'm really thinking in dropping it from magic.exe and works entirelly on this new way...
Also, I found some bugs with the yasm itself, like stupid code generation about jumps :/ but is fine now...
I'll not post yet the package, since I'm thinking a way to integrate the yasm developmento on the editor...
Magic.exe
ManalinkEx.dll => for hand made code, 2 mb of size, load at $1001000
ManalinkEh.dll => compiled by code, no size restriction, load at $2001000
I'm attaching just the macro and assembler file, to show how the things work...
The card coded is:
Nullify, Instant, 1WG
Remove target artifact or enchantment from the game.
So now, I'm accepting here what people thinks about this... If no one is using the manalinkex.dll, I'm really thinking in dropping it from magic.exe and works entirelly on this new way...
- Attachments
-
Nullify.zip
- The assembler source, with one card coded
- (1021 Bytes) Downloaded 497 times
- HarryPitfall
- AI Programmer
- Posts: 175
- Joined: 31 May 2008, 00:14
- Has thanked: 1 time
- Been thanked: 3 times
Re: Advanced Code Development
by jatill » 01 Mar 2009, 03:53
I have 10 cards coded in the dll right now.
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Advanced Code Development
by HarryPitfall » 01 Mar 2009, 04:34
Now, we have some choices...
1) Use only manalinkex.dll as a extra dll, so, same work as before... code, patch... using the editor.
2) Drop manalinkex.dll, and use only manalinkeh.dll, the new way to code, if this choice is made, I'll recode civic wayfinder using the yasm, with nice macros, and so on.
3) Use both, manalinkex.dll, with the editor, like most people already know how to work, AND, manalinkeh.dll (with some new features added to editor to support it), for 'programmers', that know how to work with it.
My vote is option 3, most people know how to use direct assembler and patch, and can contribute perfectly, and others, can code in yasm and compile (much like me... for example...)
1) Use only manalinkex.dll as a extra dll, so, same work as before... code, patch... using the editor.
2) Drop manalinkex.dll, and use only manalinkeh.dll, the new way to code, if this choice is made, I'll recode civic wayfinder using the yasm, with nice macros, and so on.
3) Use both, manalinkex.dll, with the editor, like most people already know how to work, AND, manalinkeh.dll (with some new features added to editor to support it), for 'programmers', that know how to work with it.
My vote is option 3, most people know how to use direct assembler and patch, and can contribute perfectly, and others, can code in yasm and compile (much like me... for example...)
- HarryPitfall
- AI Programmer
- Posts: 175
- Joined: 31 May 2008, 00:14
- Has thanked: 1 time
- Been thanked: 3 times
Re: Advanced Code Development
by Snacko » 01 Mar 2009, 10:08
What do you not like about the jumps in yasm ?
Also you can use local labels to use more descriptive names Ex:
Also I can feel a strong resentment toward naming things (however you're on a good way!, the readability of the Nullify has already greatly improved compared to the straight asm), but look it from the other way proper named variables / functions and some comments double as a documentation.
That also means that people who don't know the internals too well can't really code any cards at all.
The "lego" work everyone talks here isn't happening because there aren't really any building blocks currently available and in order to build working cards that don't share exact same code one must reverse engineer your card (which is most likely too hard for the "lego" people to start with).
Also you can use local labels to use more descriptive names Ex:
- Code: Select all
Nullify:
some code
.Loop
more code
je .Loop ; je Nullify.Loop
Swamp:
some code
.Loop
more code
je .Loop ; same as je Swamp.Loop
Also I can feel a strong resentment toward naming things (however you're on a good way!, the readability of the Nullify has already greatly improved compared to the straight asm), but look it from the other way proper named variables / functions and some comments double as a documentation.
That also means that people who don't know the internals too well can't really code any cards at all.
The "lego" work everyone talks here isn't happening because there aren't really any building blocks currently available and in order to build working cards that don't share exact same code one must reverse engineer your card (which is most likely too hard for the "lego" people to start with).
Last edited by Snacko on 01 Mar 2009, 11:25, edited 1 time in total.
Re: Advanced Code Development
by gmzombie » 01 Mar 2009, 10:26
um i like option 3. as im not all knowing on this front and would still like to contribute when i can
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: Advanced Code Development
by HarryPitfall » 01 Mar 2009, 13:20
Snacko, I just convert the disenchant code into yasm, without working with the labels at all... isn't a release version, just a 'demo' of how the card can be made...
A final version can use:
Nullify:
..
Nullify_1:
..
Nullify_2:
..
labels with the card name/shortname... to be more readable, and more macros to 'hide' all that pointer stuff...
A final version can use:
Nullify:
..
Nullify_1:
..
Nullify_2:
..
labels with the card name/shortname... to be more readable, and more macros to 'hide' all that pointer stuff...
- HarryPitfall
- AI Programmer
- Posts: 175
- Joined: 31 May 2008, 00:14
- Has thanked: 1 time
- Been thanked: 3 times
Re: Advanced Code Development
by Snacko » 01 Mar 2009, 13:25
I'm just putting my remarks so once you settle up you can use the tools available to the best extent possible and in this case it's the local labels which make perfect sense.
Re: Advanced Code Development
by HarryPitfall » 01 Mar 2009, 19:07
Based on latest jatill update, i make this 'sample' assembler code for manalinkeh (the new dll code)...
Look how hard is make the similar cards... (shocklands, signets and karoos), using macros...
I'll wait sometime, to see the releases and so on, but i'm really want to used both dll's on magic.exe... some advanced users can code cards on yasm...
Look how hard is make the similar cards... (shocklands, signets and karoos), using macros...
I'll wait sometime, to see the releases and so on, but i'm really want to used both dll's on magic.exe... some advanced users can code cards on yasm...
- Attachments
-
SampleManalinkEh.zip
- (1.41 KiB) Downloaded 461 times
- HarryPitfall
- AI Programmer
- Posts: 175
- Joined: 31 May 2008, 00:14
- Has thanked: 1 time
- Been thanked: 3 times
Re: Advanced Code Development
by Snacko » 01 Mar 2009, 20:40
Please name the functions you use, it
Ex.
Ex.
Also if the function returns a value maybe something like eax tapAndAddOneMana or [esi] tapAndAddOneMana if it's a pointer to a structure in esi.
Those comments make the code more readable and help new people to jump in, as they can read the source and understand why and what you are doing cmp [esi+0x37], 0x20010 vs cmp CardStatus, CardTapped | CardHasSummoningSickness. I would take the second one any day and if you need to know exactly what values those names stand for, all you need to do is check their definition.
Ex.
- Code: Select all
call GetCardInfo
call PayOneAndAddTwoMana
Ex.
- Code: Select all
%define TapAndAddOneMana 0x47B6C0 ; tapAndAddOneMana (PlayerID, CardID, EventCode, ManaColor)
push BlackMana
push EventCode
push CardID
push PlayerID
Also if the function returns a value maybe something like eax tapAndAddOneMana or [esi] tapAndAddOneMana if it's a pointer to a structure in esi.
Those comments make the code more readable and help new people to jump in, as they can read the source and understand why and what you are doing cmp [esi+0x37], 0x20010 vs cmp CardStatus, CardTapped | CardHasSummoningSickness. I would take the second one any day and if you need to know exactly what values those names stand for, all you need to do is check their definition.
Re: Advanced Code Development
by HarryPitfall » 01 Mar 2009, 20:58
Well.. since my 2 examples that I posted get so much trouble (a.k.a.: you're doing it wrong), I'll leave that dll for people that is expert of assembler code... maybe my 16 years of software development isn't enough...
So long, and thanks for all the fish... I'll not try anything more with the dll... is free for anyone trying...

So long, and thanks for all the fish... I'll not try anything more with the dll... is free for anyone trying...
- HarryPitfall
- AI Programmer
- Posts: 175
- Joined: 31 May 2008, 00:14
- Has thanked: 1 time
- Been thanked: 3 times
Re: Advanced Code Development
by Snacko » 01 Mar 2009, 21:02
Not saying you're doing it wrong, it's just you can make more out of it!
I can feel a xenophobic attitude, I'm not here to depreciate anyone's effort but to offer advices how to improve it. If I'm not welcomed here I won't post anymore and leave you to do things you did before.
I can feel a xenophobic attitude, I'm not here to depreciate anyone's effort but to offer advices how to improve it. If I'm not welcomed here I won't post anymore and leave you to do things you did before.
Re: Advanced Code Development
by Bog Wraith » 02 Mar 2009, 04:47
Snacko, you are certainly welcomed here and your input is most wanted!
I think that there might be a factor here that Harry's first language is not english and that his writings can be misinterpreted because of this fact.
Look guys, the best thing about this whole thing is the availability of such talented and diverse people as yourselves being able to "compare notes" and share your knowledge with one another. As well as for you getting more people involved in learning to code for this project with such things as for example, jatill's tutorials.
I can not stress enough how important that is!
So, if there is any ego that is interfering with this, I humbly ask all of you guys to put it aside and do what is best for this project. Each one of you could, and I'm convinced, will be keys to breaking this game wide open and making it almost a totally new game!
This back and forth between all of you guys is one of the main reasons I want to make this forum the new and permanent home for ManaLink.
So please, be patient with one another and try to be as diplomatic as possible.
I love this game and I know many others do too. Not bad for a computer game that is over 12 years old!
Lets all work together to make it all it can be and give it a great future for years to come.
I think that there might be a factor here that Harry's first language is not english and that his writings can be misinterpreted because of this fact.
Look guys, the best thing about this whole thing is the availability of such talented and diverse people as yourselves being able to "compare notes" and share your knowledge with one another. As well as for you getting more people involved in learning to code for this project with such things as for example, jatill's tutorials.
I can not stress enough how important that is!
So, if there is any ego that is interfering with this, I humbly ask all of you guys to put it aside and do what is best for this project. Each one of you could, and I'm convinced, will be keys to breaking this game wide open and making it almost a totally new game!
This back and forth between all of you guys is one of the main reasons I want to make this forum the new and permanent home for ManaLink.
So please, be patient with one another and try to be as diplomatic as possible.
I love this game and I know many others do too. Not bad for a computer game that is over 12 years old!

Lets all work together to make it all it can be and give it a great future for years to come.

'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: Advanced Code Development
by 0rion79 » 03 Mar 2009, 14:42
@GMZombie,
I strongly agree... and I also find Harry's tools extremely useful (also because I have used the new .dll to store cards).
So hope that from this matter may arise only new opportunities to increase the game even more, not only from the viewpoint of the card database, but also about in-game options (maybe in the future).
All the best!

I strongly agree... and I also find Harry's tools extremely useful (also because I have used the new .dll to store cards).
So hope that from this matter may arise only new opportunities to increase the game even more, not only from the viewpoint of the card database, but also about in-game options (maybe in the future).
All the best!
-
0rion79 - Posts: 1520
- Joined: 24 Feb 2009, 18:33
- Location: Italy
- Has thanked: 94 times
- Been thanked: 61 times
13 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests