v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "Raw file"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m (Interwiki link)
m (+category: Raws)
 
(37 intermediate revisions by 15 users not shown)
Line 1: Line 1:
{{Quality|Superior|02:10, 29 April 2013 (UTC)}}
+
{{Quality|Fine}}
 
{{av}}
 
{{av}}
 +
[[File:raw_preview.png|240px|right]]
  
'''Raw files''' are text files found in the '''raw/objects/''' subdirectory of Dwarf Fortress (used for [[world generation]]), as well as inside the [[saved game folder]] ('''data/save/<region name>/raw/objects/''') for already generated worlds. These files can be looked through to discover various specifics of game items, materials, and creatures, and can be changed to alter how the game behaves.  They are sometimes referred to by players as just "the raws".
+
'''Raw files''' are text files found in the <code>[[Game folder|<Dwarf Fortress>]]\data\vanilla\</code> subdirectory of ''Dwarf Fortress'' (used for [[world generation]]), as well as inside the [[save|saved game]] folder for already generated worlds. These files can be looked through to discover various specifics of game items, materials, and creatures, and can be changed to alter how the game behaves.  They are sometimes referred to by players as just "the raws".
  
The '''raw/graphics''' subfolder of Dwarf Fortress is used to store user-customizable [[graphics set repository|graphics sets]]. The '''raw/interaction examples''' folder is absolutely useless and completely ignored by Dwarf Fortress.
+
The <code>data\vanilla\*_graphics</code> subfolders are used to store user-customizable [[graphics set repository|graphics sets]]. The <code>data\vanilla\[[interaction examples]]</code> folder contains examples useful for modding but completely ignored by ''Dwarf Fortress''.
  
Dwarf Fortress is not an open source program, so most [[modding]] of the game is limited to altering the raws or doing [[memory hacking]].
+
''Dwarf Fortress'' is not currently an open-source program, so most [[modding]] of the game is limited to altering the raws or [[memory hacking]].
  
Duplicating the raw files can cause strange, difficult-to-diagnose problems, and even crashes in some cases.
+
[[Duplicated raws|Duplicating the raw files]] can cause strange, difficult-to-diagnose problems, and even crashes in some cases.
  
 
==Syntax of raw files==
 
==Syntax of raw files==
Line 19: Line 20:
 
  <...contents...>
 
  <...contents...>
  
ID is a unique identificator for your type to use (i.e. [CREATURE:DOG], ID=DOG or [ITEM:ITEM_WEAPON_SWORD], ID=ITEM_WEAPON_SWORD).
+
''filename'' is a copy of the raw file name, minus the .txt extension; every raw must begin with this. It must begin with a certain prefix depending on the TYPE (see below).
 +
 
 +
''TYPE'' is a keyword that instructs the game what sort of objects are being defined in the raw (see below).  An individual raw file can (and must) have only one OBJECT:TYPE.
 +
 
 +
''ID'' is a unique identificator for your type to use (i.e. [CREATURE:DOG], ID=DOG or [ITEM:ITEM_WEAPON_SWORD], ID=ITEM_WEAPON_SWORD).
  
 
===Types of content===
 
===Types of content===
*BODY &mdash; body parts and structures.
+
*BODY &mdash; body parts and structures; filename prefix <code>body_</code>.
*BODY_DETAIL_PLAN &mdash; similar to CREATURE_VARIATION, but used for defining tokens related to body parts (specifically materials, tissues, the assignment thereof, and body part positions, relative sizes, etc.)
+
*BODY_DETAIL_PLAN &mdash; similar to CREATURE_VARIATION, but used for defining tokens related to body parts (specifically materials, tissues, the assignment thereof, and body part positions, relative sizes, etc.); filename prefix <code>b_detail_plan_</code>.
*BUILDING &mdash; custom workshops and smelters.
+
*BUILDING &mdash; custom workshops and smelters; filename prefix <code>building_</code>.
*CREATURE &mdash; [[creature]]s.
+
*CREATURE &mdash; [[creature]]s; filename prefix <code>creature_</code>.
*CREATURE_VARIATION &mdash; variations that can be applied to creatures (e.g., making them giants, or anthropomorphic). Technically a series of tokens that are added to or removed from the creature (essentially a set of templated changes).
+
*CREATURE_VARIATION &mdash; variations that can be applied to creatures (e.g., making them giants, or anthropomorphic). Technically a series of tokens that are added to or removed from the creature (essentially a set of templated changes); filename prefix <code>c_variation_</code>.
*DESCRIPTOR_COLOR (tag is COLOR) &mdash; named colours for use with DESCRIPTOR_PATTERN objects (other purposes unknown)
+
*DESCRIPTOR_COLOR (tag is COLOR) &mdash; named colors for use with DESCRIPTOR_PATTERN objects (other purposes unknown); filename prefix <code>descriptor_color_</code>.
*DESCRIPTOR_PATTERN (tag is COLOR_PATTERN) &mdash; patterns with colour combinations for use with creatures.
+
*DESCRIPTOR_PATTERN (tag is COLOR_PATTERN) &mdash; patterns with color combinations for use with creatures; filename prefix <code>descriptor_pattern_</code>.
*DESCRIPTOR_SHAPE (tag is SHAPE) &mdash; shapes with descriptions and variations. These are used for engravings.
+
*DESCRIPTOR_SHAPE (tag is SHAPE) &mdash; shapes with descriptions and variations, used for engravings; filename prefix <code>descriptor_shape_</code>.
*ENTITY &mdash; civilization types, with assigned race, language, culture, ethics, and social structure.
+
*ENTITY &mdash; civilization types, with assigned race, language, culture, ethics, and social structure; filename prefix <code>entity_</code>.
*GRAPHICS &mdash; graphic tiles for creatures. These are not found inside the raw/objects folder.
+
*GRAPHICS &mdash; graphic tiles for creatures. These are not found inside the raw/objects folder; filename prefix <code>graphics_</code>.
*INTERACTION &mdash; interaction definitions.
+
*INTERACTION &mdash; interaction definitions; filename prefix <code>interaction_</code>.
*INORGANIC &mdash; inorganic material definitions.
+
*INORGANIC &mdash; inorganic material definitions; filename prefix <code>inorganic_</code>.
*ITEM &mdash; items ranging from ammunition to food types, has secondary types for the purposes of [TYPE:ID].
+
*ITEM &mdash; items ranging from ammunition to food types, has secondary types for the purposes of [TYPE:ID]; filename prefix <code>item_</code>.
 
**ITEM_AMMO &mdash; ammunition for ranged weapons.
 
**ITEM_AMMO &mdash; ammunition for ranged weapons.
**ITEM_ARMOR &mdash; body clothing, including armour.
+
**ITEM_ARMOR &mdash; body clothing, including armor.
 
**ITEM_FOOD &mdash; prepared food definitions.
 
**ITEM_FOOD &mdash; prepared food definitions.
**ITEM_GLOVES &mdash; hand clothing, including armour.
+
**ITEM_GLOVES &mdash; hand clothing, including armor.
**ITEM_HELM &mdash; head clothing, including armour.
+
**ITEM_HELM &mdash; head clothing, including armor.
 
**ITEM_INSTRUMENT &mdash; instrument definitions.
 
**ITEM_INSTRUMENT &mdash; instrument definitions.
**ITEM_PANTS &mdash; lower body clothing, including armour.
+
**ITEM_PANTS &mdash; lower body clothing, including armor.
 
**ITEM_SHIELD &mdash; shields.
 
**ITEM_SHIELD &mdash; shields.
**ITEM_SHOES &mdash; foot clothing, including armour.
+
**ITEM_SHOES &mdash; foot clothing, including armor.
 
**ITEM_SIEGEAMMO &mdash; ammunition for siege weapons that [[ballista]]e fire.
 
**ITEM_SIEGEAMMO &mdash; ammunition for siege weapons that [[ballista]]e fire.
 
**ITEM_TOOL &mdash; multi-purpose items that can serve as a [[weapon]], food storage container, etc.
 
**ITEM_TOOL &mdash; multi-purpose items that can serve as a [[weapon]], food storage container, etc.
Line 49: Line 54:
 
**ITEM_TRAPCOMP &mdash; components that can be used in weapon traps (two special tags define trapcomps that can be used in other constructions: IS_SCREW and IS_SPIKE).
 
**ITEM_TRAPCOMP &mdash; components that can be used in weapon traps (two special tags define trapcomps that can be used in other constructions: IS_SCREW and IS_SPIKE).
 
**ITEM_WEAPON &mdash; weapons that are used by soldiers, as well as digging tools.
 
**ITEM_WEAPON &mdash; weapons that are used by soldiers, as well as digging tools.
*LANGUAGE &mdash; word definitions for the languages used by ENTITY objects.
+
*LANGUAGE &mdash; word definitions for the languages used by ENTITY objects; filename prefix <code>language_</code>.
 
**Entries beginning with [SYMBOL:ID] sort words into symbolic/poetic groups to be referenced by ENTITY preferences.
 
**Entries beginning with [SYMBOL:ID] sort words into symbolic/poetic groups to be referenced by ENTITY preferences.
 
**Entries beginning with [WORD:ID] define words and their alternate forms (in English).
 
**Entries beginning with [WORD:ID] define words and their alternate forms (in English).
*MATERIAL_TEMPLATE &mdash; definitions of information common to groups of materials (referenced all over the place).
+
*MATERIAL_TEMPLATE &mdash; definitions of information common to groups of materials (referenced all over the place); filename prefix <code>material_template_</code>.
*PLANT &mdash; definitions of plants, their materials, and their derivatives.
+
*MUSIC &mdash; assigns music files to background and event music cues, modding currently very limited; filename prefix <code>music_</code>.
*REACTION &mdash; reactions/custom workshop jobs (turn items into other items through dwarven or adventurer effort).
+
*PALETTE &mdash; defines a color palette and associates those colors to an image file containing color swatches; filename prefix <code>palette_</code>.
*TISSUE_TEMPLATE &mdash; defines templated tissues for use with BODY_DETAIL_PLAN objects or in creatures.
+
*PLANT &mdash; definitions of plants, their materials, and their derivatives; filename prefix <code>plant_</code>.
 +
*REACTION &mdash; reactions/custom workshop jobs (turn items into other items through dwarven or adventurer effort); filename prefix <code>reaction_</code>.
 +
*SOUND &mdash; associates sound files with in-game event cues; filename prefix <code>sound_</code>.
 +
*TEXT_SET &mdash; conversation text, mostly used in Adventure mode; ; filename prefix <code>text_</code>. Example: [[text_dwarf.txt]]
 +
*TILE_PAGE &mdash; assigns IDs to image files and establishes their parameters for use in GRAPHICS raws; filename prefix <code>tile_page_</code>.
 +
*TISSUE_TEMPLATE &mdash; defines templated tissues for use with BODY_DETAIL_PLAN objects or in creatures; filename prefix <code>tissue_template_</code>.
  
 
Usually empty lines are used to divide different types of structures like the file name and [OBJECT:] or different entries, however everything which is not a token besides the 1st string (which is the filename) is understood as comments and is not considered.
 
Usually empty lines are used to divide different types of structures like the file name and [OBJECT:] or different entries, however everything which is not a token besides the 1st string (which is the filename) is understood as comments and is not considered.
  
 
The tokens are enclosed in square brackets ([TOKEN:VALUES]).
 
The tokens are enclosed in square brackets ([TOKEN:VALUES]).
 
When a world is generated, the raw files are copied from <game folder>/raw/ to <game folder>/data/save/REGION/raw/. It is currently unknown how much these can then be changed without breaking the save.
 
  
 
A list of tokens can be seen at [[:Category:Tokens]].
 
A list of tokens can be seen at [[:Category:Tokens]].
  
 
== Parsing ==
 
== Parsing ==
The order that Dwarf Fortress parses raw files is determined by the first line of the raw file (''not'' necessarily the filename). This parsing order is important for certain tags such as [COPY_TAGS_FROM], but not for most other tags.  
+
{{migrated section}}
 +
The order that ''Dwarf Fortress'' parses raw files in is determined by the first line of the raw file (''not'' necessarily the filename). This parsing order is important for certain tags, such as [COPY_TAGS_FROM], but not for most other tags.
 +
 
 +
The names of raw files are completely irrelevant - when you create a new creature, you can put it in any file you want (or even in a brand-new file) and the game won't behave any differently. You can even rename all of the existing raw files and the game still won't care (as long as you generate a new world first, of course).  
  
The load order (recorded by logging DF 0.44.09 file activity in Windows 10) follows the following pattern:
+
==Required objects==
 +
{{migrated section}}
 +
While most of the raw files are replaceable or removable, some contain raw objects that are used by procedurally generated creatures (such as [[Forgotten beast|FBs]] and [[experiment]]s). Raws with the following IDs must exist, to support those creatures. The file names are where said objects exist by default, but are not important on their own, as long as the objects exist somewhere in the raws the game may use them. This list was compiled by examining the code that emits the various "Cannot generate random creatures -- missing *" error messages.
  
  language_*
+
material_template_default.txt:
  descriptor_shape_*
+
SKIN_TEMPLATE
  descriptor_color_*
+
FAT_TEMPLATE
  descriptor_pattern_*
+
MUSCLE_TEMPLATE
  material_template_*
+
SINEW_TEMPLATE
  inorganic_*
+
BONE_TEMPLATE
  plant_*
+
CARTILAGE_TEMPLATE
  tissue_template_*
+
HAIR_TEMPLATE
  item_*
+
FEATHER_TEMPLATE
  building_*
+
SCALE_TEMPLATE
  b_detail_plan_*
+
NAIL_TEMPLATE
  body_*
+
TOOTH_TEMPLATE
  c_variation_*
+
EYE_TEMPLATE
  creature_*
+
NERVE_TEMPLATE
  entity_*
+
BRAIN_TEMPLATE
  reaction_*
+
LUNG_TEMPLATE
  interaction_*
+
HEART_TEMPLATE
 +
LIVER_TEMPLATE
 +
GUT_TEMPLATE
 +
STOMACH_TEMPLATE
 +
PANCREAS_TEMPLATE
 +
SPLEEN_TEMPLATE
 +
KIDNEY_TEMPLATE
 +
LEATHER_TEMPLATE
 +
HORN_TEMPLATE
 +
PEARL_TEMPLATE
 +
SILK_TEMPLATE
 +
BLOOD_TEMPLATE
 +
  ICHOR_TEMPLATE
 +
GOO_TEMPLATE
 +
SLIME_TEMPLATE
 +
SHELL_TEMPLATE
 +
SOAP_TEMPLATE
 +
TALLOW_TEMPLATE
 +
CHITIN_TEMPLATE
 +
MILK_TEMPLATE
 +
CREATURE_CHEESE_TEMPLATE
 +
STRUCTURAL_PLANT_TEMPLATE
 +
SEED_TEMPLATE
 +
LEAF_TEMPLATE
 +
THREAD_PLANT_TEMPLATE
 +
PLANT_ALCOHOL_TEMPLATE
 +
PLANT_POWDER_TEMPLATE
 +
PLANT_EXTRACT_TEMPLATE
 +
CREATURE_EXTRACT_TEMPLATE
 +
FLAME_TEMPLATE
 +
tissue_template_default.txt:
 +
SKIN_TEMPLATE
 +
FAT_TEMPLATE
 +
MUSCLE_TEMPLATE
 +
BONE_TEMPLATE
 +
SHELL_TEMPLATE
 +
HORN_TEMPLATE
 +
CARTILAGE_TEMPLATE
 +
HAIR_TEMPLATE
 +
CHEEK_WHISKERS_TEMPLATE
 +
CHIN_WHISKERS_TEMPLATE
 +
MOUSTACHE_TEMPLATE
 +
SIDEBURNS_TEMPLATE
 +
EYEBROW_TEMPLATE
 +
EYELASH_TEMPLATE
 +
FEATHER_TEMPLATE
 +
SCALE_TEMPLATE
 +
NAIL_TEMPLATE
 +
CLAW_TEMPLATE
 +
TALON_TEMPLATE
 +
TOOTH_TEMPLATE
 +
EYE_TEMPLATE
 +
NERVE_TEMPLATE
 +
BRAIN_TEMPLATE
 +
LUNG_TEMPLATE
 +
HEART_TEMPLATE
 +
LIVER_TEMPLATE
 +
GUT_TEMPLATE
 +
STOMACH_TEMPLATE
 +
PANCREAS_TEMPLATE
 +
SPLEEN_TEMPLATE
 +
KIDNEY_TEMPLATE
 +
FLAME_TEMPLATE
 +
b_detail_plan_default.txt:
 +
STANDARD_MATERIALS
 +
STANDARD_TISSUES
 +
CHITIN_MATERIALS
 +
CHITIN_TISSUES
 +
FACIAL_HAIR_TISSUES
 +
HEAD_HAIR_TISSUE_LAYERS
 +
FACIAL_HAIR_TISSUE_LAYERS
 +
BODY_HAIR_TISSUE_LAYERS
 +
BODY_FEATHER_TISSUE_LAYERS
 +
VERTEBRATE_TISSUE_LAYERS
 +
EXOSKELETON_TISSUE_LAYERS
 +
STANDARD_HEAD_POSITIONS
 +
HUMANOID_HEAD_POSITIONS
 +
HUMANOID_RIBCAGE_POSITIONS
 +
SHELL_POSITIONS
 +
HUMANOID_RELSIZES
 +
c_variation_default.txt:
 +
STANDARD_BIPED_GAITS
 +
STANDARD_QUADRUPED_GAITS
 +
STANDARD_WALKING_GAITS
 +
STANDARD_CLIMBING_GAITS
 +
STANDARD_SWIMMING_GAITS
 +
STANDARD_CRAWLING_GAITS
 +
STANDARD_FLYING_GAITS
 +
STANDARD_WALK_CRAWL_GAITS
 +
body_rcp.txt:
 +
RCP_BASIC_BODY
 +
RCP_BASIC_BODY_STANCE
 +
RCP_BASIC_BODY_STANCE_WITH_HEAD_FLAG
 +
RCP_UPPER_BODY
 +
RCP_LOWER_BODY
 +
RCP_THORAX
 +
RCP_ABDOMEN
 +
RCP_CEPHALOTHORAX
 +
RCP_HEAD
 +
RCP_NECK
 +
RCP_TWO_PART_ARMS
 +
RCP_PINCERS
 +
RCP_CLAW_ARMS
 +
RCP_FIRST_SIMPLE_LEGS
 +
RCP_FIRST_SIMPLE_LEGS_GRASP
 +
RCP_SECOND_SIMPLE_LEGS
 +
RCP_THIRD_SIMPLE_LEGS
 +
RCP_FOURTH_SIMPLE_LEGS
 +
RCP_FIFTH_SIMPLE_LEGS
 +
RCP_SIMPLE_FRONT_LEGS
 +
RCP_SIMPLE_FRONT_LEGS_GRASP
 +
RCP_SIMPLE_REAR_LEGS
 +
RCP_TWO_PART_LEGS
 +
RCP_FRONT_FLIPPER
 +
RCP_REAR_FLIPPER
 +
RCP_TWO_FLIGHTLESS_WINGS
 +
RCP_TWO_WINGS
 +
RCP_TAIL
 +
RCP_2_TAILS
 +
RCP_3_TAILS
 +
RCP_TAIL_STINGER
 +
RCP_LOWER_BODY_STINGER
 +
RCP_PROBOSCIS
 +
RCP_TRUNK
 +
RCP_SHELL
 +
RCP_ANTENNAE
 +
RCP_1_HEAD_HORN
 +
RCP_2_HEAD_HORNS
 +
RCP_3_HEAD_HORNS
 +
RCP_4_HEAD_HORNS
 +
RCP_LARGE_MANDIBLES
 +
RCP_5_FINGERS
 +
RCP_4_FINGERS
 +
RCP_3_FINGERS
 +
RCP_2_FINGERS
 +
RCP_5_TOES
 +
RCP_4_TOES
 +
RCP_3_TOES
 +
RCP_2_TOES
 +
RCP_5_FRONT_TOES
 +
RCP_4_FRONT_TOES
 +
RCP_3_FRONT_TOES
 +
RCP_2_FRONT_TOES
 +
RCP_5_REAR_TOES
 +
RCP_4_REAR_TOES
 +
RCP_3_REAR_TOES
 +
RCP_2_REAR_TOES
 +
RCP_1_EYE
 +
RCP_2_EYES
 +
RCP_3_EYES
 +
RCP_BEAK
 +
RCP_NOSE
 +
RCP_CHEEKS
 +
RCP_LUNGS
 +
RCP_HEART
 +
RCP_GUTS
 +
RCP_THROAT
 +
RCP_SPINE
 +
RCP_UPPER_SPINE
 +
RCP_BRAIN
 +
  RCP_SKULL
 +
  RCP_MOUTH
 +
  RCP_TEETH
 +
  RCP_RIBS
 +
  RCP_RIBS_EXTERNAL
 +
  RCP_LIPS
 +
  RCP_1_EYELID
 +
  RCP_2_EYELIDS
 +
  RCP_3_EYELIDS
 +
  RCP_GLOSS_HOOF
 +
  RCP_GLOSS_PAW
 +
  RCP_5_FRONT_FINGERS*
 +
  RCP_4_FRONT_FINGERS*
 +
  RCP_3_FRONT_FINGERS*
 +
  RCP_2_FRONT_FINGERS*
 +
  RCP_TONGUE*
  
Therefore, vanilla DF 0.44.09 loads RAW files in the following order:
+
: * - The game does not confirm the presence of these objects, but it ''will'' still attempt to use them (and fail if they are missing)
  
language_DWARF.txt
+
The objects RCP_FORKED_TONGUE, RCP_BILL, and RCP_2_HEAD_ANTLERS are currently '''not''' used by the game and can be safely removed.
language_ELF.txt
 
language_GOBLIN.txt
 
language_HUMAN.txt
 
language_SYM.txt
 
language_words.txt
 
descriptor_shape_standard.txt
 
descriptor_color_standard.txt
 
descriptor_pattern_iris_eye.txt
 
descriptor_pattern_pupil_eye.txt
 
descriptor_pattern_special.txt
 
material_template_default.txt
 
inorganic_metal.txt
 
inorganic_other.txt
 
inorganic_stone_gem.txt
 
inorganic_stone_layer.txt
 
inorganic_stone_mineral.txt
 
inorganic_stone_soil.txt
 
plant_crops.txt
 
plant_garden.txt
 
plant_grasses.txt
 
plant_new_trees.txt
 
plant_standard.txt
 
tissue_template_default.txt
 
item_ammo.txt
 
item_armor.txt
 
item_food.txt
 
item_gloves.txt
 
item_helm.txt
 
item_pants.txt
 
item_shield.txt
 
item_shoes.txt
 
item_siegeammo.txt
 
item_tool.txt
 
item_toy.txt
 
item_trapcomp.txt
 
item_weapon.txt
 
building_custom.txt
 
b_detail_plan_default.txt
 
body_default.txt
 
body_rcp.txt
 
c_variation_default.txt
 
creature_amphibians.txt
 
creature_annelids.txt
 
creature_birds.txt
 
creature_birds_new.txt
 
creature_bug_slug_new.txt
 
creature_desert_new.txt
 
creature_domestic.txt
 
creature_equipment.txt
 
creature_fanciful.txt
 
creature_insects.txt
 
creature_large_mountain.txt
 
creature_large_ocean.txt
 
creature_large_riverlake.txt
 
creature_large_temperate.txt
 
creature_large_tropical.txt
 
creature_large_tundra.txt
 
creature_mountain_new.txt
 
creature_next_underground.txt
 
creature_ocean_new.txt
 
creature_other.txt
 
creature_reptiles.txt
 
creature_riverlakepool_new.txt
 
creature_small_mammals.txt
 
creature_small_mammal_new.txt
 
creature_small_ocean.txt
 
creature_small_riverlake.txt
 
creature_standard.txt
 
creature_subterranean.txt
 
creature_temperate_new.txt
 
creature_tropical_new.txt
 
creature_tundra_taiga_new.txt
 
entity_default.txt
 
reaction_adv_carpenter.txt
 
reaction_other.txt
 
reaction_smelter.txt
 
interaction_standard.txt
 
  
 +
==Examples==
 +
*[[Creature examples]]
 +
*[[Interaction examples]]
 +
*[[Reaction examples]]
 +
*[[Syndrome examples]]
  
[[Category:Files]]
+
{{Category|Files}}
 
{{Category|Modding}}
 
{{Category|Modding}}
 +
{{Category|Raws}}
 
[[ru:Raw file]]
 
[[ru:Raw file]]

Latest revision as of 20:32, 12 March 2023

This article is about the current version of DF.
Note that some content may still need to be updated.

Raw preview.png

Raw files are text files found in the <Dwarf Fortress>\data\vanilla\ subdirectory of Dwarf Fortress (used for world generation), as well as inside the saved game folder for already generated worlds. These files can be looked through to discover various specifics of game items, materials, and creatures, and can be changed to alter how the game behaves. They are sometimes referred to by players as just "the raws".

The data\vanilla\*_graphics subfolders are used to store user-customizable graphics sets. The data\vanilla\interaction examples folder contains examples useful for modding but completely ignored by Dwarf Fortress.

Dwarf Fortress is not currently an open-source program, so most modding of the game is limited to altering the raws or memory hacking.

Duplicating the raw files can cause strange, difficult-to-diagnose problems, and even crashes in some cases.

Syntax of raw files[edit]

filename

[OBJECT:TYPE]

[TYPE:ID] 
<...contents...>

filename is a copy of the raw file name, minus the .txt extension; every raw must begin with this. It must begin with a certain prefix depending on the TYPE (see below).

TYPE is a keyword that instructs the game what sort of objects are being defined in the raw (see below). An individual raw file can (and must) have only one OBJECT:TYPE.

ID is a unique identificator for your type to use (i.e. [CREATURE:DOG], ID=DOG or [ITEM:ITEM_WEAPON_SWORD], ID=ITEM_WEAPON_SWORD).

Types of content[edit]

  • BODY — body parts and structures; filename prefix body_.
  • BODY_DETAIL_PLAN — similar to CREATURE_VARIATION, but used for defining tokens related to body parts (specifically materials, tissues, the assignment thereof, and body part positions, relative sizes, etc.); filename prefix b_detail_plan_.
  • BUILDING — custom workshops and smelters; filename prefix building_.
  • CREATURE — creatures; filename prefix creature_.
  • CREATURE_VARIATION — variations that can be applied to creatures (e.g., making them giants, or anthropomorphic). Technically a series of tokens that are added to or removed from the creature (essentially a set of templated changes); filename prefix c_variation_.
  • DESCRIPTOR_COLOR (tag is COLOR) — named colors for use with DESCRIPTOR_PATTERN objects (other purposes unknown); filename prefix descriptor_color_.
  • DESCRIPTOR_PATTERN (tag is COLOR_PATTERN) — patterns with color combinations for use with creatures; filename prefix descriptor_pattern_.
  • DESCRIPTOR_SHAPE (tag is SHAPE) — shapes with descriptions and variations, used for engravings; filename prefix descriptor_shape_.
  • ENTITY — civilization types, with assigned race, language, culture, ethics, and social structure; filename prefix entity_.
  • GRAPHICS — graphic tiles for creatures. These are not found inside the raw/objects folder; filename prefix graphics_.
  • INTERACTION — interaction definitions; filename prefix interaction_.
  • INORGANIC — inorganic material definitions; filename prefix inorganic_.
  • ITEM — items ranging from ammunition to food types, has secondary types for the purposes of [TYPE:ID]; filename prefix item_.
    • ITEM_AMMO — ammunition for ranged weapons.
    • ITEM_ARMOR — body clothing, including armor.
    • ITEM_FOOD — prepared food definitions.
    • ITEM_GLOVES — hand clothing, including armor.
    • ITEM_HELM — head clothing, including armor.
    • ITEM_INSTRUMENT — instrument definitions.
    • ITEM_PANTS — lower body clothing, including armor.
    • ITEM_SHIELD — shields.
    • ITEM_SHOES — foot clothing, including armor.
    • ITEM_SIEGEAMMO — ammunition for siege weapons that ballistae fire.
    • ITEM_TOOL — multi-purpose items that can serve as a weapon, food storage container, etc.
    • ITEM_TOY — toy definitions.
    • ITEM_TRAPCOMP — components that can be used in weapon traps (two special tags define trapcomps that can be used in other constructions: IS_SCREW and IS_SPIKE).
    • ITEM_WEAPON — weapons that are used by soldiers, as well as digging tools.
  • LANGUAGE — word definitions for the languages used by ENTITY objects; filename prefix language_.
    • Entries beginning with [SYMBOL:ID] sort words into symbolic/poetic groups to be referenced by ENTITY preferences.
    • Entries beginning with [WORD:ID] define words and their alternate forms (in English).
  • MATERIAL_TEMPLATE — definitions of information common to groups of materials (referenced all over the place); filename prefix material_template_.
  • MUSIC — assigns music files to background and event music cues, modding currently very limited; filename prefix music_.
  • PALETTE — defines a color palette and associates those colors to an image file containing color swatches; filename prefix palette_.
  • PLANT — definitions of plants, their materials, and their derivatives; filename prefix plant_.
  • REACTION — reactions/custom workshop jobs (turn items into other items through dwarven or adventurer effort); filename prefix reaction_.
  • SOUND — associates sound files with in-game event cues; filename prefix sound_.
  • TEXT_SET — conversation text, mostly used in Adventure mode; ; filename prefix text_. Example: text_dwarf.txt
  • TILE_PAGE — assigns IDs to image files and establishes their parameters for use in GRAPHICS raws; filename prefix tile_page_.
  • TISSUE_TEMPLATE — defines templated tissues for use with BODY_DETAIL_PLAN objects or in creatures; filename prefix tissue_template_.

Usually empty lines are used to divide different types of structures like the file name and [OBJECT:] or different entries, however everything which is not a token besides the 1st string (which is the filename) is understood as comments and is not considered.

The tokens are enclosed in square brackets ([TOKEN:VALUES]).

A list of tokens can be seen at Category:Tokens.

Parsing[edit]

The order that Dwarf Fortress parses raw files in is determined by the first line of the raw file (not necessarily the filename). This parsing order is important for certain tags, such as [COPY_TAGS_FROM], but not for most other tags.

The names of raw files are completely irrelevant - when you create a new creature, you can put it in any file you want (or even in a brand-new file) and the game won't behave any differently. You can even rename all of the existing raw files and the game still won't care (as long as you generate a new world first, of course).

Required objects[edit]

While most of the raw files are replaceable or removable, some contain raw objects that are used by procedurally generated creatures (such as FBs and experiments). Raws with the following IDs must exist, to support those creatures. The file names are where said objects exist by default, but are not important on their own, as long as the objects exist somewhere in the raws the game may use them. This list was compiled by examining the code that emits the various "Cannot generate random creatures -- missing *" error messages.

material_template_default.txt:

SKIN_TEMPLATE
FAT_TEMPLATE
MUSCLE_TEMPLATE
SINEW_TEMPLATE
BONE_TEMPLATE
CARTILAGE_TEMPLATE
HAIR_TEMPLATE
FEATHER_TEMPLATE
SCALE_TEMPLATE
NAIL_TEMPLATE
TOOTH_TEMPLATE
EYE_TEMPLATE
NERVE_TEMPLATE
BRAIN_TEMPLATE
LUNG_TEMPLATE
HEART_TEMPLATE
LIVER_TEMPLATE
GUT_TEMPLATE
STOMACH_TEMPLATE
PANCREAS_TEMPLATE
SPLEEN_TEMPLATE
KIDNEY_TEMPLATE
LEATHER_TEMPLATE
HORN_TEMPLATE
PEARL_TEMPLATE
SILK_TEMPLATE
BLOOD_TEMPLATE
ICHOR_TEMPLATE
GOO_TEMPLATE
SLIME_TEMPLATE
SHELL_TEMPLATE
SOAP_TEMPLATE
TALLOW_TEMPLATE
CHITIN_TEMPLATE
MILK_TEMPLATE
CREATURE_CHEESE_TEMPLATE
STRUCTURAL_PLANT_TEMPLATE
SEED_TEMPLATE
LEAF_TEMPLATE
THREAD_PLANT_TEMPLATE
PLANT_ALCOHOL_TEMPLATE
PLANT_POWDER_TEMPLATE
PLANT_EXTRACT_TEMPLATE
CREATURE_EXTRACT_TEMPLATE
FLAME_TEMPLATE

tissue_template_default.txt:

SKIN_TEMPLATE
FAT_TEMPLATE
MUSCLE_TEMPLATE
BONE_TEMPLATE
SHELL_TEMPLATE
HORN_TEMPLATE
CARTILAGE_TEMPLATE
HAIR_TEMPLATE
CHEEK_WHISKERS_TEMPLATE
CHIN_WHISKERS_TEMPLATE
MOUSTACHE_TEMPLATE
SIDEBURNS_TEMPLATE
EYEBROW_TEMPLATE
EYELASH_TEMPLATE
FEATHER_TEMPLATE
SCALE_TEMPLATE
NAIL_TEMPLATE
CLAW_TEMPLATE
TALON_TEMPLATE
TOOTH_TEMPLATE
EYE_TEMPLATE
NERVE_TEMPLATE
BRAIN_TEMPLATE
LUNG_TEMPLATE
HEART_TEMPLATE
LIVER_TEMPLATE
GUT_TEMPLATE
STOMACH_TEMPLATE
PANCREAS_TEMPLATE
SPLEEN_TEMPLATE
KIDNEY_TEMPLATE
FLAME_TEMPLATE

b_detail_plan_default.txt:

STANDARD_MATERIALS
STANDARD_TISSUES
CHITIN_MATERIALS
CHITIN_TISSUES
FACIAL_HAIR_TISSUES
HEAD_HAIR_TISSUE_LAYERS
FACIAL_HAIR_TISSUE_LAYERS
BODY_HAIR_TISSUE_LAYERS
BODY_FEATHER_TISSUE_LAYERS
VERTEBRATE_TISSUE_LAYERS
EXOSKELETON_TISSUE_LAYERS
STANDARD_HEAD_POSITIONS
HUMANOID_HEAD_POSITIONS
HUMANOID_RIBCAGE_POSITIONS
SHELL_POSITIONS
HUMANOID_RELSIZES

c_variation_default.txt:

STANDARD_BIPED_GAITS
STANDARD_QUADRUPED_GAITS
STANDARD_WALKING_GAITS
STANDARD_CLIMBING_GAITS
STANDARD_SWIMMING_GAITS
STANDARD_CRAWLING_GAITS
STANDARD_FLYING_GAITS
STANDARD_WALK_CRAWL_GAITS

body_rcp.txt:

RCP_BASIC_BODY
RCP_BASIC_BODY_STANCE
RCP_BASIC_BODY_STANCE_WITH_HEAD_FLAG
RCP_UPPER_BODY
RCP_LOWER_BODY
RCP_THORAX
RCP_ABDOMEN
RCP_CEPHALOTHORAX
RCP_HEAD
RCP_NECK
RCP_TWO_PART_ARMS
RCP_PINCERS
RCP_CLAW_ARMS
RCP_FIRST_SIMPLE_LEGS
RCP_FIRST_SIMPLE_LEGS_GRASP
RCP_SECOND_SIMPLE_LEGS
RCP_THIRD_SIMPLE_LEGS
RCP_FOURTH_SIMPLE_LEGS
RCP_FIFTH_SIMPLE_LEGS
RCP_SIMPLE_FRONT_LEGS
RCP_SIMPLE_FRONT_LEGS_GRASP
RCP_SIMPLE_REAR_LEGS
RCP_TWO_PART_LEGS
RCP_FRONT_FLIPPER
RCP_REAR_FLIPPER
RCP_TWO_FLIGHTLESS_WINGS
RCP_TWO_WINGS
RCP_TAIL
RCP_2_TAILS
RCP_3_TAILS
RCP_TAIL_STINGER
RCP_LOWER_BODY_STINGER
RCP_PROBOSCIS
RCP_TRUNK
RCP_SHELL
RCP_ANTENNAE
RCP_1_HEAD_HORN
RCP_2_HEAD_HORNS
RCP_3_HEAD_HORNS
RCP_4_HEAD_HORNS
RCP_LARGE_MANDIBLES
RCP_5_FINGERS
RCP_4_FINGERS
RCP_3_FINGERS
RCP_2_FINGERS
RCP_5_TOES
RCP_4_TOES
RCP_3_TOES
RCP_2_TOES
RCP_5_FRONT_TOES
RCP_4_FRONT_TOES
RCP_3_FRONT_TOES
RCP_2_FRONT_TOES
RCP_5_REAR_TOES
RCP_4_REAR_TOES
RCP_3_REAR_TOES
RCP_2_REAR_TOES
RCP_1_EYE
RCP_2_EYES
RCP_3_EYES
RCP_BEAK
RCP_NOSE
RCP_CHEEKS
RCP_LUNGS
RCP_HEART
RCP_GUTS
RCP_THROAT
RCP_SPINE
RCP_UPPER_SPINE
RCP_BRAIN
RCP_SKULL
RCP_MOUTH
RCP_TEETH
RCP_RIBS
RCP_RIBS_EXTERNAL
RCP_LIPS
RCP_1_EYELID
RCP_2_EYELIDS
RCP_3_EYELIDS
RCP_GLOSS_HOOF
RCP_GLOSS_PAW
RCP_5_FRONT_FINGERS*
RCP_4_FRONT_FINGERS*
RCP_3_FRONT_FINGERS*
RCP_2_FRONT_FINGERS*
RCP_TONGUE*
* - The game does not confirm the presence of these objects, but it will still attempt to use them (and fail if they are missing)

The objects RCP_FORKED_TONGUE, RCP_BILL, and RCP_2_HEAD_ANTLERS are currently not used by the game and can be safely removed.

Examples[edit]