DotP 2014: Deck Builder: Wiki Doc

From RSN Magic
Revision as of 12:14, 1 July 2013 by RiiakShiNal (Talk | contribs) (Getting Started)

Jump to: navigation, search

This is the documentation for the DotP 2014 Deck Builder and is basically a web version of the Text Readme that is included with the program.

Main Features

  • Does not require wads to be extracted/imported to use resources from them. Automatically uses all available game resources (cards, decks, unlocks, images, personalities, etc...) from the game directory you point it to.
  • Automatically calculates deck colour (or lack thereof).
  • Will assist the user in building appropriate images for deck boxes and AI personalities.
  • Program itself is localizable (translations need to be finished though) so you can use the program in your selected language.
  • Supports TDX compression of generated images.
  • Supports generation of AppId Linking wads for Steam, Skidrow, and Theta versions.
  • Will automatically create Land Pool XMLs based on the colours of the deck.
  • Can create Deck Wads as either a packed WAD file or a specially set up directory complete with headers.

Requirements

  • .Net 4.0 Framework - This is the framework version that I compiled using.
  • Modified Gibbed Tools (version r6_b10 modified, included) - I reference the gibbed tools libraries for parsing wads and tdx images. I do not use the executables as I have created class wrappers that allow me to do the work I need to do in code rather than from the command line. Source code from the executables was used rather heavily in the development of the wrappers. Gibbed Tools Squish and FileFormats have to be my modified versions for the compression of TDX images, the reason I can't just fall back on the original versions is because I specifically reference functions I added to make the compression features work. Source code for the modified versions can be found here: Gibbed Tools modified to support compressing of images

Installing & Updating

To Install just unzip all of the files from the archive into any directory. The Deck Builder will automatically create a Settings.xml file with your settings when you close the program.

Updating is exactly the same as Installing except you will want to overwrite any duplicate files with those from the new package. Any new settings will automatically be added to your Settings.xml file when you close the program.

You do not need to worry about losing your settings as the Settings.xml contains all your settings and is not present in any of the packages so it will not be overwritten.

Getting Started

When you first load the program you will get a message about the game directory not being set (This is normal):

TODO: Add First Message

Click "OK" and it will take you to the Options Screen:

TODO: Add 2014 Options Screen.

You will need to set the Duels of the Planeswalkers 2014 Directory to the directory where DotP_D14.exe is located. It is also highly recommended that you use the Id Block and change it to a value that is unique to you (as this will prevent conflicts with decks made by other modders using this program). To aid in choosing unique values you can refer to the Prefix/Id Registry. Values other than the default (and those matching other chosen values) will show with a light green highlight.

If your native language is not English you can change that now as well.

Once you have selected the DotP 2014 Directory (and finished making any other changes) you can now [b]Apply[/b] these changes and it will return to the Main Program screen and load up all the Wads (packed or unpacked) and load all the cards you have installed into the list view at the bottom of the window (filtered by the default filters). This may take a few minutes to finish loading.

TODO: Add 2014 Main Screen

The columns can be resized, reordered, and even turned on or off. The window can also be resized to see more. The box labeled Double-Click adds card to: has a set of three radio buttons that will control which part of the deck that a card will be added to when you double-click it. You can also hit enter while the focus is on the bottom list to add the currently highlighted card in exactly the same way as double-clicking.

You can remove cards that you add by accident or simply don't want anymore by highlighting them and hitting delete on the keyboard or you can right-click and select Remove Card.

The Edit Name button can be used to change the name of the deck in all supported languages. Any fields left blank (other than English) will automatically be filled on Export with name you provided for English.

TODO: Add 2014 Edit Name Screen

Now you will probably want to set some other deck information such as the Deck Box Image, Card Preview, AI Personality, etc.... This can be done by clicking the Deck Information ... button.

TODO: Add 2014 Deck Information Screen

Now I'm going to choose the deck statistics that best describe how my deck performs, set the card preview to Angel of Mercy and I'm going to Build an Image for the Deck Box.

To edit the AI Personality click the Edit Personality ... button.

TODO: Add 2014 Edit Personality Screen

For the AI Personality you can use one of the existing personalities or create your own. Since this is just getting started I'm going to select an existing personality (from those I already have installed) from the drop down list directly below AI Personality.

TODO: Add Filled Out Deck Information Screen

The Location and Size boxes are for fine-tuning the image you are building.

At this point you might want to Save your deck or if you are happy with it and want to try it out in-game then you can Export the deck. Saving will allow you to save the deck anywhere you want, but it is not suitable to use in-game. Exporting will build a Wad (or a directory with the proper structure) to allow the game to read and use your deck.

Features In-Depth

Adding Cards

You can easily add cards by either hitting "Enter" while you have a card highlighted in the main card list or by "Double-Clicking" the card you want to add. If you are adding cards to the main deck and you add a single card more than once it will simply increment the quantity of that card that you have in the main deck. This does not apply if you have given a card in the deck a special status such as Bias or Promo status. When a card is added it is added at a Bias of 1 and no Promo status so if there is a card in the deck with a Bias of 2 or 3, or you have given that card Promo status then you add another copy of that card from the main card list, the added card will show up in your list as a separate instance with a Bias of 1 and no Promo status.

For the unlocks each card will always have a quantity of 1 because each unlock needs to be a single card and you may want to stagger a few copies of a card throughout the unlock list which can only really be done if all the cards have a quantity of 1.

This builder does not put limits on the total number of cards that can be added to a deck and its unlocks (except for Promo unlocks which has a max number of ten cards). This does mean that you could design a deck that has hundreds of cards in it, but it probably won't work properly in game. The game uses a single byte for the deckOrderId and for keeping track of whether a card is in the deck or not. Practically this means that deckOrderIds of 0 through 127 are available for use (128 card max) and this limit applies to the total number of cards a deck has including the unlocks.

While the max card limit for decks to be used in game is 128 cards the game itself is optimized for a 60 card deck and up to about 40 total unlocks (100 total cards) including the basic land in the main deck.

Removing Cards

To remove cards from the deck or from the unlocks make sure the card you want to remove is highlighted, the focus is on that listing and hit delete on the keyboard ("Del" key). you can also right-click the card you want to remove and select "Remove Card".

Note: You can't remove cards from the main card list (this program does not support editing existing wads). If you simply want to filter which cards are shown in the main card list then use the "Set Filters" button and select which filters you want to use.

Saving

Saving operates a bit differently than you might expect. It will save out the deck, but the file generated when you save is not meant to be used by the game. It contains extra information so that the Deck Builder does not need to manage multiple linked files. For example all saved decks will also include the land pool in a tag inside the deck. All unlocks, strings, and images generated will also be included inside the deck.

If you want to generate files that are appropriate for the game to use then you need to "Export" the deck.

Exporting

When you export a deck it will automatically name the output wad (or directory) based on the final deck uid and the English name of the deck codified to be file system friendly. So if you name your deck "My First Deck" and you are using the default Id Scheme with an id of 0 then the name or your exported wad will be "DATA_DECKS_100000_MY_FIRST_DECK.wad". This is done this way for a few reasons:

  • Mods must start with either "DATA_DECKS_" or "DATA_DLC_" (case insensitive) to be recognized.
  • Putting the Deck's uid in the wad name makes figuring out the uid of the deck inside very easy (this can help if looking for UID conflicts).
  • Having the Deck name in the filename makes managing custom decks easier for the user because the name they see in game relates to the one they see on the wad. Now there may be some differences for this due to language localizations, but this is a good compromise.

The exported wad (or directory) will automatically be put into the game directory so that it is ready to use. Also by having it in the game directory it will also be loaded into the builder as an existing deck the next time the builder is run.

Exporting Images

You can export images by right-clicking them and selecting "Export Image" and choosing either PNG or TDX as the format to export as. Images will be exported as you see them there will be no further processing before export (except to compress when saving to TDX).

The card preview you see in the main window (and view card window) without border will compress to DXT1 format when saving to TDX, all other images will compress to DXT5 when saving to TDX.

If you choose to "Export Card Previews" it will ask you to specify the save location and filename for just the English preview image, it will take your response and use that to determine where to save and how to name the other localizations of the preview image.

Id Schemes

Id Schemes are something I came up with to ease making sure all deck, land pool, and unlock ids are unique and don't conflict with other decks. There are three possible scheme types that can be used. You can see previews of the ids that will be generated by a scheme in the options window.

Id Blocks

Id Blocks are a new feature to Id Schemes that should make changing the Id Scheme settings easier. If you elect to use Id Blocks (true by default) then you can select all four of the Change Ids (Deck, Land Pool, Regular, and Promo Unlocks) by changing just the Id Block number. This should also help users to choose unique blocks more quickly. Before you choose a block you should check out the Prefix/Id Registry to make sure you choose one that will be unique to you.

Additive Schemes

These schemes simply add a number to each of the ids to get the next successive id. A simple example would be that your for your deck you choose id 1. The land pool may then have id 2, regular unlocks id 3, and promo unlocks could get id 4. This is a very simplistic scheme, easy to understand and use.

Prefix Schemes

These are my preferred schemes. A prefix scheme puts a pre-specified prefix in front of the various ids allowing for very unique ids in a single large numeric block. Both myself and thefiremind use variations on this scheme type as do several other modders.

The default scheme uses a modification on the scheme used by thefiremind except I place it in the 1000 block instead of his 1999 block. If you use this scheme type I highly recommend changing it to put it into a block unique to you.

Using the default scheme (prefix type) if you give a deck id 0 when exported it will export with an id of 100001, the land pool will be 1000101, any regular unlocks will have the id 1000201 and promo unlocks will get the id 1000301.

Suffix Schemes

These are similar to Prefix schemes except they append the block to the end of the number instead of to the beginning. Though it should be noted that leading zeros are dropped (because that is how the game reads them anyway) so if have a deck id of 0 and a deck suffix of 1000 when you export you will get an id of 1000, not 01000.

Building Images

When you start working with images either for the deck box or for the AI Personality you will have three options. You can use the current image if any. Load an image (you will get an open dialog window when you select this option) which will allow you to select an image you have already crafted for this purpose. Or you can build an image which will give you an open dialog much like loading an image, but it will mask and overlay the image as necessary to create a composited image suitable for use.

When you are building images you can adjust the image being masked by changing the location and size numbers near the image or you can pan the image by left-clicking and drag the mouse on the image. You can also zoom in and out by rotating the mouse wheel.

Card, Deck, and Unlock Views

On each of the Card, Deck, and Unlock views you can right click to get a context menu that will allow you to hide (or unhide) the columns that are visible for that view.

Additionally on any view that has card information a "View Card" option will appear on the context menu which will give you a view of the current localized card image and a complete listing of that card's XML. You can also query which decks if any are using a specific card by using the "Decks Used In" option. The program checks cards used in decks by filename so if a card is present in more than one wad with the same filename it will locate all decks that use that card's filename and not just those decks related to that wad.

Deck Statistics

The deck statistics you choose in the deck information screen (Size, Speed, Flexibility, and Synergy) are for choosing what displays for those lines in the deck manager in game. While the game uses a 5 star system the decks themselves use numbers from 0 to 10 and "?". The question mark is allowed internally by the program, but is not user selectable mainly because it shows up as 5 stars in game just like the numeric value 10. Whole stars are given for each even number so a value of 2 is 1 star, 4 is 2 stars, 6 is 3 stars, etc.... If you select an odd number the game will display the appropriate number of whole stars, plus a half star. So if you select 5 (the default for all statistics) it will show as 2 and a half stars in game.

Land Config

Land configurations are for the fine tuning of the land distributions for decks. If everything is left at defaults (Ignore CMC Over at -1, everything else at 0) then the LandConfig tag will not be generated and the game will use its standard method of determining what basic land to put in the deck.

The Minimum Land options are for determining the minimum number of that specific land to add to the deck if it will remain at 60 cards or less. If you have a deck with 50 non-land cards and you specify 10 forests and 12 swamps then you will not get that much land in game as those settings would put the deck over 60 cards. The game will only add basic lands up to 60 cards, so these options are more for fine-tuning ratios that the game will assign rather than the rule the game will follow.

If you want to specify the exact land config the game will use (again following the 60 card rule regarding lands explained in the paragraph above) then you can set Ignore CMC Over to 0 and Number of Spells that Count as Land to 0 (this is important as the game will subtract this number from your min land config) and set the minimum land options to the number of lands you want. Remember the game will only add basic lands until you reach a total of 60 cards in the deck if it reaches 60 cards before it has finished adding the land from your land config then it will simply stop adding basic lands short of your config.

Bias & Promo Statuses

Bias is related to the shuffling of the AI's deck and the user's selected difficulty level. If a card is given a bias of greater than 1 then it will be shuffled towards the bottom of the deck when the AI is using the deck if the selected difficulty level is LESS than the set bias level. A Bias of 2 will shuffle that card towards the bottom of the deck if the difficulty level is set to "Mage". A Bias of 3 will shuffle the card towards the bottom of the deck if the difficulty level is set to either "Mage" or "Archmage". A difficulty of "Planeswalker" will ignore any biased shuffling.

Promo status can be set on a card by card basis and controls whether that individual card is shown as a foil card with the "Promotion" set mark.

Bias and Promo statuses can be set at the same time and appear to work as expected in game.

Regular Unlocks

These are the normal type of unlocks that you see in game. If you do not have the promo codes entered these are the only unlocks that you will see in game. This operates in an easier fashion than it did in DotP 2013 because the AppId linking information is now stored in the deck itself and the deck builder automatically puts in the AppId for the base game to have the unlocks, unlocked by default.

Promo Unlocks

These unlocks can be unlocked in game by typing in the 10 promo unlock codes which will unlock a single card from the promo unlocks of every deck that is installed. There is a limit of 10 cards that can be unlocked this way though, so once the promo unlocks have 10 cards in them you will be unable to add any more to that type of unlock. The deck builder will automatically switch to putting the added cards into the regular unlocks.

Advanced Filtering

Advanced filtering will allow you to choose which filters specifically you want to use for filtering the cards in the master list. The filters are shown using a heirarchical tree view with the root item always being a Filter Set. All other filters can be added, replaced, and moved (via drag-and-drop) to get the exact combination of filters that you want.

Of the filters available for you to choose from and use there are Filter Sets, Boolean Filters, Integer Filters, String Filters, Enum Filters, and Power & Toughness Filters. All filters have a Next Filter comparison option that is uses Boolean Logic (And/Or). If you choose "And" then both filters must be true for the card to be allowed. With "Or" if either one of the two filters is true then the card will be allowed.

Filters are processed sequentially with no short-circuiting of the logic. This means that it will process the first filter then "And" or "Or" the result with the next filter in line until it reaches the final filter. This also means that if you have several filters "And"ed together that even if the first filter returns false it will still test all the other filters.

Note: Some of the advanced filters are somewhat slow and may take several seconds after being applied before the list will update. This is due to several factors including that many of the Advanced Filters need to use .Net Reflection to operate, they may work on fields that have a lot of information like Card XML, and/or they need to do special processing on a field's data before it do the necessary checks like Sub-Types.

Filter Sets

These provide no filtering by themselves, but can be used to group other filters for more fine-tuning. Sets are great for grouping of conditions such as you might want to look for Creatures with the word "Destroy" in their abilities or you want to look for creatures with power greater than 2 and less than 7. To do that you would group the two power filters so that they will be considered together and then they can be compared with the String filter as a group instead of individually. There is no limit to the number of nested sets you can have.

Boolean Filters

These filter on a given boolean field of the Card being either true or false. Instead of choosing True or False you actually choose the field to check and "Card is/has/can" or "Card is not/does not have/can't". So for example you could filter out tokens by saying "Card is not" "Token".

Integer Filters

These filters function like standard math inequalities. You choose the field to compare on, the inequality operation to use (== [equals], >, >= <, <=, != [not equal]), and you choose the value to compare it to. So for example you could look for cards with a Converted Mana Cost < 4 to find cards with a casting cost 3 or less.

String Filters

These filters use the standard string comparisons (Contains, Does Not Contain, Equal, and Not Equal) and function like a simple search. Though Advanced Filtering does allow you to filter on fields that the regular filtering does not allow (List of Registered Tokens, Artist, Expansion, Card XML).

Enum Filters

These filters work on fields that use Enumerations instead of strings or integers and will only allow you to filter on members of that enumeration. For example you could select to filter on "Colour", "Is" "Multi-Coloured" to find all the multi-coloured cards, but you can't do "Colour", "Is", "Purple" because "Purple" is not a member of that enum.

Power/Toughness Filters

You're probably wondering why these are separate from Integer Filters, the reason is Power and Toughness have a valid value that is not an Integer and treating it as an integer would simply be wrong. That value is "*" which in the world of Magic: the Gathering means that this value is variable and depends on what is written in the card's abilities. It could be something like Master of Etherium where its power and toughness are each equal to the number of artifacts you control or it could be like Maro where the power and toughness are each the number of cards in your hand. The point is "*" is not a fixed number and cannot be treated as such, but otherwise these filters work just like the Integer Filters.

Tools

Custom Data Folder & Creating a Core Wad

The "Setup Custom Data Folder" option under the tools menu will create a placeholder wad directory inside the game directory. The created directory has all the standard directory structure for a standard "Core" mod fleshed out with an appropriate header file so that the game will recognize the contents of the directory once the user starts adding data. This allows the user to very easily manage both custom cards in the builder and test them in game without having to build a core wad each time to make sure the cards are updated. The directory created is always "DATA_DLC_DECK_BUILDER_CUSTOM", the user has no control over that.

Creating a core wad from the custom data stored in the custom data folder can be done simply by using the "Create Core Wad from Custom Data" option in the tools menu. This takes all the data that the user has put into the custom data folder (excluding empty directories) and writes it to a compressed wad that the user chooses. So if a user doesn't want to use Gibbed Tools to make a core wad they can do so simply by using this option in the Deck Builder (does basically the same thing Gibbed Tools would do). The advantage this has over Gibbed Tools is that it does not need an "unpacked" directory and it will re-create the directory structure and header based on the filename being saved out rather than requiring the user to set them. For example the custom directory is DATA_DLC_DECK_BUILDER_CUSTOM and the user decides to save it out as Data_DLC_1000_Core.wad, the builder will take all the files (except HEADER.XML) from the custom directory and create a new wad with the root directory being DATA_DLC_1000_CORE and the header in the wad will be re-created to reflect this.

NOTE: The deck builder still does not support building cards or any other files not related to building a deck. Other than a header XML the builder will not put anything in the custom data folder. This is NOT a substitute for manually building/placing cards and their images.

Notes

  • DotP 2014 has definitions for several deck strings including Deck tag (actual deck name), Deckname, Promos, Unlocks, and Description. Though I've only been able to find where the Deck tag is used in-game, I can't see anywhere in-game where the others are used so I have omitted them from the builder at this time. If someone can point out where they are used (maybe I'm just blind) then I'll be happy to add those fields into the builder.

Planned Enhancements

None at this time.

Features Considered

None at this time.

Known Issues

  • Due to font the type line on the cards may not be completely visible in some languages for some cards.
  • For cards with a lot of text the program may not have enough room to draw on all the text. As such card with a lot of text may have it cut off at the bottom of the preview image. (This is most prevalent when looking at some of the planes.)
  • Special code has not been added for the display of Planes, Schemes, Phenomenon, or Planeswalkers so if any are added/present they will probably not display correctly. The game does not currently have any of these cards so I don't really expect a problem here.
  • As of initial release English is the only complete localization all other languages are only partially complete.

Credits & Thanks

  • Tim Van Wassenhove - SortableBindingList & PropertyComparer
  • Rick - Gibbed Tools & Source
  • thefiremind - Provided Italian localization.
  • Scion of Darkness - Provided shading layer and planeswalker symbol for the Deck Box template. Deck Box PSD
  • Microsoft - Visual Studio 2010
  • Wizards of the Coast - Magic: The Gathering & Duels of the Planeswalkers
  • Huggybaby - Slightly Magic forums & for being a great admin/moderator.
  • kevlahnota, thefiremind, and all other modders - For providing lots of mods and overcoming many technical difficulties regarding modding the DotP games.
  • Mythial - Beta testing for this program.
  • BloodReyvyn & drleg3nd - Reporting bugs they found.
  • Everyone else on the forums - For keeping the community alive and fun.

Change History

  • v1.0.0.0 - Initial release for DotP 2014 version. Changes from 2013 version:
    • Deck updated with new attributes.
    • AiPersonality updated with new tags.
    • AI Personality editing moved to new window (accessible from the Deck Information window).
    • ImageBuilder updated to allow adding an Alpha layer which will replace the built image's alpha layer (allows for smoother edges and required for the new Lobby images [Backplate]).
    • Changed method of loading TDX Images such that if there are multiple images with the same name in different directories the builder can now differentiate between them.
    • Removed all code for AppId Linking as DotP 2014 doesn't use it.
    • Removed Card Preview Image select from Deck Information as DotP 2014 does not use card preview images. Card Previews can still be generated from the main card list using the context menu.
    • Automatic generating of random land pool decks. The builder will create a land pool based on the colour(s) of the deck by picking 4 random land cards from the basic land pool for that colour and putting it into the land pool deck. In the case of a colourless deck it will generate a full random land pool deck with lands from all five colours.
    • Added settings for Basic Land Pools (no editing of land pool decks yet though). The new settings allow for the pool of basic lands from which the deck builder will automatically build land pool decks with to be changed.
    • Added additional location to search for images to support the new location for mana images.
    • Added IdBlock to the IdScheme settings, this allows for choosing IdScheme settings faster, and if it is set to use the IdBlock it will use this for determining the filename for the Core file when the user chooses to create one. Core will still use the DATA_DLC_ prefix as the default for creating a core wad.
    • Added settings for Default Unlock & Foil Ids for Steam, iOs, & Android.
    • Added support for the Miracle card frames.
    • Changed LanguageStrings to add a prefix to the language code for loading purposes. This allows for me to have different file names for different applications so I can host the language files directly from my Wiki.
    • Image templates updated to build images that match with the official Deck and Personality images. (They can still be changed as described in the FAQ above.)
    • Updated export to remove the Card Preview images and add the new AI Personality Lobby image.
    • Updated LoadMusic to pull from the new music directory and check them as MP3s instead of OGGs.
    • Changes to what files/directories are read in when loading data from the game directory.
    • Changed what name is given to Decks when exported. Now uses the DATA_DECKS_ prefix as DECK_ is no longer supported in DotP 2014.
    • Changed project name, and Guids so that it will truly be considered a separate project, in a separate assembly so that .Net won't simply consider it a different revision of the same program.
    • If using the IdBlock in the IdScheme settings then AI Personalities will now include the Block Id to make things even more unique (less chance of conflicts).

Contact Information

If you want to contact me, you must be able to use English (bad or broken English is okay if I can figure out what you are trying to say). If you try to contact me with any other language I will not respond or even try to figure out what you are saying.

For the most part I prefer to be contacted on the Slightly Magic forums where my handle is RiiakShiNal. I will however answer bug reports and program comments at this e-mail address (do NOT contact me for card or deck requests):

Riiak (at) DragonAnime (dot) org

Note: If you contact me via e-mail you MUST include a descriptive subject or I will immediately delete your e-mail. Preferrably you should prefix the subject with "MtG:", "DotP:", or "Deck Builder:".