It is currently 17 Jun 2019, 23:24
   
Text Size

Deckbuilder update

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

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

Deckbuilder update

Postby Korath » 08 Jun 2016, 22:04

So yeah. One of Manalink's limits that's looming up in the very near future is a hard limit of 16,383 total cards, tokens, effect cards, alternate-versions-of-cards (like "Ghitu Encampment Animated" and "Heliod, God of the Sun Incarnate"), pseudo-cards (like "* Draft" and "* SPAT"), etc. "Very near future" in this case means that there's only 181 left, so unless Eldritch Moon in mid-July - announced as 205 cards, probably around a dozen of which will be double-faced and so require two slots each - has a ridiculously high number of reprints, we won't be able to fit it in. Conspiracy 2 at the end of August is out of the question.

There was a similar limit of 4095 cards that was very easily overcome - so easily, that I don't think anyone even bothered to mention it, compared to the more artificial and much more difficult 2000-card problem. (edit: Nope, was brought up here.) What was happening was that cards' internal id numbers were being truncated to 12 bits (2^12 = 4096), so that the 32-bit integers they're stored in can also accommodate other information. As it happens, nothing was being used in the 13th and 14th bits, so increasing the limit to 16383 (2^14 - 1) was simply a matter of changing a bunch of "AND <some address or register>, 0xFFF" instructions to "AND <the same thing as before>, 0x3FFF". It was trivial to search for such instructions; generally easy to be sure they were being applied to the right data, even without fully understanding the purpose of the surrounding functions; and trivial to update in-place, since the new instruction is always exactly the same size as the old one. I know this because it was one of the first things I had to do when updating Shandalar.

Bits 15 through 19, though, are used, so things would break if I just did the same thing again, even just widening by one bit to 32767 possible cards. They'd immediately break very badly in Shandalar: bit 15 stores whether an owned card is currently in the deck you duel with. Even in Manalink, though, it would require more work than expanding past 4095, since these bits are all used when exchanging data with the deckbuilder, and also internally in the deckbuilder.

So TLDR: among other things, we urgently need a deckbuilder update, and that's what I've been working on reverse-engineering for the last month and a half.

We probably could've gotten away with a more minimal patch if Manalink were our only concern, but it's really not anymore; patching all the changes to make it work with Shandalar would have taken at least as long, and I'm tired of it taking days to do things like make it legal to put more than four Snow-Covered Plains or Relentless Rats in a deck instead of seconds, so here we are. Rewriting it de novo would also have been an option; I decided against that because, unlike drawcardlib or cardartlib, it was unclear how its behavior has to change when invoked with different options. (It's still unclear, for that matter.)

At this point, it's more or less feature-complete, though I haven't yet fiddled with data interchange with Magic.exe - the whole point of the exercise! - and I've only given it very cursory testing. Everything seems to work, though, and I'm not going to be able to spend any significant amount of time on it in the next week and a half, so now seems like a good time for some wider testing.

This will not work with any but the earliest versions of Shandalar-2015/16 - RT*, LT1-3, or TH1-2 - since they patch the dll at runtime, and so are tied to the precise version we've been stuck with since the last time Mok updated it. It should work with original Shandalar just fine (though current drawcardlib.dll/cardartlib.dll as included in BFZ and later Manalink patches will not), as well as the standalone deck.exe and any version of Manalink.

Known differences from the previous deckbuilder:
These are all pretty underwhelming | Open

Please assume anything else is a bug, and report it in this thread. You'll definitely want to keep a backup of your old DeckDll.dll for when this one inevitably proves deficient. Testing against compatible versions of Shandalar - see above for which - would be particularly welcome, since I haven't done that at all yet. (There's full installation archives for some of the RT versions floating around on freakin' Youtube. Some of them even bother to point back here.)

PS: This is probably futile, but if any stray programmers reading this have any experience at all working with Windows resource files at a low level, the one attached to the previous DeckDll.dll was corrupt. All the usual tools that normally make reverse-engineering them so easy just crash instead. I don't know whether MicroProse did this intentionally (I can't imagine why they would, compared to how little effort they put into obfuscating everything else), or Mok did it accidentally when he updated it; but it's seriously irritating, and it's going to make any updates to the dialogs way more difficult than they should be. I've included it in the attached zip. Any assistance appreciated. Never mind; tried enough tools and I eventually found one that gave me partial output, and I was able to reconstruct the rest.
Attachments
deckbuilder-67-gfbad373.zip
(133.87 KiB) Downloaded 237 times
Last edited by Korath on 03 Jul 2016, 01:51, edited 3 times in total.
User avatar
Korath
DEVELOPER
 
Posts: 3385
Joined: 02 Jun 2013, 05:57
Has thanked: 482 times
Been thanked: 938 times

Re: Deckbuilder update

Postby stassy » 09 Jun 2016, 06:56

Ticking off the consolidate option will hang the deckbuilder even with a small number of cards(Deck.exe launched on standalone under BFZv2)

The 2nd option of the multicolor button "Matching all selected color buttons" should show only multicolored with selected color buttons but it dosen't show any multicolored cards and show mono colored cards

The 3rd option of the multicolor button "Matching any selected color button" should also show multicolored cards with multicolored card with at least one of the color selected (eg. multicolor + blue should show multicolored blue+red or blue+white or blue+green+black, etc..) but it doesn't and also show monocolored cards.
stassy
Moderator
 
Posts: 5274
Joined: 25 Feb 2009, 07:06
Has thanked: 471 times
Been thanked: 337 times

Re: Deckbuilder update

Postby Korath » 09 Jun 2016, 16:32

I'll try to look into the consolidate option this weekend. (Also known: colorless and multicolor cards and instants tend to get their numbers doubled, most easily by selecting "sort deck".)

Concrete examples would make fixing the multicolor button bugs faster. For example:I can't repro either of those, by the way. I agree that there should be an option to exclude monocolor cards, and even that the current labels are a little misleading. I want to make sure everything is working at least as correctly as the old deckbuilder before fixing anything but the most obvious of its bugs in the parts I understand the best and have the most confidence are working correctly, though, and the filters are one of the areas I have the least confidence in.

(As long as we're talking about obviously-missing filter features that I probably won't get to in the short term: the interrupt, Fourth Edition, Astral, Arabian Nights, Antiquities, Legends, and The Dark buttons should go, and should be replaced by planeswalker and colorless buttons. That leaves five main filter buttons to be replaced - what's conspicuous by its absence? Perhaps "Special cards", for planes, vanguard avatars, schemes, and Draft/etc?)
Last edited by Korath on 09 Jun 2016, 16:42, edited 1 time in total.
User avatar
Korath
DEVELOPER
 
Posts: 3385
Joined: 02 Jun 2013, 05:57
Has thanked: 482 times
Been thanked: 938 times

Re: Deckbuilder update

Postby Aswan jaguar » 09 Jun 2016, 16:39

For me I couldn't open the deckbuilder after using the new DeckDll.dll.
1- Open Deck.exe or open through Manalink: It would give me error "fatal:couldn't load deck builder bitmaps" for BFZ2,BFZ1 Manalink3.0 versions.
2- Open Deck.exe: It would give me error "deck.exe - unable to locate component:This application has failed to start because image.dll was not found" for Moks Manalink.2.0 last version and same for Manalink2.0 just before Manalink.3.0 first release.Same error if I try to open Shandalar.
---
Just playtesting.
User avatar
Aswan jaguar
Super Tester
 
Posts: 6308
Joined: 13 May 2010, 12:17
Has thanked: 532 times
Been thanked: 274 times

Re: Deckbuilder update

Postby Korath » 09 Jun 2016, 16:52

"Fatal: Couldn't load deck builder bitmaps": each of the following images must exist in your DBArt/ directory: Ability.pic, Antiquit.pic, Arabnite.pic, Artifact.pic, Astral.pic, Black.pic, Bldr01c.pic, Bldr02c.pic, Bldr03c.pic, Bldr04c.pic, Bldr05c.pic, Blue.pic, BtnBkg.pic, CastCost.pic, Creature.pic, Dark.pic, Dekbar1.pic, Dektile4.pic, Dektit1.pic, Enchant.pic, FilterBkg.pic, Fourth.pic, Gold.pic, Green.pic, InfoBkg.pic, Instant.pic, Interrupt.pic, Land.pic, Legends.pic, Other.pic, Power.pic, Rarity.pic, Red.pic, Sorcery.pic, Statbak1.pic, Tough.pic, White.pic. If you have a Skin setting other than "." in your Manalink.ini, they're looked for in that directory relative to DBArt/ instead (only). I'm not confident in general about the error checking done for these by the previous deckbuilder, and in particular I'm certain it won't die if BtnBkg.pic is missing.

image.dll: It might work to copy the image.dll from a Manalink 3 installation in. Or else just say it only works with Manalink 3 and early Shandalar 2015 if we have to.
User avatar
Korath
DEVELOPER
 
Posts: 3385
Joined: 02 Jun 2013, 05:57
Has thanked: 482 times
Been thanked: 938 times

Re: Deckbuilder update

Postby Aswan jaguar » 09 Jun 2016, 17:23

For Manalink bfz series the problem was the missing BtnBkg.pic.
---
Just playtesting.
User avatar
Aswan jaguar
Super Tester
 
Posts: 6308
Joined: 13 May 2010, 12:17
Has thanked: 532 times
Been thanked: 274 times

Re: Deckbuilder update

Postby Aswan jaguar » 11 Jun 2016, 06:16

You probably know the problem with hybrid mana cards showing only usually to their first(upper colour in round box) of 2 or more colours when choosing matching multicolour button.This is the case for the old and is also for the new deckbuilder.
1a- For instance Belligerent Hatchling will show only when choosing red and matching multicolour button all or/& any.It will not show when choosing white and matching multicolour button all or/& any.
1b- For instance Boartusk Liege will show only when choosing red and matching multicolour button all or/& any.It will not show when choosing green and matching multicolour button all or/& any.
1c- Arsenal Thresher will show only when choosing white or/and blue and matching multicolour button all or/& any.It will not show when choosing black and matching multicolour button all or/& any.

EDIT:also if you want only all multicoloured cards and choose that you don't get the multicoloured artifacts (if you don't want to have all non coloured artifacts also by having on artifacts).
EDIT1: About the 5 remaining buttons that we could change one for certain has to be Legendary type and probably use the others for other card types like snow,tribal.
Last edited by Aswan jaguar on 11 Jun 2016, 06:55, edited 4 times in total.
Reason: add edit
---
Just playtesting.
User avatar
Aswan jaguar
Super Tester
 
Posts: 6308
Joined: 13 May 2010, 12:17
Has thanked: 532 times
Been thanked: 274 times

Re: Deckbuilder update

Postby Korath » 12 Jun 2016, 12:55

New build #67 attached to first post.
This fixes: | Open

"Multicolor" + "Artifacts" showing colorless artifacts too is another consequence of there being no specific colorless button.
User avatar
Korath
DEVELOPER
 
Posts: 3385
Joined: 02 Jun 2013, 05:57
Has thanked: 482 times
Been thanked: 938 times

Re: Deckbuilder update

Postby gmzombie » 12 Jun 2016, 17:21

Great job as always man. So if we are going to get rid of or change them can I suggest of course if this is possible a standard, modern, legacy button as it could make it easier to find cards..not a deal breaker if bit can't be done though.
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: 855
Joined: 26 Feb 2009, 01:05
Location: Wyoming, Mi
Has thanked: 199 times
Been thanked: 50 times

Re: Deckbuilder update

Postby Korath » 13 Jun 2016, 18:08

The Expansions filter (right-click on the far left button) does most of what you want. Or it would, if the first couple pseudo-expansions were up-to-date (they mostly are, other than "Block") and were properly named. I suppose it might be useful to have a separate Format button for those, and have it change the behavior of the banned/restricted filters on the far right button.

Speaking of which, we could use a "Mythic Rare" filter on that one. It'll be a bit nontrivial, since the field normally inspected for rarity can only handle common/uncommon/rare; deckdll does have access to the per-set rarity columns, but it's harder to access.
User avatar
Korath
DEVELOPER
 
Posts: 3385
Joined: 02 Jun 2013, 05:57
Has thanked: 482 times
Been thanked: 938 times

Re: Deckbuilder update

Postby lujo » 16 Sep 2016, 11:31

Well, I've got a few suggestions about the land button if I may?

How about it having a basic only filter to make adding basic lands extra easy? (I'm kinda-sorta aware of that feature existing somewhere but it should really be on the land button)

Then, how about a land filter for various famous cycles? This sounds like work, I'd gladly do any of it myself if I had the idea what's needed, but there's a rather good table of landbases floating around the net which illustrates the groupings.

Some form of land filtering can allready be achieved by filtering editions, but that's rather clumsy for several reasons (one of them being that not all cycles were printed in the same edition, and also that you don't really want to filter everything by edition and it's not a quick way to sort out / change up the manabase of whatever you're tweaking).

All the varios cycles of lands have unofficial but solidly entrenched names, and being able to filter them that way would be handy - Alpha Duals , Painlands , CiP Duals , CiP Tri-lands , Filter Lands, Fetchlands , Ravnica Duals etc. I could whip up a table, make a formal request etc.
---

My Shandalar deck pack folder is avaliable here:Dropbox
Leave feedback on particular decks here: Google doc
Ask for instructions, give feedback and complaints here: Thread
User avatar
lujo
 
Posts: 557
Joined: 20 Nov 2013, 13:17
Has thanked: 224 times
Been thanked: 70 times


Return to Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron

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 287 on 31 Mar 2019, 04:11

Users browsing this forum: No registered users and 2 guests

Login Form