Def Types
This page is mostly theory and will focus on concepts and basic information without putting it into practice.
As we saw earlier, Defs are like definitions, blueprints, or a list of ingredients for something. You will learn what are the most common types of Defs used, along with an overview of the game's systems from a deeper perspective.
Note: Humans, raiders, animals, and other races are called "Pawn" by the game's mechanics and systems.The term "pawn" will be used instead so you can get used to it more easily. Also, depending on context, you should infer that "pawn" refers to "humanlike pawn".
WARNING: The Defs shown are incomplete examples, the actual Defs are MUCH longer.
ThingDefs
ThingDefs are by far the most used type of Def. It represents almost anything we see in-game: colonists, mechanoids, plants, weapons, apparel, buildings, and so on.
Example ThingDef | Various Things in-game |
---|---|
![]() |
![]() |
BackstoryDefs
Contain the lore and skills that each backstory gives to a pawn.
Example BackstoryDef | Example Backstory |
---|---|
![]() |
![]() |
TerrainDefs
Everything that colonists, animals, etc, can step on. Includes mostly flooring and water.
Example TerrainDef | Various Terrains in-game |
---|---|
![]() |
![]() |
AbilityDefs
Pretty self-explanatory, while the base game lacks abilities, the DLCs make good use of them, such as Psycasts from Royalty, Genes from Biotech, or Role Abilities from Ideology. Specifies ability type, casting, damage, and other things.
Example AbilityDef | An Ability |
---|---|
![]() |
![]() |
BiomeDefs
As you would expect, contain what type of terrain belongs to a biome. Also specifies flora, fauna, temperature, diseases, and related stuff.
Example BiomeDef | Temperate Forest Biome |
---|---|
![]() |
![]() |
GeneDefs
While 99% of genes are in the Biotech DLC, hair and skin color are genes in the base game. GeneDefs define what features to give a humanlike pawn, like stat changes or even giving abilities.
Example GeneDef | Example Gene |
---|---|
![]() |
![]() |
ThinkTreeDefs
Pawns have a sequence of things to "think" about: "Do I have Needs to satisfy?, Do I have to try to put out the fire that is burning me?, Do I need to sleep for medical reasons?". Which stuff to think about and in what order of importance is defined in ThinkTreeDefs.
JobDefs
JobDefs are a crucial part in a pawn's behavior, in fact, every action that a pawn does is a Job, such as hauling, crafting a weapon, moving, shooting, and many more.
Example JobDef | Example Job |
---|---|
![]() |
![]() |
SoundDefs
SoundDefs are the link between the audio files and the game. When a sound is played, it is through its SoundDef. It has the location of the audio file.
ThoughtDefs
Self-explanatory as well, it contains the description of the thought, the modifier(-4, +9, etc), and the duration, among other things.
TraitDefs
Besides description and stat modifiers, contains its commonality.
WorkGiverDefs and WorkTypeDefs
WorkGiverDefs are extremely important, they define the activities within a certain WorkTypeDef. For example, we have the Hauling WorkTypeDef, and it has several mini activities such as rearming turrets, refueling, hauling corpses, etc. Each one is a WorkGiver that is linked to the actual job, while the job is the list of instructions and steps that something needs to do, the WorkGiver checks on whether is is an appropriate moment to do said job.
Note: there's code involved in the process, we are focusing on the Defs aspect of it.
HediffDefs
Hediff means "health difference", it refers to anything listed in the Health tab. Besides injuries and diseases, HediffDefs also include prosthetics, temporary health buffs/debuffs, drug effects, etc.
Example HediffDef | Example Hediff |
---|---|
![]() |
![]() |
DamageDefs, ToolCapacityDefs, ManeuverDefs
These three things work as a whole for injury types, such as Cut, Crush, Blunt, Poke, Stab, and more. Those also specify what HediffDefs to generate when they are used against something. Yes, the whole process is somewhat complex and contains several parts and Defs. This is usual for more advanced systems that we will see.
- Here we are checking how a Warg (animal) can deal attack with Defs. What we refer as animals count, in fact, as Pawns. Pawns can have a <tools> list that contains any different type of "attack". Each "attack" has a base amount of damage, the probability of it being chosen, and other properties. Each
li
contains one attack. - (1)
<capacities>
is a list of ToolCapacityDefs. - (2) ToolCapacityDefs and ManeuverDefs are linked if
<requiredCapacity>
matches the name of the ToolCapacityDef defName. - (3) Now that ToolCapacityDef and its ManeuverDef are connected, the latter can reference and link the actual DamageDef, which also has a link to the HediffDef that it will give to its victim.
- Note: you may notice the tags <verbClass> and <workerClass> in the diagram, those are references to the C# code that handles the mechanics of each thing.