It is currently 27 Apr 2024, 08:06
   
Text Size

Community Wad 2015 - Development

Moderator: CCGHQ Admins

Community Wad 2015 - Development

Postby Xander9009 » 10 Jun 2015, 21:44

First up, if anyone thinks we need a better name for this, then give me some ideas and we can vote on it. Community Wad was just the name I picked when I first started with the original, and it just sort of never got updated to anything better.

Anyway, this thread will eventually be put to rest. It's just a central place to talk about how we want this set up, what we think will work, what we think won't, things like that. Once we have a working version, I'll make some new threads. So far, I've got these in mine: Main, Bugs, Requests, Modders' Discussion. I really doubt it'll stay that organized, but at least the framework for organization will exist.

Currently, I haven't modded 2015 myself, so this is just what I've read in the Information Pending thread. I'll get around to acquainting myself with it in the near future.

Current Modability:
To the best of my knowledge, we can do the following:
  • Create uncompressed zed files
  • Create wad files
  • Replace cards
  • Add a limited number of cards using wad files
  • Add functions and other files using wad files
  • Add art files for use in duels using wad files
  • Add art for use in duels and the deck builder using zed files
  • Unlock cards by modifying the profile

We cannot do the following things which would be very useful:
  • Add/modify a deck by directly modifying the profile

Some of the modding of the game, should the above not be figured out, will involved replacing cards. If this is done, then the AI may end up using the replaced cards as well, ruining their decks (and most likely any of yours that also use the card).

One workaround for this lies in the possibility that the game can handle an unlimited number of cards in a duel and that we can figure out how to add and modify decks by directly editing the profile. Doing so would allow us to use RiiakShiNal's 2014 Deck Builder to build a deck from all of the available cards (after making a folder it can read with all of the game's core cards), and then using a separate program to add that deck to your profile.

Whether or not that's possible, the Community Wad will probably remain more or less the same. It will consist of a Google Drive folder which all modders can access. That folder will be packed daily into a wad, just like the 2014 version. That wad should be usable in-game. I'll write a tool to isolate and convert any cards we can (anything that only uses known functions, and doesn't use deprecated constants or anything).

TFM made a thread for discussing the known differences between 2014 and 2015 (while I was making this thread). We can talk about the differences in card structure and file structure here, though. That thread seems more focused focused on what a card can and can't do, rather than simply how they're different.

Things that need addressed:
  • Adding decks directly to the profile (this would need to be spirolone or thefiremind or anyone who isn't me and understands that; I'd rather focus on the other things than deciphering the profile)
  • Converting the art to zed files (should be pretty simple, I can do this)
  • Converting all of the cards that can be (I can also do this)
  • Setting up the Google Drive folder and granting editing privileges (obviously that's definitely up to me)
  • Deciding how we want to mod*
*Modding can currently only be done in two known ways: either by making a tool to let the player choose which cards to have available and the build decks from those cards in-game, or by making a tool to attempt to automatically detect which cards are used in decks and add/replace cards depending on the current configuration of decks. But this still requires knowing how to at least read which card a given section of the profile refers to.

In other news, I wonder if the profile is the reason for the card limit. It could also simply be that there's an indexing loop somewhere in the game's code which caps at 1024 and could be removed relatively simply. I don't know the odds of removing or working around that limit, but it will probably decide how we mod, so we should definitely get some tests done on that.

EDIT:
Also, something that was never really addressed in the CW, functions and constants. What I did was each function file contains an organized listing of all constants it uses, all of the functions, what they do, inputs, and outputs. Each constant is also listed in a separate file specifically for looking them up. That file does not declare the constants (they're commented out) but shows the number (to avoid overlap) and which files declare/use those constants (in case they need changed). This has proven very effective at preventing overlap. The different kinds of data chests can share constants, so the constants are separated based on what kind of chest they affect: PlayerDataChest, DuelDataChest, RSN_ObjectDC, RSN_Characteristics. None of these will overlap or interfere with one another, so working with constants to avoid overlapping within them, as well, is pretty simple.

I realize we already mostly do this on our own. I just wanted to discuss it since it's not something which has ever been addressed as a group.

Potential best practices:
  • Never use a number directly in a card which affects other cards. Always reserve and use a constant.
  • Never declare a constant/use a number in a function below 100 to affect a card.
  • Never use a number above 99 directly in a card.
  • Never use an unbounded variable in a function used in a card's shared data. (Don't do this: "RSN_GetObjectDC(Object()):Make_Chest(Object():GetRef())". Instead, use a constant, and put everything inside that constant's chest.)
This would prevent any possible interference between two unrelated things as far as constants go. Note that if everyone is using prefixes, then the first two above happen automatically. Most of the numbers used in cards that could affect or be affected by outside functions are 0-10.

Also, function names. Many functions are widely useful, but no one knows about them. Many are confusing and hard to find. One thing I've done with the functions I've written in the CW is to give the function files simple names, and always prefix the functions with the file name. All of the morph functions start with CW_Morph_... This way, when it's seen in a card's code, there is no question about its origin. Which file to look in to see exactly what the function does is obvious. It keeps everything clean and understandable, even with many modders.

Working separately, with everyone making their own mods, prefixing functions with initials made a lot of sense. Do we still want to do that? I personally think it's no longer necessary. If we follow the naming above (which is more widely useful), then avoiding conflicts is a natural side effect.

I'm not trying to dictate anything. I'm just giving a starting point for the discussion.
_______________________________
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: Community Wad 2015 - Development

Postby GrovyleXShinyCelebi » 11 Jun 2015, 14:55

I disagree with doing things that may potentially replace AI cards, since that's what we'll primarily be playing with, but hopefully that shouldn't be an issue. The deckbuilder's cards are determined by the files in the CardPool directory, while AI decks including archetypes seem to be in the Deck directory, though I wasn't here alot for early modding efforts with 2015 and don't know if there will be an effect. As long as we only change cards with ids 383 - 1024 we should be fine.

I approve of following naming conventions over prefixing functions and cards with initials. It's much more simpler, both to make and to find what you want.
User avatar
GrovyleXShinyCelebi
 
Posts: 294
Joined: 12 Jun 2013, 18:23
Has thanked: 14 times
Been thanked: 37 times

Re: Community Wad 2015 - Development

Postby spirolone » 22 Jun 2015, 20:48

Xander9009 wrote:We cannot do the following things which would be very useful:
  • Add/modify a deck by directly modifying the profile
...
Things that need addressed:
  • Adding decks directly to the profile (this would need to be spirolone or thefiremind or anyone who isn't me and understands that; I'd rather focus on the other things than deciphering the profile)
...
In other news, I wonder if the profile is the reason for the card limit. It could also simply be that there's an indexing loop somewhere in the game's code which caps at 1024 and could be removed relatively simply. I don't know the odds of removing or working around that limit, but it will probably decide how we mod, so we should definitely get some tests done on that.
I posted a Java class in thread "Information pending..." that contains methods to read and write decks in profile file. :mrgreen:
About cards limit, I have to say that in profile there are 1024 half-byte to specify numbers of available cards for a specific id, but there is a 0x200 that denotes length of that section; I tried to change it but with no success. Then, in decks section, any card is coded in 2 bytes and last 3 bits indicate number of cards present: there are, then, only 13 bits remaining (max 8192 ids).
spirolone
Programmer
 
Posts: 190
Joined: 31 Aug 2014, 23:14
Has thanked: 7 times
Been thanked: 107 times

Re: Community Wad 2015 - Development

Postby Xander9009 » 23 Jun 2015, 03:06

spirolone wrote:
Xander9009 wrote:We cannot do the following things which would be very useful:
  • Add/modify a deck by directly modifying the profile
...
Things that need addressed:
  • Adding decks directly to the profile (this would need to be spirolone or thefiremind or anyone who isn't me and understands that; I'd rather focus on the other things than deciphering the profile)
...
In other news, I wonder if the profile is the reason for the card limit. It could also simply be that there's an indexing loop somewhere in the game's code which caps at 1024 and could be removed relatively simply. I don't know the odds of removing or working around that limit, but it will probably decide how we mod, so we should definitely get some tests done on that.
I posted a Java class in thread "Information pending..." that contains methods to read and write decks in profile file. :mrgreen:
About cards limit, I have to say that in profile there are 1024 half-byte to specify numbers of available cards for a specific id, but there is a 0x200 that denotes length of that section; I tried to change it but with no success. Then, in decks section, any card is coded in 2 bytes and last 3 bits indicate number of cards present: there are, then, only 13 bits remaining (max 8192 ids).
That's awesome. I did see that, actually. Unfortunately, I know absolutely nothing about java. I downloaded it earlier and ran it (after renaming my profile to 0 since it was named 1), and I got three files out of it, but I have no idea what to do with those files.

I suspect they're not modified from how they appear in the profile, correct? They're just the relevant sections separated out?
_______________________________
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: Community Wad 2015 - Development

Postby spirolone » 23 Jun 2015, 07:43

Xander9009 wrote:That's awesome. I did see that, actually. Unfortunately, I know absolutely nothing about java. I downloaded it earlier and ran it (after renaming my profile to 0 since it was named 1), and I got three files out of it, but I have no idea what to do with those files.

I suspect they're not modified from how they appear in the profile, correct? They're just the relevant sections separated out?
That files are for testing pourpose: 0.profile.bin (you can set a different profile file name as argoment) is "decoded" content of profile that is stored in class; Cards.bin contains in any byte a number of unlocked cards (in first byte, as example, you may find a "4" that means you unlocked 4 cards with ID 0, and so on...); Deck_0.bin is only section regarding first deck stored, but program prints content of deck. I'm sorry, maybe I could let program create a text file with cards in that deck, cause likely you don't see output if you run program from jar file... :oops:
But, as I said, this is for testing pourpose; I can modify it to write what we want. I think a nice target is to use Riiak's DotP 2014 Deck Builder: is it coded in C#? My class needs ID of any card in deck and number of it present. I can try to convert names of cards present in xml output of deck builder in their IDs using a file with every cardpools content stored, but maybe it should be more easy to work on deck builder...
spirolone
Programmer
 
Posts: 190
Joined: 31 Aug 2014, 23:14
Has thanked: 7 times
Been thanked: 107 times

Re: Community Wad 2015 - Development

Postby RiiakShiNal » 23 Jun 2015, 10:47

spirolone wrote:But, as I said, this is for testing pourpose; I can modify it to write what we want. I think a nice target is to use Riiak's DotP 2014 Deck Builder: is it coded in C#? My class needs ID of any card in deck and number of it present. I can try to convert names of cards present in xml output of deck builder in their IDs using a file with every cardpools content stored, but maybe it should be more easy to work on deck builder...
Yes, the Deck Builder is coded in C#. Depending on exactly how things are done it could be easier to modify the Deck Builder.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Community Wad 2015 - Development

Postby spirolone » 23 Jun 2015, 15:11

RiiakShiNal wrote:Yes, the Deck Builder is coded in C#. Depending on exactly how things are done it could be easier to modify the Deck Builder.
I don't want to be "invadent", but if I, or maybe thefiremind, convert this class in C#, might you change your builder to use it? [-o<
spirolone
Programmer
 
Posts: 190
Joined: 31 Aug 2014, 23:14
Has thanked: 7 times
Been thanked: 107 times

Re: Community Wad 2015 - Development

Postby Xander9009 » 23 Jun 2015, 15:20

Ok. I understand what's going on now. I noticed I could supply the name of the profile, but it was faster to rename it (3 seconds or so) than to open a command prompt and type in it.

X.profile.bin is the decoded profile, meaning no more xors need to be done or anything like that. A byte is a byte.
Cards.bin is a list of the number of unlocked cards where each byte's position is the ID of the card and the byte's value is the number unlocked. -- Nevermind. I see fromt he other thread this was wrong.
Deck_0.bin is the first deck, and each byte's value refers to a card ID.

Either way, since the goal is to make a deck with the deck builder and have the deck appear in-game, I agree that the best way to go about this is to modify the Deck Builder.

You said that 8192 should be the limit for this method? I say we test that out. There are currently 8981 cards in the Community Wad. However, many (484) of those are duplicates (manual mana vs auto-tap mana, a few that only differ in art, and two of every planeswalker due to the improved art that I never got working). Many more are tokens. We could remove those tokens and only include the ones actually needed. Moreover, many (455) are extremely simple, with no abilities or anything special. They would only be usable in a very specific kind of deck (usually only tribal/bears decks, things like that) so they could be removed unless someone wants them. That's 939 that could be removed, dropping the number to 8042. It could probably be reduced further without losing any really interesting cards. I'm not sure if I'd want to do that, though. For instance, Bay Falcon are exactly the same except in name. But for anyone making a blue vigilance deck, they may easily want 8 copies of a cheap flying vigilance.
_______________________________
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: Community Wad 2015 - Development

Postby spirolone » 23 Jun 2015, 17:32

Xander9009 wrote:Cards.bin is a list of the number of unlocked cards where each byte's position is the ID of the card and the byte's value is the number unlocked. -- Nevermind. I see fromt he other thread this was wrong.
You were right, instead! In the other thread we are talking about "cards" array in "Deck" class.
Xander9009 wrote:Deck_0.bin is the first deck, and each byte's value refers to a card ID.
Yes, it is first deck, but, no, it's not correct that each byte's value should be a card ID. However, there is a mathod (readDeck) that extract IDs of any card in a specific deck.
Xander9009 wrote:You said that 8192 should be the limit for this method? I say we test that out.
Actually, I haven't been able to use ID over 1024, like anyone. But if we'll go over that limit we'll find another limit at 8192 cause number of bits available for a single card in a deck... :(
spirolone
Programmer
 
Posts: 190
Joined: 31 Aug 2014, 23:14
Has thanked: 7 times
Been thanked: 107 times

Re: Community Wad 2015 - Development

Postby RiiakShiNal » 24 Jun 2015, 11:18

spirolone wrote:
RiiakShiNal wrote:Yes, the Deck Builder is coded in C#. Depending on exactly how things are done it could be easier to modify the Deck Builder.
I don't want to be "invadent", but if I, or maybe thefiremind, convert this class in C#, might you change your builder to use it? [-o<
I could, though it would take a long time considering how much time I have to devote to my side projects at the moment (work is consuming most of my time). It may be faster for you and/or thefiremind to simply take the source code for the Deck Builder and make the modifications yourselves. I made sure to post source code so that if I ever disappeared or became unable to work on it that someone else could pick it up and run with it.

Though if you prefer to have me do the modifications I will work on it, but don't expect anything quickly.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Community Wad 2015 - Development

Postby Tejahn » 28 Jun 2015, 02:20

Xander9009 wrote:
Current Modability:
To the best of my knowledge, we can do the following:
  • Create uncompressed zed files
  • Create wad files
  • Replace cards
  • Add a limited number of cards using wad files
  • Add functions and other files using wad files
  • Add art files for use in duels using wad files
  • Add art for use in duels and the deck builder using zed files
  • Unlock cards by modifying the profile

We cannot do the following things which would be very useful:
  • Add/modify a deck by directly modifying the profile

Some of the modding of the game, should the above not be figured out, will involved replacing cards. If this is done, then the AI may end up using the replaced cards as well, ruining their decks (and most likely any of yours that also use the card).

One workaround for this lies in the possibility that the game can handle an unlimited number of cards in a duel and that we can figure out how to add and modify decks by directly editing the profile. Doing so would allow us to use RiiakShiNal's 2014 Deck Builder to build a deck from all of the available cards (after making a folder it can read with all of the game's core cards), and then using a separate program to add that deck to your profile.
Image

Image

Now that I'll have more free time over the next couple of weeks I've begun testing what's currently possible to mod using the means we have available. There are a few observations I would like to contribute. First, let me say that keeping things organized is an excellent idea. Especially if it helps with the automation process of the CW. Below are some things I noticed related to what Xander9009 mentioned in the opening post.

To start, let me say that I've never had to replace an existing card since I starting modding DOTP 2015. I added over 100 of the Fate Reforged cards with updated information so the A.I. will know how to use them. All I did to make the cards appear in game was keep the sequence of numbers going in the ID column. See the screenshots to understand what I mean. Follow the orange highlight. The yellow highlight is from the program itself. It indicates which column I'm working on. Using Avalanche Tusker I placed the number '9999' at the bottom of the CARD POOL file to see what would happen and the game surely crashed on start up. When I removed that number and kept the sequence by adding '526' instead the game permitted all my changes and loaded just fine. If there is a 'Card Limit' I've not reached it yet. I've added the Fate Reforged cards in addition to the 60 or more from other sets. After I finish adding all the cards from Fate Reforged my plan is to add all the cards from Khans of Tarkir and offer to help finish Dragons of Tarkir and establish this plane as our first complete block for 2015. Not to mention the Planeswalker Pool which is current up to Dragons of Tarkir.

Also, I don't use WADs. I pack everything into a ZED and it's good to go. However, the file size is getting a bit large using this method but since this is just for testing purposes I don't mind. Lastly, I totally disagree with card replacement of any kind. Not only because it will obviously ruin the A.I decks but because my test seem to imply there is no need to. As for everything else you stated, I'm all for getting organized.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Community Wad 2015 - Development

Postby Xander9009 » 28 Jun 2015, 03:08

The card limit was suggested to be 1024. You won't have reached that, yet. The problem is that the CW has over 9000 cards. Picking less than 1/9th of the cards we have is quite restrictive. That's why I suggested replacing cards. However, I also don't like the idea. I'd prefer to only change cards that only affect the player. The problem here is in attempting to make it work for multiple players. You'll only be able to have a few decks at a time, especially if you want to play with more than 2 players. And you'll have to decide who to play against before-hand.

That's not too bad, though. It just kind of grates me the wrong way when 2015 was built with custom decks in mind. That limit is, in my opinion, the single greatest restriction. It's the reason I'm still focused almost exclusively on 2014. Until we can have an arbitrarily large number of cards, as TFM put it, I'm not particularly motivated to buy it, play it, or mod it.

Though, if spirolone and TFM get the deck builder to output a something to the profile in addition to an XML for future reference, then I'll get something set up on the CW's google drive folders. At least we've already got the art. Has anyone who's modded 2015 tested the CW art? I'm curious to know if it's working as-is in its wad form. I'm hoping so. I don't want to have to clog up my Google Drive with another 2GB of art with only minor changes. If necessary, I can, I'd just prefer not to.

As for Dragons of Tarkir, there are currently only five cards not currently complete.
Keeper of the Lens
Obscuring Æther
Qarsi Deceiver
Revealing Wind
Shorecrasher Elemental
The rest are done (though Whisperwood Elemental is still bugged pretty bad).

There are four others, but only because they're not possible in 2014.
Dragon Hunter - Probably still not possible.
Icefall Regent - Only possible if every card runs an ability cost checking function which accounts for it.
Lurking Arynx - This one is possible in 2015, right?
Qal Sisma Behemoth - This one might be possible. Not actually sure.
_______________________________
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: Community Wad 2015 - Development

Postby Tejahn » 28 Jun 2015, 04:09

Xander9009 wrote:Though, if spirolone and TFM get the deck builder to output a something to the profile in addition to an XML for future reference, then I'll get something set up on the CW's google drive folders. At least we've already got the art. Has anyone who's modded 2015 tested the CW art? I'm curious to know if it's working as-is in its wad form. I'm hoping so. I don't want to have to clog up my Google Drive with another 2GB of art with only minor changes. If necessary, I can, I'd just prefer not to.
That's grim news regarding the card limit. But I'll continue conducting test in the meantime pushing for that limit. And to answer your question about the CW, everything works fine just copying TDX and XML files over. If you maximize the screenshots of the XLMs I posted earlier you'll see that the cards and art from the CW are being used as well. I only placed the XMLs in the CARDS folder and the TDX files in the ILLUSTRATIONS folder. However, the cards won't show up in game until you add their XML name to a CARD POLL in sequential order. Again, look to my previous post to understand what I mean. Going from 1 - Infinity I gave Echoes_Of_The_Kin_Tree_CW_394562 the ID number 518 while the card directly after it, SUNSCORCH_REGENT_CW_394719 has 519 as it's ID number. As long as the name of the XML is in the CARD POOL and the numbers are in correct order everything works fine if the TDX and XMLs are in the correct folders. However, there were a few updates to better guide the A.I. on how to use the various cards. So, to finish too long a statement the answer is YES, EVERYTHING WORKS.

Xander9009 wrote:As for Dragons of Tarkir, there are currently only five cards not currently complete.
Keeper of the Lens
Obscuring Æther
Qarsi Deceiver
Revealing Wind
Shorecrasher Elemental
The rest are done (though Whisperwood Elemental is still bugged pretty bad).

There are four others, but only because they're not possible in 2014.
Dragon Hunter - Probably still not possible.
Icefall Regent - Only possible if every card runs an ability cost checking function which accounts for it.
Lurking Arynx - This one is possible in 2015, right?
Qal Sisma Behemoth - This one might be possible. Not actually sure.
That's great news concerning DTK. So, the Khans of Tarkir block is somewhat complete. And I say somewhat because I had the morph code seemingly working but now it's not functioning. Did you ever think of a less complicated way to make them work?
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Community Wad 2015 - Development

Postby Xander9009 » 28 Jun 2015, 04:25

What I was hoping for with the art is that it works in the wads that are already available without moving the TDX files to another file or folder. If not, then either loose files will need to be used or the CW packing tool will need to pack into both wad and zed files, taking up a lot more space.

I was wondering how exactly to get it working (I haven't even tried, yet), so that's rather helpful.

For morph, I converted the morph code into functions. All morph creatures from DTK use the function method. It allows the changing of various pieces of code to affect ALL morph creatures, which is nice. But it's apparently not working now? I had someone mention it wasn't, and you also implied that might be the case. I'll be looking into it soon-ish. I've just been busy today getting the mana management function working properly (which I finally just finished).
_______________________________
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: Community Wad 2015 - Development

Postby Tejahn » 28 Jun 2015, 04:54

I wasn't clear. It works using WADs also. No need to move anything. I placed the WAD in the directory and it worked if I remember correctly. I just prefer to keep everything in one file while testing. And I downloaded the latest CW yesterday so I'll go ahead and get a look at the morph code shortly.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Next

Return to 2015

Who is online

Users browsing this forum: No registered users and 4 guests


Who is online

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

Login Form