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}} | ||
− | |||
:{{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]]}} | ||
:{{for/see|details on creating Classic tilesets|[[Tileset repository]]}} | :{{for/see|details on creating Classic tilesets|[[Tileset repository]]}} | ||
− | |||
− | = Premium Graphics = | + | The new graphics system in v50 is still being reverse engineered. It is a custom solution which appears to involve compositing graphics sets directly in C++ before texmapping them to SDL. This blitting approach is software rendered and so largely doesn't use hardware acceleration on graphics cards. This system means that despite graphics sets supporting rudimentary animation, there is no traditional sprite mapping, which places extensive limits on the types of graphics that are possible. While the number of user editable graphics sets has increased significantly in v50, many game elements are still hard coded graphics sets, or using a tileset over the older style graphics from classic DF. |
+ | |||
+ | == Premium Graphics == | ||
:{{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]]}} | ||
Line 20: | Line 20: | ||
− | == Tile Page == | + | === Tile Page === |
Tile pages link image files to a tile page token so they can be referenced by the graphics file. Just like all other [[Raw file]]s, Tile Pages must be defined from within a properly named "tile_page_<name>.txt" file and follow: | Tile pages link image files to a tile page token so they can be referenced by the graphics file. Just like all other [[Raw file]]s, Tile Pages must be defined from within a properly named "tile_page_<name>.txt" file and follow: | ||
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 | + | * 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 === | |
Creature graphics are found within graphics_creature_x files (such as graphics_creature_domestic or graphics_creature_layered). All graphics files must begin with the file name, followed by the <code>[OBJECT:GRAPHICS]</code> token that tells the game that the file contains graphics definitions. | Creature graphics are found within graphics_creature_x files (such as graphics_creature_domestic or graphics_creature_layered). All graphics files must begin with the file name, followed by the <code>[OBJECT:GRAPHICS]</code> token that tells the game that the file contains graphics definitions. | ||
− | === Basic Graphics === | + | ==== Basic Graphics ==== |
The most basic form of creature graphics is a single tile, defined below: | The most basic form of creature graphics is a single tile, defined below: | ||
[CREATURE_GRAPHICS:<creature id>] | [CREATURE_GRAPHICS:<creature 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>] | ||
− | * ''[[ | + | * ''[[#Condition|condition]]'': The condition the creature needs to be in for this image to be displayed. Use <code>DEFAULT</code> for generic graphics. |
* ''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 | + | * ''[[#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 ( | + | * ''x position'': The x position of the graphic to be displayed in tiles counting from 0 (left→right). |
− | * ''y position'': The y position of the graphic to be displayed in tiles counting from 0 ( | + | * ''y position'': The y position of the graphic to be displayed in tiles counting from 0 (top→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}} | ||
− | * ''[[ | + | * ''[[#Condition|secondary condition]]'': (optional) An additional condition that must be satisfied for the image to be displayed. |
When the condition {{token|DEFAULT|g}} is used, this graphic will be displayed for the creature in all conditions unless additional, more specific conditions are also defined. | When the condition {{token|DEFAULT|g}} is used, this graphic will be displayed for the creature in all conditions unless additional, more specific conditions are also defined. | ||
− | + | ||
− | Different graphics can be defined for the same creature based on some properties about it. Below is a list of the most common creature conditions tokens. | + | ===== Basic Conditions ===== |
+ | Different graphics can be defined for the same creature based on some properties about it. Below is a list of the most common creature conditions tokens. Here is the full list of known [[#Conditions:Graphics Token|Creature Condition Tokens]]. | ||
{| {{prettytable}} | {| {{prettytable}} | ||
Line 90: | Line 91: | ||
− | === Caste Graphics === | + | ==== Caste Graphics ==== |
− | Creature caste graphics allow a simple alternative to [[#Layered Graphics|Layered Graphics]] to represent males and females | + | 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 98: | Line 99: | ||
* All other parameters are identical to [[#Basic Graphics|basic graphics]]. | * All other parameters are identical to [[#Basic Graphics|basic graphics]]. | ||
− | === Large 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 ==== | ||
The only difference between graphics for large creatures and small creatures is the addition of <code>LARGE_IMAGE</code> and additional coordinates to the line below: | The only difference between graphics for large creatures and small creatures is the addition of <code>LARGE_IMAGE</code> and additional coordinates to the line below: | ||
[<condition>:<tile page identifier>:LARGE_IMAGE:<x1>:<y1>:<x2>:<y2>:<color type>:<secondary condition>] | [<condition>:<tile page identifier>:LARGE_IMAGE:<x1>:<y1>:<x2>:<y2>:<color type>:<secondary condition>] | ||
Line 112: | Line 116: | ||
− | === Statue Graphics === | + | ==== Statue Graphics ==== |
Statue graphics are the generic images placed on top of a pedestal whenever a creature is the primary subject of a statue. The image is implied to occupy multiple tiles, and all examples in vanilla are 1x2 vertical rectangles. Statue graphics are defined as below: | Statue graphics are the generic images placed on top of a pedestal whenever a creature is the primary subject of a statue. The image is implied to occupy multiple tiles, and all examples in vanilla are 1x2 vertical rectangles. Statue graphics are defined as below: | ||
[STATUE_CREATURE_GRAPHICS:<creature id>] | [STATUE_CREATURE_GRAPHICS:<creature id>] | ||
Line 124: | Line 128: | ||
− | === Layered Graphics === | + | ==== Layered Graphics ==== |
− | Layered graphics are a method for displaying overlapping body parts, equipment, clothing, professions, hairstyles.. etc. They allow much more freedom in conditions than normal [[# | + | Layered graphics are a method for displaying overlapping body parts, equipment, clothing, professions, hairstyles.. etc. They allow much more freedom in conditions than normal [[#Creature Graphics|Creature Graphics]], and they allow combinations of many graphical variations within the same creature to give your graphics more personality and display more information about the individuals. All layered graphics started as shown below: |
[CREATURE_GRAPHICS:<creature id>] | [CREATURE_GRAPHICS:<creature id>] | ||
[LAYER_SET:<condition>] | [LAYER_SET:<condition>] | ||
* ''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. | ||
− | * ''[[ | + | * ''[[#Condition|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 | + | * ''layer name'': The internal name of the layer. No known function at this time, but using a descriptive label is recommended. |
− | * ''[[#Tile | + | * ''[[#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 ( | + | * ''x position'': The x position of the graphic to be displayed in tiles counting from 0 (left→right). |
− | * ''y position'': The y position of the graphic to be displayed in tiles counting from 0 ( | + | * ''y position'': The y position of the graphic to be displayed in tiles counting from 0 (top→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}} | ||
− | * ''[[ | + | * ''[[#Layered Conditons:Grahpics token|layer condition(s)]]'': One or more conditional tokens that define under what conditions the layer is displayed and how it interacts with other layers. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | === Forgotten Beast Graphics === | + | ==== Forgotten Beast Graphics ==== |
Forgotten beast graphics define layered graphics based on which body parts are present in each procedurally-generated forgotten beast. | Forgotten beast graphics define layered graphics based on which body parts are present in each procedurally-generated forgotten beast. | ||
Line 174: | Line 166: | ||
There is not currently a way to use procedurally defined graphics like this for non-{{token|FEATURE_BEAST|c}} creatures.{{verify}} | There is not currently a way to use procedurally defined graphics like this for non-{{token|FEATURE_BEAST|c}} creatures.{{verify}} | ||
− | == 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. | ||
− | |||
− | |||
− | + | == Classic Graphics == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{old}} | {{old}} | ||
:{{for/see|a list of all tile characters used in DF|[[Tilesets]]}} | :{{for/see|a list of all tile characters used in DF|[[Tilesets]]}} | ||
Line 249: | Line 188: | ||
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 | + | 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. | ||
Line 287: | Line 226: | ||
Replace font.ttf in data/art with your new font. | Replace font.ttf in data/art with your new font. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
{{Category|Modding}} | {{Category|Modding}} | ||
− | |||
{{Category|Interface}} | {{Category|Interface}} |