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.

Editing Graphics

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

If you are creating a redirect to the current version's page, do not use any namespace. For example: use #REDIRECT [[Cat]], not #REDIRECT [[Main:Cat]] or #REDIRECT [[cv:Cat]]. See DF:Versions for more information.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
{{Quality|Unrated}}{{av}}
 
{{Quality|Unrated}}{{av}}
[[File:graphics_v50_preview.png|209px|right]]
+
[[File:graphics_v50_preview.png|211px|right]]
 
:{{for/see|a list of all Premium graphics tokens and basic usage|[[Graphics token]]}}
 
:{{for/see|a list of all Premium graphics tokens and basic usage|[[Graphics token]]}}
 
:{{for/see|a repository of all Classic tilesets used in DF|[[Tileset repository]]}}
 
:{{for/see|a repository of all Classic tilesets used in DF|[[Tileset repository]]}}
Line 42: Line 42:
  
 
Known issues:
 
Known issues:
* Currently it is only recommended to use <code>[TILE_DIM:32:32]</code> as only the upper left 32×32 pixels are displayed on tiles defined larger, and smaller tiles are displayed starting from the upper left of each in-game square (individually by tile with large graphics) rather than centered and bottom justified as might be expected.
+
* Currently it is only recommended to use <code>[TILE_DIM:32:32]</code> as only the upper left 32x32 pixels are displayed on tiles defined larger, and smaller tiles are displayed starting from the upper left of each in-game square (individually by tile with large graphics) rather than centered and bottom justified as might be expected.
 
* It is important that the <code>[PAGE_DIM_PIXELS:<x dim>:<y dim>]</code> matches the size of the referenced image exactly - as the game will stretch tile pages with a dimension larger than the actual image by inserting blank lines, and a tile page smaller than the image will cause a crash to desktop.
 
* It is important that the <code>[PAGE_DIM_PIXELS:<x dim>:<y dim>]</code> matches the size of the referenced image exactly - as the game will stretch tile pages with a dimension larger than the actual image by inserting blank lines, and a tile page smaller than the image will cause a crash to desktop.
 +
  
 
== Creature Graphics ==
 
== Creature Graphics ==
Line 57: Line 58:
 
* ''creature id'': The [[Creature token|Creature ID]] of the creature the graphics represent.
 
* ''creature id'': The [[Creature token|Creature ID]] of the creature the graphics represent.
 
* ''[[#Tile Page|tile page identifier]]'': The Internal ID of the image defined in the Tile Page.
 
* ''[[#Tile Page|tile page identifier]]'': The Internal ID of the image defined in the Tile Page.
* ''x position'': The x position of the graphic to be displayed in tiles counting from 0 (left→right).
+
* ''x position'': The x position of the graphic to be displayed in tiles counting from 0 (left&rarr;right).
* ''y position'': The y position of the graphic to be displayed in tiles counting from 0 (top→bottom).
+
* ''y position'': The y position of the graphic to be displayed in tiles counting from 0 (top&rarr;bottom).
 
* ''color type'': (optional) Uncertain function, frequently replaced with <code>AS_IS</code> in vanilla [[Raw|RAW]]s. ColorTypeEnum{{cite|DF language server|https://gitlab.com/df-modding-tools/df-raw-language-server/-/blob/dev/df_ls_structure/src/objects/graphics.rs}}
 
* ''color type'': (optional) Uncertain function, frequently replaced with <code>AS_IS</code> in vanilla [[Raw|RAW]]s. ColorTypeEnum{{cite|DF language server|https://gitlab.com/df-modding-tools/df-raw-language-server/-/blob/dev/df_ls_structure/src/objects/graphics.rs}}
 
* ''[[Graphics_token#Basic_Conditions|secondary condition]]'': (optional) An additional condition that must be satisfied for the image to be displayed.
 
* ''[[Graphics_token#Basic_Conditions|secondary condition]]'': (optional) An additional condition that must be satisfied for the image to be displayed.
Line 91: Line 92:
  
 
=== Caste Graphics ===
 
=== Caste Graphics ===
Creature caste graphics allow a simple alternative to [[#Layered Graphics|Layered Graphics]] to represent males and females (or other castes) of a creature with different images.
+
Creature caste graphics allow a simple alternative to [[#Layered Graphics|Layered Graphics]] to represent males and females of a creature with different images.
 
  [CREATURE_CASTE_GRAPHICS:<creature id>:<caste id>]
 
  [CREATURE_CASTE_GRAPHICS:<creature id>:<caste id>]
 
     [<condition>:<tile page identifier>:<x position>:<y position>:<color type>:<secondary condition>]
 
     [<condition>:<tile page identifier>:<x position>:<y position>:<color type>:<secondary condition>]
Line 97: Line 98:
 
* ''caste id'': The [[Caste|Caste ID]] of the caste whose graphics are being defined.
 
* ''caste id'': The [[Caste|Caste ID]] of the caste whose graphics are being defined.
 
* All other parameters are identical to [[#Basic Graphics|basic graphics]].
 
* All other parameters are identical to [[#Basic Graphics|basic graphics]].
 +
 +
Creature caste graphics only accept <code>MALE</code> and <code>FEMALE</code> as caste id's even in creatures that have more than two castes.
 +
  
 
=== Large Graphics ===
 
=== Large Graphics ===
Line 130: Line 134:
  
 
* ''creature id'': The [[Creature token|Creature ID]] of the creature the graphics represent.
 
* ''creature id'': The [[Creature token|Creature ID]] of the creature the graphics represent.
* ''[[Graphics_token#LAYER_SET|condition]]'': The condition the creature needs to be in for this set of layers to be displayed.
+
* ''[[Graphics_token#Basic_Conditions|condition]]'': The condition the creature needs to be in for this set of layers to be displayed.
  
 
Once you start defining a Layer Set, you can begin adding individual layers from the bottom up to create your final image. For example, if you want to draw a helmet being worn on a head, you would define the head layer first, then define the helmet layer. Layers are defined according to this format:
 
Once you start defining a Layer Set, you can begin adding individual layers from the bottom up to create your final image. For example, if you want to draw a helmet being worn on a head, you would define the head layer first, then define the helmet layer. Layers are defined according to this format:
Line 137: Line 141:
 
  [<layer condition(s)>]
 
  [<layer condition(s)>]
  
* ''layer name'': The internal name of the layer. Does not need to be unique. No known function at this time, but using a descriptive label is recommended.  
+
* ''layer name'': The internal name of the layer. No known function at this time, but using a descriptive label is recommended.
 
* ''[[#Tile Page|tile page identifier]]'': The Internal ID of the image defined in the Tile Page.
 
* ''[[#Tile Page|tile page identifier]]'': The Internal ID of the image defined in the Tile Page.
* ''x position'': The x position of the graphic to be displayed in tiles counting from 0 (left→right).
+
* ''x position'': The x position of the graphic to be displayed in tiles counting from 0 (left&rarr;right).
* ''y position'': The y position of the graphic to be displayed in tiles counting from 0 (top→bottom).
+
* ''y position'': The y position of the graphic to be displayed in tiles counting from 0 (top&rarr;bottom).
 
* ''[[#Large Graphics|LARGE_IMAGE]]:x1:y1:x2:y2'': (optional) Allows a multiple tile image to be displayed. Replaces <x position>:<y position>.
 
* ''[[#Large Graphics|LARGE_IMAGE]]:x1:y1:x2:y2'': (optional) Allows a multiple tile image to be displayed. Replaces <x position>:<y position>.
 
* ''color type'': (optional) Uncertain function, frequently replaced with <code>AS_IS</code> in vanilla [[Raw|RAW]]s. ColorTypeEnum{{cite|DF language server|https://gitlab.com/df-modding-tools/df-raw-language-server/-/blob/dev/df_ls_structure/src/objects/graphics.rs}}
 
* ''color type'': (optional) Uncertain function, frequently replaced with <code>AS_IS</code> in vanilla [[Raw|RAW]]s. ColorTypeEnum{{cite|DF language server|https://gitlab.com/df-modding-tools/df-raw-language-server/-/blob/dev/df_ls_structure/src/objects/graphics.rs}}
 
* ''[[Graphics_token#Layered_Conditions|layer condition(s)]]'': One or more conditional tokens that define under what conditions the layer is displayed and how it interacts with other layers.
 
* ''[[Graphics_token#Layered_Conditions|layer condition(s)]]'': One or more conditional tokens that define under what conditions the layer is displayed and how it interacts with other layers.
  
====Portraits====
 
 
96x96 portraits{{version|50.13}} are shown in [[Adventure mode]] and when viewing a creature's sheet. They use the same tokens as layered graphics to display a more detailed view of a creature.
 
 
A single-layer portrait can be added to a [CREATURE_GRAPHICS] entry with this format:
 
 
  [LAYER_SET:PORTRAIT]
 
    [LAYER_GROUP]
 
    [LAYER:MAIN:<tile page id>:<x position>:<y position>]
 
    [END_LAYER_GROUP]
 
 
See above for the explanation of each argument.
 
  
 
=== Forgotten Beast Graphics ===
 
=== Forgotten Beast Graphics ===
Line 176: Line 168:
 
== Item Graphics ==
 
== Item Graphics ==
 
Item graphics can also be defined, but are mostly hardcoded. This section of the wiki needs to be fleshed out.
 
Item graphics can also be defined, but are mostly hardcoded. This section of the wiki needs to be fleshed out.
 
== Workshop Graphics ==
 
Workshop graphics are displayed during each stage of construction and when it is completed. There are two layers, the base layer and an OVERLAY layer. The base layer shows the floor, tables, chairs and other basic features. The overlay shows various decorations that give the workshop its unique appearance.
 
 
base layer:
 
    [TILE_GRAPHICS:<tile page identifier>:<graphic tile x position>:<graphic tile y position>:WORKSHOP_CUSTOM:<workshop id>:<building stage>:<workshop tile x position>:<workshop tile y position>]
 
overlay layer:
 
    [TILE_GRAPHICS:<tile page identifier>:<graphic tile x position>:<graphic tile y position>:WORKSHOP_CUSTOM_OVERLAY:<workshop id>:<building stage>:<workshop tile x position>:<workshop tile y position>]
 
 
* ''[[#Tile Page|tile page identifier]]'': The Internal ID of the image defined in the Tile Page.
 
* ''graphic tile x position'': The x position of the graphic in tiles counting from 0 (left→right).
 
* ''graphic tile y position'': The y position of the graphic in tiles counting from 0 (top→bottom).
 
* ''WORKSHOP_CUSTOM'' and ''WORKSHOP_CUSTOM_OVERLAY'': These tokens define the graphics as belonging to a custom workshop. These tokens do not exist in vanilla workshops except for the Soap maker and Screw press, which are used as examples for custom workshops.
 
* ''workshop id'': The ID of the workshop defined in its raws.
 
* ''building stage'': What building stage this graphic is displayed during.
 
* ''workshop tile x position'': The x position of the workshop tile where the graphic is displayed counting from 0 (left→right).
 
* ''workshop tile y position'': The y position of the workshop tile where the graphic is displayed counting from 0(top→bottom).
 
 
Note that an extra Y row is defined above the workshop. This allows for graphics that extend into the tile above the workshop.
 
 
Also note that currently custom furnaces do not properly work with premium graphics. The WORKSHOP_CUSTOM and WORKSHOP_CUSTOM_OVERLAY tokens ONLY work with custom workshops. If used with a custom furnace they give an error and the graphics will not appear in game. Custom furnaces can still be made to use graphics if they are defined as workshops in their raws.
 
 
These values can be validated by checking the RAW vanilla file <code>[DF Installion]\data\vanilla\vanilla_buildings_graphics\graphics\graphics_workshops.txt</code>
 
  
  
Line 208: Line 177:
  
 
* ''[[#Tile Page|tile page identifier]]'': The Internal ID of the image defined in the Tile Page.
 
* ''[[#Tile Page|tile page identifier]]'': The Internal ID of the image defined in the Tile Page.
* ''x position'': The x position of the graphic to be displayed in tiles counting from 0 (left→right).
+
* ''x position'': The x position of the graphic to be displayed in tiles counting from 0 (left&rarr;right).
* ''y position'': The y position of the graphic to be displayed in tiles counting from 0 (top→bottom).
+
* ''y position'': The y position of the graphic to be displayed in tiles counting from 0 (top&rarr;bottom).
 
* ''graphic id'': The [[Graphics_token#World_Map_Graphics|Graphic Token]] of the world map tile the graphics represent.
 
* ''graphic id'': The [[Graphics_token#World_Map_Graphics|Graphic Token]] of the world map tile the graphics represent.
 
* ''variation {1 - 5}'': For Graphic IDs that allow variants.
 
* ''variation {1 - 5}'': For Graphic IDs that allow variants.
  
 
These values can be validated by checking the RAW vanilla file <code>[DF Installion]\data\vanilla\vanilla_world_map\graphics\graphics_world_map.txt</code>
 
These values can be validated by checking the RAW vanilla file <code>[DF Installion]\data\vanilla\vanilla_world_map\graphics\graphics_world_map.txt</code>
 
== Palettes ==
 
[[File:palettes_v50.png|right]]
 
 
Palettes are used by [[graphics]] to render colorized objects. This is usually based on [[Material definition token#STATE_COLOR|material colors]], though arbitrary palettes{{version|50.13}} can be created and applied with {{token|USE_PALETTE|g}}.
 
 
    [PALETTE:<palette identifier>]
 
        [FILE:images/imagename.png]
 
        [PALETTE_DEFAULT:<row>] this is the one used in the images themselves
 
        [PALETTE_COLOR:<color>:<row>]
 
 
* ''name'': The Internal ID being created for the image. DEFAULT is used by most objects and requires a PALETTE_COLOR entry for each [[Descriptor color token|raw-defined color]] that exists.
 
* ''imagename.png'': The file name of the 8bit RGBA (sometimes called 32bit) in the <code>\graphics\images</code> folder of the mod.
 
* ''row'': The y position of the graphic to be displayed in pixels counting from 0 (top→bottom). It is customary to place the default palette at 0.
 
* ''color'': A [[Color#Color tokens|color]] token.
 
 
The PALETTE_DEFAULT row is what colors are used to draw the internal graphics (which are loaded by a tile page). It isn't shown in-game, but the exact RGB values are replaced by the row specified by <code>[PALETTE_COLOR]</code> or {{token|USE_PALETTE|g}}.
 
  
 
= Classic Graphics =
 
= Classic Graphics =
Line 249: Line 201:
 
The main tileset (also called 'character set' or just 'tileset') is an image in BMP or PNG format that contains the 256 different tiles, corresponding to the [[Main:character table|IBM Code Page 437]], which are used to display all objects, creatures, and UI elements in game. The tiles are always arranged in a 16x16 grid, but its dimensions can be varied. You can have both square and non-square tiles, with 16x16 pixels being the most common size. Creatures are displayed as [[Tilesets#Main_creature_tiles|colored letters]] (a white 'B' is a [[polar bear]], a brown 'd' a [[dog]], and a grey 'c' is a [[cat]]).
 
The main tileset (also called 'character set' or just 'tileset') is an image in BMP or PNG format that contains the 256 different tiles, corresponding to the [[Main:character table|IBM Code Page 437]], which are used to display all objects, creatures, and UI elements in game. The tiles are always arranged in a 16x16 grid, but its dimensions can be varied. You can have both square and non-square tiles, with 16x16 pixels being the most common size. Creatures are displayed as [[Tilesets#Main_creature_tiles|colored letters]] (a white 'B' is a [[polar bear]], a brown 'd' a [[dog]], and a grey 'c' is a [[cat]]).
  
As the tileset is limited to only 256 tiles, some objects share the same tile. Most notably, even with upper and lower case letters and 16 colors, a lot of creatures still look identical (goblin, goat, various gibbons, gremlin, goose, etc.). The tile for bins, up/down stairs and the cursor are the same; bags use the same tile as the symbol for "male"; and the "female" symbol shares a graphic with amulets. Roads and large rivers on the world map, minecart tracks and walls all share the same tiles as well.
+
As the tileset is limited to only 256 tiles, some objects share the same tile. Most notably, even with upper and lower case letters and 16 colors, a lot of creatures still look identical (goblin, goat, various gibbons, gremlin, goose, etc). The tile for bins, up/down stairs and the cursor are the same; bags use the same tile as the symbol for "male"; and the "female" symbol shares a graphic with amulets. Roads and large rivers on the world map, minecart tracks and walls all share the same tiles as well.
  
 
Some of those can be changed in the raws and init files, and creatures can have separate graphics, but in most cases they are hardcoded.
 
Some of those can be changed in the raws and init files, and creatures can have separate graphics, but in most cases they are hardcoded.

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

This page is a member of 3 hidden categories: