Darkest Dungeon®

Darkest Dungeon®

112 ratings
How to create your own character classes
By Yal
Ever wanted to mod tDD but couldn't find out how to start? I've done the research for you! This guide contains information about what is needed/required to make your own new character classes in the full-release build!
3
   
Award
Favorite
Favorited
Unfavorite
Introduction
I've seen more Steam Community threads asking about how to get going with making a character mod for The Darkest Dungeon than I can be bothered to count, and since I'm vaguely interested in modding for myself, couldn't find a good guide as a starting point, and had to mess around with the game files with little to no prior guidance under my belt, I figured I might as well belch whatever I found out into a publicly accessible form such as a Steam Guide in order to somewhat benefit people and mildly boost my ego in the process.

This guide doesn't aim to be a complete guide covering everything there is to know about modding the game, partially because tDD is still in active development as of writing and things might change between me writing this and you reading it, partially because I don't know everything yet. But it should hopefully get you a bit further down the road of the character mod creator.

Note that this guide only covers player character mods and not monsters.

The game stores character data over a TON of files, so don't think you can finish up a mod in a single day - you probably can make a mod in less than 2-3 hours if you have all your graphics resources at hand and know what you're doing, but it's a pretty big task and I'd recommend not getting your hopes up too high just because it's easier to get disappointed that way.
What makes up a new-character mod?
Due to the way The Darkest Dungeon is programmed, class information is spread out over 4 different folders and a multitude of files. To make it as easy as possible for users to install your mod, as well as for you to test it, I'd seriously recommend creating the following folder structure so you can just copy-paste everything into the game's main folder. Also, just for show since most people don't care about it even though they know about it, I strongly encourage you to ALWAYS BACKUP YOUR GAME FOLDER BEFORE YOU MESS AROUND WITH IT.

class_name below refers to the internal name of your class, and you'd generally replace it the actual class name, such as, say, death_knight. I have no idea what things are absolute requirements and what the game will figure out on its own, but you generally get helpful error messages at startup (after selecting a file to load, when the game starts actually loading game resources) that should pinpoint you somewhat to missing references.

  • Class_Name Mod by Your_Name version_something_something
    • heroes
      • class_name
        • anim
          <a lot of .skel and .atlas files for all sprites>
        • fx
          <a lot of visual effects sprites for all attacks; PNG, SKEL and ATLAS.>
        • icons_equip
          eqp_armor_0.png
          eqp_armor_1.png
          eqp_armor_2.png
          eqp_armor_3.png
          eqp_armor_4.png
          eqp_weapon_0.png
          eqp_weapon_1.png
          eqp_weapon_2.png
          eqp_weapon_3.png
          eqp_weapon_4.png
        • class_name_A
          • anim
            <list of actual sprites>
          class_name_portrait_roster
        • class_name_B
          <same contents as A, just a different palette>
        • class_name_C
          <same contents as A, just a different palette>
        • class_name_D
          <same contents as A, just a different palette>
          class_name.ability.one.png
          class_name.ability.two.png
          class_name.ability.three.png
          class_name.ability.four.png
          class_name.ability.five.png
          class_name.ability.six.png
          class_name.ability.seven.png
          class_name.art.darkest - contains the mapping of game VFX and SFX to actions as well as sprites to each action. Pretty straighforward.
          class_name.info.darkest - contains stats data, such as characters' base HP for each armor level, whence skills can be launched and at what targets, and what effects they incur. (See below)
          class_name_guild_header.png
          class_name_portrait_roster.png

    • localization
      class_name.string_table.xml

    • raid
      • camping
        • skill_icons
          camp_skill_class_name_campskill1.png
          camp_skill_class_name_campskill2.png
          camp_skill_class_name_campskill3.png
          camp_skill_class_name_campskill4.png
        class_name.camping_skills.json

    • upgrades
      • heroes
        class_name.upgrades.json


On top of the above, you will need a list of effects to add to the effects master script; it is a single file and as such need to be manually overwritten. These effects are status effects, not visual effects, such as defining exactly how much HP a certain blight effect drains or the base % of it being successful. This is a normal text file.
Dem Gritty Details Doe
Base Info
The class_name.info.darkest file is the meatiest of all the files about a character and contains information about all their skills, all their weapon upgrades, their base resistances, and a lot more things. They have a relatively simple structure that I'd personally deem pretty self-explanatory. Let's have a look at the Arbalest's file, for a quick example.

First there is a list of base resistances, all clearly named and expressed as percentages. The game itself puts some limits on how high some of these can go, but it's fairly self-explanatory how to mod these.
Second, there's a list of upgrades. The .name tag is used to interlink this with things like the string table, so make sure you're consistent about this tag between files. Note that .def here actually means DODGE%, and not defence in the traditional sense.
Third, there's a list of skills. Skills have an id and a level, letting you easily tweak upgrades to your liking. They also have a type being either 'ranged' or 'melee'. The type seems optional, but there are trinkets that boosts ranged or melee attacks, and typeless skills miss out on these bonuses.
  • .atk is the base accuracy. Note that the game engine won't let an attack be more likely to hit than 90%. However, the game computes the accuracy as base accuracy minus target dodge, so values over 90% still are meaningful, meaning the attack is more likely to hit evasive enemies.
  • .heal is used for healing moves, and you specify the lower and upper bounds for healing. The reason why this is here instead of in the effects data is probably because this data gets transferred 1:1 to the GUI tooltips, I'd guess. I have no idea if this can be combined with .atk; the vestal's and the collector's life-draining moves both use effects to heal instead of the .heal tag.
  • .dmg is a modifier to your base attack, added as percentage points. For instance, if the dmg modifier is -60% and your base attack is 10, this means using this attack would do 4 damage to an enemy.
  • .crit is a modifier to critical chance, similar to the dmg modifier, and can be positive or negative.
  • .launch is the party slots the skill can be used from. For instance, if it's 43, you can use it from the back two rows, and if it's 4321, you can use it from anywhere.
  • .target is the party slots the skill can target. It can have several submodifiers.
    • A target modifier of 123 means you can attack the first, second or third enemy.
    • A target modifier of @123 means you can target the first, second or third ALLY, e.g. with a healing move.
    • A target modifier of ~123 means you target the first, second and third enemy simultaneously, i.e. an area-of-effect attack.
    • A target modifier of ~@123 means you target the first, second AND third ally.
    • A target modifier of ?123 means you randomly attack either the first, second or third enemy with no control over who is targeted.
      I have no idea whether ? can be combined with @, and it makes no sense meaning-wise to combine it with ~.
  • .is_crit_vallid is either True or False and has self-explanatory consequences.
  • .effect is the effect(s) that will incur on the target when this skill connects. These are strings corresponding to effects in the effects master script. One skill can cause multiple effects.
  • .generation_guaranteed will, if true, guarantee that a new character gets this skill before any remaining skill slots are randomly filled in. I have no idea what happens if you cross the skill limit by spamming this, so I'd advise caution.
Note that movement is a skill as well, with the unique type 'move' and being a 'combat_move_skill' instead of a 'combat_skill'. You can specify how the character can move left and right individually; for instance, Arbalests can only move backwards, and Jesters can move 3 steps in either direction, letting them move anywhere in the lineup with one move.

Animation Info
The class_name.art.darkest file has significantly less info than the .info file, and handles a bit of linking to the image files. The class name is assumed to be part of all the image files, but the .art file tells the game whether a certain combat skill should use the "attack_sword" or the "attack_scroll" sprite. You can name your sprites whatever you please, and use as many as you please (up to one unique sprite for every single action the character can take) as long as you include the relevant info in the .art file. The .anim tag is used to link a sprite to a skill.

-All character sprites has the name class_name.sprite.somethingsomething.png, with the middle part ("somethingsomething") being the ONLY part of the filename you can change, and only this part should be referenced in the .art file, not the whole filename.
-The movement action needs a graphics link for some reason.
-All classes need some sprites that are NOT referenced in the .art file: afflicted, camp, combat, defend, heroic, idle, investigate, walk. Since they're not referenced in the .art file, you need to make sure the filenames used for those things match properly.
-Apart from putting the correct PNG files in the A, B, C and D folders, you also need to check out the anim folder - every PNG resource needs an atlas and a skeleton file telling the game how to make a sprite out of it, orient it in-game, and so on. These files have the same name as the PNG file they interpret, but the extension ATLAS or SKEL instead of PNG.

Also note that the .art file contains information about what visual effects to show at enemies when an attack connects (and the user as they launch it); the effect to spawn at the user is specified with the tag .fx, and effects at the target with any of .targfx, .targchestfx, or .targheadfx. The actual effects uses the sprites in the fx folder, and are linked similarly to the character sprites using the same naming rules.

New Skills
To add new skills, you need to edit two files - the .info file and the effects script. I would personally have a separate text file where I keep all my effects, then put any finished effects into the master script in a batch, and distribute said file along with the mod - all effects are defined in the same file, so to have more than one mod installed at the same time, manual editing of that file is necessary.
In the .info file, you add the core data of each skill, for each level. See the section on the base info file for more details about what tags you come across here and what they do. Buffs and status ailments are called 'effects', and these are defined in the effects master script, and referenced by name in the info file. You can reference multiple effects (separated by spaces) after a single .effect tag.
Even More Gritty Details Because I Hit The Section Character Limit
Camping skills
Camping skills are defined in raid/camping/class_name.camping_skills.json, and as the name implies, it's a JSON file. They're a bit different from the attack skills' definition, but still pretty much humanly readable. You can't define new effects for these, only use hardcoded effects, so I'd recommend checking through the existing camping skill JSON files to get a hunch about what effects there are to choose from. You can have multiple effects be inflicted by a single camping skill, even with different scope (self, allies, everyone), letting you do complex skills.

Id, level, cost, use_limit and effects all are very self-explanatory tags, so you should be able to figure out how to handle these pretty easily.

New Effects
You define all the new effects in the effects master script, script/effects.darkest.
Effects have the following tags:
  • .name - used to reference the effect from otherwise. Make sure it's unique.
  • .target - either "target", which is whoever(s) were selected as targets for the move, or "performer", which is who used the skill. Life-draining moves or moves that debuffs the user afterwards are two examples of attacks that would need effects of both types. Can also be "global" if your effect does not affect any combatant, but still must somehow be applied.
  • .curio_result_type - either "positive" or "negative". If 'negative', the target's debuff resistance is taken into account.
  • .chance N% - the base chance the effect has to occur. It only takes effect if the roll is successful.
  • .on_hit and .on_miss - whether the effect gets applied when the move triggering it hits versus when it misses. Each are either true or false.
  • .stun N - stuns the target for N actions. All instances in-game use 1 for N.
  • .dotBleed N and .dotPoison N - inflicts Bleed or Blight, with N damage per turn. Needs to be followed by a .duration N tag where N is the default number of turns, always 3 in-game. Critical hits with a DOT extends this to 5 turns, but I have no idea whether that's a hardcoded number, a x1.67 multiplier, or a +2 turns modifier. If duration is -1, the duration of an effect is infinite ("until end of quest").
  • .stress N - adds N stress damage (taking trinket modifiers, etc into account).
  • .push N and pull N - pushes or pulls the target N steps.
  • .combat_stat_buff N - adds buffs or debuffs. N always seem to be 1 in-game and I don't know whether it affects anything. Always predeceeds actual buff tags. The following seems to exist:
    • .speed_rating_add N - adds N to speed. Can be negative.
    • .attack_rating_add N% - adds N% to the base accuracy. Can be negative. (Note that the game hard-limits move hit rate to 90%, even if your final accuracy is above 90%)
    • .defense_rating_add N% - adds N% to the base evade. Can be negative.
    • .crit_chance_add N% - adds N% to the base CRIT. Can be negative.
    • .protection_rating_add N% - adds N% to the base PROT. Can be negative (a negative net PROT increases the sustained damage of a target).
    • .damage_low_multiply N% and .damage_high_multiply N% - adds N% to either the upper or lower bound of attack damage. Can be negative. N = 50% means a +50% buff, not a x0.50 multiplier, so the name is a bit misleading. The official code always boost both with the same value. I don't know whether it is a requirement, but I can imagine bugs occuring if the lower bound is boosted to the point that it is greater than the upper bound (or vice versa) so I would recommend that you alter both equally.
  • .buff_ids - Activates special buffs that are hardcoded in-game. Check the effects master script to learn about which ones are available.
  • .tag N - marks as target. In the official code, N is always 1. Duration is controlled with the .duration tag, just like for DOTs.
  • .apply_once true - Used for effects that effects global things in order to only have them happen once per move execution, such as the Vestal and Occultist manipulating light, or the Collector or Shambler summoning new monsters.
  • .riposte 1 - Add riposte state. Should be followed by a .duration tag and a .riposte_chance_add N% that defines the base counter-attack chance.
  • healstress N - removes N stress damage.
  • .cure 1 - Removes status ailments (blight/bleed).
  • .heal N - Restores N HP.
  • .keyStatus N / .monsterType N: When put before a .combat_stat_buff tag, buffs are only applied for the duration of this attack - and only if the condition holds - and then discarded, letting you make attacks that are stronger against certain enemies.
    keyStatus can be "tagged", "stunned", "poisoned" or "bleeding", referencing a target that is marked, stunned, blighted and bleeding respectively.
    monsterType can be "unholy", "man", "beast" or "eldritch" - probably the internal name for any other type as well (such as whatever Ironwork or Carpentry is known as under the hood).
There ARE more tags than this, but this should cover the important ones (and tags I'm at least 90% sure I know how they work)

New Sprites
In my opinion, the best way to go when it comes to create new sprites is to find an existing class that is the closest to the new class you want to add in, copy the sprite folder - including the anim subfolder with the skeleton and atlas files - from that, and then put your own art on top of the existing PNGs. That way, you don't have to bother with the skel and atlas formats. I strongly, strongly recommend using GIMP for image editing, and keeping a complex multi-layered XCF file for each sprite you work on, then exporting as PNG. Knowing how to use features like multiple layers lets you do some really complex things pretty easily, and while MS Paint or PaintNET are easier to use, time spent learning GIMP pays off. (Or use Photoshop if you feel like pouring money into Adobe, your choice, but I personally prefer the hipster option)

The atlas file contains informations about what parts of the image are used, and in particular applies to the "tons of small parts" sprites such as walk and combat sprites, but it's as important to the images' transparency as the pixels' alpha values.
The skeleton file contains information about how parts are connected to each other and how they are oriented, rotated and depth sorted. As you can see, the skeleton files for the tonsofchunked sprites are almost 20 times the size of the skeleton files for static sprites.

String Table
The string table contains character barks as well as other flavour text such as guild, blacksmith and survivalist upgrade descriptions, skill and upgrade names, and general dialogue. Any string that's missing from this table won't trigger an error, but the game will display a different-colored code snippet instead, so I'd strongly recommend you to copy an existing string table and manually replace all strings with whatever you deem fitting.

Sound
It is currently (as of 2016-04-19) impossible to mod sound; nobody seems to know how BANK files work, they're encrypted, and all signs seem to indicate the mapping of soundbanks to character classes is hardwired in the executable.
Closing Words
I hope this guide was kinda helpful and at least better than a bare bulb. If you think it's missing something, feel free to post a comment about it and I might just be forced to research it and squeeze it in somewhere. :3

Good luck, have fun, and remember that overconfidence is a slow and insidious killer!
22 Comments
Yal  [author] 2 Mar, 2020 @ 2:29pm 
I don't remember what I did when I wrote this guide, it was four years ago. I use SublimeText, it's got a lot of different syntax highlightning styles to choose from... if it doesn't autodetect the appropriate style, just try a bunch and see if it looks good or not. Most of the data is XML-formatted.
vexion 24 Jul, 2019 @ 2:28pm 
ok thanks
Yal  [author] 24 Jul, 2019 @ 2:07pm 
If you've got a Spine license (program they used to animate things), might be worth opening your spritesheets in that and verify you've got all the bounding boxes set up properly.
vexion 24 Jul, 2019 @ 2:04pm 
yes i've verified times and times again but it keeps that damn with box. but what other softwares would you recommend me?
Yal  [author] 24 Jul, 2019 @ 12:32pm 
Make sure you save the images with a program that supports transparency (e.g. the GNU Image Manipulation Program or Photoshop), stuff like Paint turns all the transparent pixels into solid white.
vexion 24 Jul, 2019 @ 11:17am 
when i say "attack picture" i'm talking about the sprites.
vexion 24 Jul, 2019 @ 11:12am 
i maneged to make it work but i have now others troubles.
when i modify the attack pictures in the "anim" file , it's the chosen picture boxed in a white square. what can i do?
Yal  [author] 22 Jul, 2019 @ 8:48am 
Did you put it in the mod folder? There's been breaking changes in the mod system since I posted this guide.
vexion 22 Jul, 2019 @ 7:58am 
you said that you can modify a string file, which i did. but once i save it, the game just doen't care and ignores my modifications. what should i do?
Yal  [author] 5 Mar, 2018 @ 10:31am 
From what I can remember (there's been some big changes to the mod system when Crimson Court came out and i've not kept up to date, and there's an official modding guide now) the effects of buffs were in a special "effects" list, which had the actual stat points and stuff. Names were spread out over multiple places.

As a programmer, I'd recommend you to get Git; when you install it, tell it to install Git Bash. Now you have a handy command line tool that lets you do stuff easily. Next open Git Bash, and run the command

grep -rFni "name="

from the Darkest Dungeon folder and it'll look for variable assignments and tell you which files it's in.

Git's main use is source control, aka online backup and version management thing. If you're gonna dabble with code and modding, you should learn it ASAP - I've used it on every job I've had so far, and it's a great addition to your CV.