It is currently 20 Apr 2024, 03:52
   
Text Size

Magic Duels tests and results

Moderator: CCGHQ Admins

Re: Magic Duels tests and results

Postby Nick26 » 03 Feb 2017, 17:16

I have been doing a lot of experiments later and finally I have good news :D I want to thank thefiremind for the big idea of using an hex editor to edit cards. So, this is what I did and what I found out:
1) Using notepad++ (and unicode) I tried to make a custom shock, that is "shock_111111". I changed 396159 to 111111 instead of just 1 becouse I did not want to change the lenght of the file (since the card name is written in the card file too). The card did not work.
2) I did the same thing using HxD, an hex editor and... it WORKED!! Then I tried to change the casting cost from {R} to {0} and the damage dealt from 2 to 9 and again, it worked perfectly, the card showed up ingame and it does what it is supposed to do :D
3) I tried then to change the damage from 2 to 20 adding bytes with the hex editor but unfortunately the card was not recognized by the game. I made other experiments like changing the name to shock_1 or the casting cost to 10 (so, adding a digit) but again, the card did not work.

So apparently, there is an issue when we change the file lenght, may be the file lenght is coded somewhere in the file or there is some kind of checksum, I have no idea. Also, notepad++ and other text editors do not work, no clue why. Anyway, the custom zed still works fine!

edit: while building my "new" coin farm deck I realised that now it is no longer possible to build a deck with more than 4 copies of the same card (not a big issue actually) and with 15 or less lands.
Nick26
 
Posts: 71
Joined: 23 Mar 2015, 16:40
Has thanked: 14 times
Been thanked: 0 time

Re: Magic Duels tests and results

Postby thefiremind » 03 Feb 2017, 21:38

Nick26 wrote:I want to thank thefiremind for the big idea of using an hex editor to edit cards.
You're welcome, but that's strange because when I tried, it didn't work. It's worth noticing that I didn't do exactly as you did: my test with the hex editor only involved changing the card's text, but I didn't change the Multiverse ID because I was hoping to override the original card. I tried to change the Multiverse ID of a card while keeping the file uncompiled, and I couldn't see the card in game.

Nick26 wrote:So apparently, there is an issue when we change the file lenght, may be the file lenght is coded somewhere in the file or there is some kind of checksum, I have no idea.
There actually is information in .METADATA\FileData.xml about the position (and thus also the length) of the files inside the ZED, but it has never mattered. What probably happens is that the compiled Lua code is not valid anymore if you insert bytes.

Nick26 wrote:Also, notepad++ and other text editors do not work, no clue why.
You usually can't edit binary files with text editors: some bytes get lost and/or headers are added.

By adding your test results with mine, for now I would assume that:
  1. We can't override existing cards the usual way. Sure, we can make a copy with a different name and then change all the references to it in the card pools and campaign/AI decks that use it, but I'd find it highly impractical. If there's a better way, we might have to wait for the next expansion in order to find out.
  2. If we add new cards, they need to be compiled. Now, this doesn't seem a big deal... if we can actually produce compiled files that the game happily reads. As far as I know, it should be enough to use luac from a 32-bit version of Lua 5.1.x, and then change the 6th byte from 00 to 5F. But will it really be all we need? I'll test more.
EDIT: I can confirm the previous assumptions. I'm going to write a tutorial about how to create a working card for your custom ZED files, but be aware, it's not a user-friendly procedure.

EDIT 2: The tutorial can be found here. Let me know if it works for you.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Magic Duels tests and results

Postby Nick26 » 05 Feb 2017, 07:05

It works great, thanks :) Unfortunately now I will have to learn the new code (which is driving me crazy with all those brackets).
Nick26
 
Posts: 71
Joined: 23 Mar 2015, 16:40
Has thanked: 14 times
Been thanked: 0 time

Re: Magic Duels tests and results

Postby Xander9009 » 05 Feb 2017, 07:35

Well, the changes are fairly straightforward. More than likely, someone will eventually create a map for the different name changes of various tags and attributes, and once that's done, a converter should be relatively simple. (Not exactly "easy", but not too difficult, at least.)
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Magic Duels tests and results

Postby Nick26 » 05 Feb 2017, 10:05

That would be really nice! Today after 3 hours straight of work I have been finally able to recode Emrakul, The Promised End :D :D :D
Nick26
 
Posts: 71
Joined: 23 Mar 2015, 16:40
Has thanked: 14 times
Been thanked: 0 time

Re: Magic Duels tests and results

Postby thefiremind » 05 Feb 2017, 11:02

Nick26 wrote:Unfortunately now I will have to learn the new code (which is driving me crazy with all those brackets).
I find the various nested brackets a little confusing, too: the XML was definitely easier to check with a quick glance. However you can choose to make local variables and code parts of the card one at a time, much like I did with the card pools (I made a table tCards with the card list and then added it to the card pool at the end), it could be helpful in order to reduce nesting.

EDIT: Here are the interpreted cards from Amonkhet, if someone is interested.
Code: Select all
http://www61.zippyshare.com/v/QwjgQ1Ek/file.html
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Magic Duels tests and results

Postby magius74 » 04 May 2017, 00:48

Hey a new set is out for Magic Duels, been playing it. Does the new set have anything to add or change in the development of this project? Just curious. I've been watching this forum for awhile.
magius74
 
Posts: 20
Joined: 15 Aug 2015, 07:58
Has thanked: 2 times
Been thanked: 0 time

Re: Magic Duels tests and results

Postby Xander9009 » 04 May 2017, 19:13

Hey firemind, that link you posted to the interpreted cards (originally, all of them) is expired. I'm trying to match up all of the tags and attributes to build a converter, but I've only got one card (Abandon Reason) in both versions (XML and interpreted lol), which makes it a bit difficult. Any chance you've still got the file? I'm not sure anyone would use a converter, but it'd be nice to have one, I think.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Magic Duels tests and results

Postby thefiremind » 04 May 2017, 21:36

Xander9009 wrote:that link you posted to the interpreted cards (originally, all of them) is expired.
You can produce the interpreted versions quite easily by following the tutorial I posted here.

Xander9009 wrote:I'm not sure anyone would use a converter
That's the main reason I gave up trying to make one: there's almost no demand.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Magic Duels tests and results

Postby Xander9009 » 04 May 2017, 21:45

I forgot about the tutorial. Thanks. :)
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Magic Duels tests and results

Postby Nick26 » 14 May 2017, 06:29

thefiremind wrote:That's the main reason I gave up trying to make one: there's almost no demand.
That's sad, a converter would be so helpfull. I have been trying to code Phyrexian Obliterator and Cryptic Command for like two months but with no results. Did anyone manage to code those cards?
Nick26
 
Posts: 71
Joined: 23 Mar 2015, 16:40
Has thanked: 14 times
Been thanked: 0 time

Re: Magic Duels tests and results

Postby MasterXploder7 » 13 Jun 2017, 18:26

http://magic.wizards.com/en/articles/ar ... 2017-06-13

I posted this in the "unlock all the cards" forum as well. I figure you guys might want to see it too.
"Hate is an everlasting wellspring from which it is eternally sustained." - Nirkana Revenant
MasterXploder7
 
Posts: 293
Joined: 18 Jan 2014, 10:55
Has thanked: 28 times
Been thanked: 11 times

Re: Magic Duels tests and results

Postby Xander9009 » 13 Jun 2017, 18:28

MasterXploder7 wrote:http://magic.wizards.com/en/articles/archive/magic-digital/magic-digital-next-update-2017-06-13

I posted this in the "unlock all the cards" forum as well. I figure you guys might want to see it too.
Made a thread just for this. (I was already planning to, but you beat me to it lol.)
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Previous

Return to Magic Duels

Who is online

Users browsing this forum: No registered users and 2 guests


Who is online

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

Login Form