ceryliae / DnDAppFiles

Files for the Fifth Edition apps by Lion's Den
613 stars 550 forks source link

Organize files by source material #242

Open otiose opened 7 years ago

otiose commented 7 years ago

I was thinking that it might be nice to organize files based on what they come from. For example, i like the way the Bestiary is divided between books. Things like Characters and Items, for example are just divided by category (Races & Classes, Magic & Mundane items, etc).

It would be cool if they were divided by source material -- that way, if you just wanted the material from the core rulebooks, you could, without getting all the extra things.

It might be a lot of manual work, I don't know. I don't have all the source materials, so I can't cross-reference things.

NeilMartin commented 7 years ago

I agree with this. I already posted this suggestion in response to issue 219 on June 22. I'll repost here....

I would prefer the directory names to be the source and the file names to be the content. So the users can select which content they want included by selecting the directory names. e.g.

MonsterManual/monsters.xml HoardOfTheDragonQueen/monsters.xml HoardOfTheDragonQueen/items.xml SRD/monsters.xml SRD/items.xml SRD/classes.xml SRD/spells.xml PHB/spells.xml UsersOwnHomeBrew/items.xml UsersOwnHomeBrew/feats.xml MattMercer/items.xml

Then the app could scan the directory names and provide checkboxes for the user to filter. The app would collate/union all of the selected items.xml for the chosen directories.

On 23 November 2016 at 18:00, otiose notifications@github.com wrote:

I was thinking that it might be nice to organize files based on what they come from. For example, i like the way the Bestiary is divided between books. Things like Characters and Items, for example are just divided by category (Races & Classes, Magic & Mundane items, etc).

It would be cool if they were divided by source material -- that way, if you just wanted the material from the core rulebooks, you could, without getting all the extra things.

It might be a lot of manual work, I don't know. I don't have all the source materials, so I can't cross-reference things.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ceryliae/DnDAppFiles/issues/242, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJrgSCia7fixhXx_LNjVDrVqxCEWfjks5rBO-ygaJpZM4K7NdK .

--

neilmartinvanpubs http://www.vanpubs.com

otiose commented 7 years ago

Oh! Sorry, I don't know how I missed that. Maybe it was the "Homebrew" in the title that threw me off.

Yeah, I think something like that would be pretty awesome. Although, it might get a little tricky if you wanted to have an entire complete compendium. For example, in the Backgrounds, other source materials are adding <trait> elements to existing <background> items. Definitely not impossible to solve, but it would be more work than just a directory restructure (and probably involve a bunch of programming)

ceryliae commented 7 years ago

Hi,

I'm not sure why I made the decision to only separate the monsters, and not other content. It might be because at the time there were only multiple books for monsters, not other content - and I just continued the trend. However, it's not possible right now for us to have more than one class file. Subclasses cannot be entered on their own, so if we have a base class from the PHB and then try to import a subclass from another source, the base class would be overwritten.

Along the same lines, I would love to do what Neil suggested. However, I'm not the developer of the Fight Club 5/GM5 app, and he hasn't seemed very keen to work with me when I've proposed other ideas in the past. Since Neil's idea requires the app to change to suite our files, I wouldn't hold your breath on that ever happening.

In certain files I believe that I've commented out sections for different sources, such as the magic items fil. We could separate the content into different files but I'm not sure that's the direction I want to go. More files means more work every time we make a big update. If a big typo fixing update is pushed out for the magic items, and they are spread out over half a dozen files, it's more work for me to move those changes over to Dropbox than if there's just one.

ceryliae commented 7 years ago

Also, since the project has grown quite a bit in scope compared to what it was initially, I've been meaning to go through everything and reorganize it all, create a style guide for the future, and just generally clean things up. Unfortunately I just haven't had the time.

otiose commented 7 years ago

Subclasses cannot be entered on their own, so if we have a base class from the PHB and then try to import a subclass from another source, the base class would be overwritten. ... If a big typo fixing update is pushed out for the magic items, and they are spread out over half a dozen files

I was thinking that the XML files would just be the output of some script, and you'd never actually alter those manually. Instead, you'd have the data that is included in each of the books in a separate file. So, let's say you have the races in the PHB with just the base set, and then in some other expansion, you have just the additions. I'm not 100% sure how it would work yet, but something like

class Background {
    let name: String
    var features: [Feature]
    ...
}

// In the PHB
var criminalBackground = Background(name: "Criminal", features: [Feature(name: "Criminal Contact", text: "...")

// Later on, you add some homebrew features in your own file
criminalBackground.addFeature(Feature(name: "Something Criminal", text: "Aweome texts"))

Instead of actually having code to add things, there could be XML or JSON format to specify what is an addition or amendment, etc.

Granted... this would be a ton of work. I kind of like it though. Are there actual specifications for what certain types are, or is it just some XML that is then parsed to be displayed in an html-like manner?

otiose commented 7 years ago

I've got something in the works. What I'm doing is reading in the existing XML (I found the tutorial in the app about what kind of XML elements it's expecting), and then outputting a compendium. I'm thinking this will work by having each source book add new elements, as well as be able to make extensions or overrides.

To see how it works, the SRD contains most of the information available in the PHB. The material in the PHB is just a small extension to what exists in the SRD. For example, we can just look at Dwarf:

<!-- Base Dwarf Race; Defined in ./SRD/Races.xml -->
<race>
    <name>Dwarf</name>
    <size>M</size>
    <speed>25</speed>
    <ability>Con 2</ability>
    <trait>
        <name>Darkvision</name>
        <text>Accustomed to life underground, you have superior vision in dark and dim conditions. You can see in dim light within 60 feet of you as if it were bright light, and in darkness as if it were dim light. You can't discern color in darkness, only shades of gray.</text>
    </trait>
    <trait>
        <name>Dwarven Resilience</name>
        <text>You have advantage on saving throws against poison, and you have resistance against poison damage.</text>
    </trait>
    <trait>
        <name>Dwarven Combat Training</name>
        <text>You have proficiency with the battleaxe, handaxe, light hammer, and warhammer.</text>
    </trait>
    <trait>
        <name>Tool Proficiency</name>
        <text>You gain proficiency with the artisan's tools of your choice: smith's tools, brewer's supplies, or mason's tools.</text>
    </trait>
    <trait>
        <name>Stonecunning</name>
        <text>Whenever you make an Intelligence (History) check related to the origin of stonework, you are considered proficient in the History skill and add double your proficiency bonus to the check, instead of your normal proficiency bonus.</text>
    </trait>
    <trait>
        <name>Languages</name>
        <text>You can speak, read, and write Common and Dwarvish. Dwarvish is full of hard consonants and guttural sounds, and those characteristics spill over into whatever other language a dwarf might speak.</text>
    </trait>
</race>

<!-- Dwarf Subrace: Mountain Dwarf; Defined in ./PHB/Races.xml -->
<subrace base="Dwarf">
    <name>Dwarf (Mountain)</name>
    <ability>Str 2</ability>
    <trait>
        <name>Dwarven Armor Training</name>
        <text>You have proficiency with light and medium armor.</text>
    </trait>
</subrace>

There are also options to override traits, feats, etc. I haven't yet come up with a good way to order things that get appended, though. For example, each level in each class has certain features -- with what I have written right now, features in new classes/subclasses will be appended to the end of the list for that level. I haven't done everything yet, but I don't think this is actually a big problem, though.

Then when you make your compendium, you will choose the sources you want to export, and it will only read in the materials from the source you want. I don't know if this is a feature anyone else wants, or one I am just doing for myself, but I think I'm going to do it.

ceryliae commented 7 years ago

This sounds very promising. Would we be able to use the same thing for Unearthed Arcana class options? I've been trying to come up with a good solution and I haven't been able to.

otiose commented 7 years ago

I'm not really familiar with what happens in Unearthed Arcana (I only have the 3 core rulebooks...) How do class options work?

I'm pretty sure anything should be possible if I know what I need to do. If it involves creating a subclass (copying the existing one, modifying the name, proficiencies, adding/overriding level features, etc), I should have most of it set up (or planned).

otiose commented 7 years ago

OOOoohh, you mean how like a Barbarian in the SRD only has the Path of the Berserker for it's Primal Path, but in the PHB the Path of the Totem Warrior was added, and probably more in other books?

Yeah those are no problem. They are just features added to the end of the level. So for example, this is how I'm doing it:

<!-- Defined in ./SRD/Classes.xml -->
<class>
    <name>Barbarian</name>
    <!-- ... -->
    <autolevel level="3">
        <feature>
            <name>Primal Path</name>
            <text>At 3rd level, you choose a path that shapes the nature of your rage. Choose the Path of the Berserker or the Path of the Totem Warrior, both detailed at the end of the class description. Your choice grants you features at 3rd level and again at 6th, 10th, and 14th levels.</text>
        </feature>
        <feature optional="YES">
            <name>Primal Path: Path of the Berserker</name>
            <text>For some barbarians, rage is a means to an end -- that end being violence. The Path of the Berserker is a path of untrammeled fury, slick with blood. As you enter the berserker's rage, you thrill in the chaos of battle, heedless of your own health or well-being.</text>
        </feature>
        <feature optional="YES">
            <name>Path of the Berserker: Frenzy</name>
            <text>Starting when you choose this path at 3rd level, you can go into a frenzy when you rage. If you do so, for the duration of your rage you can make a single melee weapon attack as a bonus action on each of your turns after this one. When your rage ends, you suffer one level of exhaustion.</text>
        </feature>
    </autolevel>
    <!-- ... -->
</class>

<!-- Defined in ./PHB/Classes.xml -->
<classExtension base="Barbarian">
    <autolevel level="3">
        <feature optional="YES">
            <name>Primal Path: Path of the Totem Warrior</name>
            <text>The Path of the Totem Warrior is a spiritual journey, as the barbarian accepts a spirit animal as guide, protector, and inspiration. In battle, your totem spirit fills you with supernatural might, adding magical fuel to your barbarian rage.</text>
            <text/>
            <text>Most barbarian tribes consider a totem animal to be kin to a particular clan. In such cases, it is unusual for an individual to have more than one totem animal spirit, though exceptions exist.</text>
        </feature>
        <feature optional="YES">
            <name>Path of the Totem Warrior: Spirit Seeker</name>
            <text>Yours is a path that seeks attunement with the natural world, giving you a kinship with beasts. At 3rd level when you adopt this path, you gain the ability to cast the beast sense and speak with animals spells, but only as rituals, as described in chapter 10.</text>
        </feature>
        <feature optional="YES">
            <name>Path of the Totem Warrior: Totem Spirit</name>
            <text>At 3rd level, when you adopt this path, you choose a totem spirit and gain its feature. You must make or acquire a physical totem object- an amulet or similar adornment — that incorporates fur or feathers, claws, teeth, or bones of the totem animal. At your option, you also gain minor physical attributes that are reminiscent of your totem spirit. For example, if you have a bear totem spirit, you might be unusually hairy and thick-skinned, or if your totem is the eagle, your eyes turn bright yellow.</text>
            <text>Your totem animal might be an animal related to those listed here but more appropriate to your homeland. For example, you could choose a hawk or vulture in place of an eagle.</text>
        </feature>
        <feature optional="YES">
            <name>Totem Spirit (Bear)</name>
            <text>While raging, you have resistance to all damage except psychic damage. The spirit of the bear makes you tough enough to stand up to any punishment.</text>
        </feature>
        <feature optional="YES">
            <name>Totem Spirit (Eagle)</name>
            <text>While you're raging and aren't wearing heavy armor, other creatures have disadvantage on opportunity attack rolls against you, and you can use the Dash action as a bonus action on your turn. The spirit of the eagle makes you into a predator who can weave through the fray with ease.</text>
        </feature>
        <feature optional="YES">
            <name>Totem Spirit (Wolf)</name>
            <text>While you're raging, your friends have advantage on melee attack rolls against any creature within 5 feet of you that is hostile to you. The spirit of the wolf makes you a leader of hunters.</text>
        </feature>
    </autolevel>
    <!-- ... -->
</classExtension>

But this is where the problem of sorting comes up -- Each books additions will be appended to the end of that level's features. It might end up being a problem though, I don't know yet.

otiose commented 7 years ago

I was thinking just now, it could also be possible to make each option be its own Class (basically like a subclass). It's just a matter of whether you want the data to be displayed -- have a ton of different classes to choose from, or have a class with a ton of information inside...

ceryliae commented 7 years ago

I would want it to be combined into one class On Sun, Nov 27, 2016 at 8:18 PM otiose notifications@github.com wrote:

I was thinking just now, it could also be possible to make each option its own Class (basically like a subclass). It's just a matter of whether you want the data to be displayed -- have a ton of different classes to choose from, or have a class with a ton of information inside...

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ceryliae/DnDAppFiles/issues/242#issuecomment-263180328, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzda_C_Y6VZ2Ey85Ywbp-sJ0utdT6hNks5rClYWgaJpZM4K7NdK .

brucep commented 7 years ago

I'm working on a system that builds multiple YAML files into a single XML file. It also converts an existing XML file into a YAML file.

stevenjonescgm commented 7 years ago

276 starts to address splitting the Classes.xml file. I went with files for base-class and sub-class instead of by-publication, and the updated compiler script takes an option to produce a combined class and/or separate class entries for each subclass.

It also takes exclusion flags to skip certain content, which I'm considering extending to apply to Monsters/Bestiary so that the Player Bestiary.xml can be tag-driven instead of duplicating monsters from other Bestiaries (and making the compiler non-deterministic) .

DnDPaladin commented 7 years ago

This is why i do my own programming, i am so thankfull for these files. its the work i was trying to do, and it is also the push i needed to finally start using XML.

anyway using folders as a way to create a database is a cool idea... but one that has been removed over the year for portability sake of the programs. phone developping do not really lalow for that, because of the way APK works. so i totally understand why fight club 5 (IOS) doesn't want to work that in, first it would require a overhaul of the program something most developpers aren't willing to do. exemple of how you are asking ceryliae to actually rewrite all of his stuff. which in XML is a very big pain to do. i know because im trying to change the class files to fit my need because i hate the autolevel thing they used. and thats a major pain int he butt to do. so yeah, can't expect people to just change their ways after they did such a database.

and if your saying that is then better to just program it one way from the beginning... thats not an argument either, because that would mean you know what the future holds. which is completely false.

i for one, am not the kind that likes 1 file do it all, but in this cased it allowed me for a single file to be sent to my friends. instead of having to send them all the folders and forcing them to download all the files everytimes. yeah its a 6mb file but at least there is no need to create folders for it. just put the exe on desktop and be done with it.

DnDPaladin commented 7 years ago

the one thing i would suggest though, is the archetypes to be separated. its not hard to consider what spells does and just use that as archetypes as well. i dont understand the optionnal attribute to begin with. it would of been much simpler to just do like spells and put an archetype node or attribute to begin with. that would of separated the sub classes from the classes and would of solved all the problem from the get go.