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 Tilesets

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|Exceptional}}
+
{{migrated article}}
{{av}}
+
{{Quality|Unrated}}{{av}}
 
:''(For an overview of graphics in DF, see [[Graphics|Graphics]])''
 
:''(For an overview of graphics in DF, see [[Graphics|Graphics]])''
 
:''(For a chart with the default ASCII characters, see [[Main:Character table|Character table]].)''
 
:''(For a chart with the default ASCII characters, see [[Main:Character table|Character table]].)''
Line 7: Line 7:
 
:''(For information on how tilesets get colored, see [[Color]])''
 
:''(For information on how tilesets get colored, see [[Color]])''
 
----
 
----
 +
 
'''Tilesets''' are images the game uses to display its graphics when "Use Classic ASCII Glyphs" is set to "Yes"; each tile is used to show text and represent things. Users create custom tilesets for a number of reasons, including increased visibility, aesthetics, or small size. Tilesets come in two flavors: "'''character sets'''" (or simply "tilesets") and "'''graphics sets'''". This article is only about tilesets.
 
'''Tilesets''' are images the game uses to display its graphics when "Use Classic ASCII Glyphs" is set to "Yes"; each tile is used to show text and represent things. Users create custom tilesets for a number of reasons, including increased visibility, aesthetics, or small size. Tilesets come in two flavors: "'''character sets'''" (or simply "tilesets") and "'''graphics sets'''". This article is only about tilesets.
  
 
== Overview ==
 
== Overview ==
A character set (or 'tileset') is an image in BMP or PNG format that contains the 256 different tiles (numbered 0-255), corresponding to the [[Main:Character table|IBM Code Page 437]] (sometimes called Extended ASCII), which are used to display all graphics. The tiles are always arranged in a 16×16 grid, but its dimensions can be varied. You can have both square and non-square tiles, with 16x16 pixels being the most common size. (If "Use Classic ASCII Glyphs" is set to "No", the tileset must be 128×192 pixels (tiles 8×12 pixels) in order to render the customs tiles properly. See [[Graphic set]])
 
  
UI scaling will only work if the tileset is 128×192px (8×12px tiles).  
+
A character set (or 'tileset') is an image in BMP or PNG format that contains the 256 different tiles (numbered 0-255), corresponding to the [[Main:Character table|IBM Code Page 437]] (sometimes called Extended ASCII), which are used to display all graphics. 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. (If "Use Classic ASCII Glyphs" is set to "No", the tileset must be 128x192 pixels (tiles 8x12 pixels) in order to render the customs tiles properly. See [[Graphic set]])
  
 
As the tileset is limited to only 256 tiles, some objects share the same tile. Below is a detailed list.
 
As the tileset is limited to only 256 tiles, some objects share the same tile. Below is a detailed list.
Line 23: Line 23:
  
 
=== Creating a custom tileset ===
 
=== Creating a custom tileset ===
Scaling occurs automatically based on the size of the tiles and the window.
+
The gameplay viewport will scale up the tile size when there are more than 191 tiles wide and 71 tiles tall. At least 180 tiles are needed to display the full user interface width.  
The desired grid, interface scaling and percentage settings only work when using 8x12 tiles.
+
 
 +
The desired grid, interface scaling and percentage settings do not apply to tilesets (that is to say when "Use Classic ASCII Glyphs" is set to "Yes"). These are only used for Graphics sets when "Use Classic ASCII Glyphs" is set to "No". (See [[Graphic set]])
  
 
When creating a custom tileset, it's often easiest to start with an existing one, and edit it to your liking. Tilesets generally fall into two categories: rectangular tilesets and square tilesets. Rectangular tilesets have tiles that are taller than they are wide. The text in these tilesets is generally easier to read, but the map appears squished horizontally. Square tilesets usually provide more attractive graphics, but are slightly less readable.  
 
When creating a custom tileset, it's often easiest to start with an existing one, and edit it to your liking. Tilesets generally fall into two categories: rectangular tilesets and square tilesets. Rectangular tilesets have tiles that are taller than they are wide. The text in these tilesets is generally easier to read, but the map appears squished horizontally. Square tilesets usually provide more attractive graphics, but are slightly less readable.  
Line 37: Line 38:
  
 
=== Generating a custom tileset from a font in Linux ===
 
=== Generating a custom tileset from a font in Linux ===
 +
 
In Linux, it is possible to create tileset from a .ttf font programmatically in the terminal. The following command will open a terminal window with your desired font, rendered appropriately for ''Dwarf Fortress'', and screenshots it. It requires xterm, the screenshot utility xwd, and a text file containing the code page 437 characters in the appropriate order.
 
In Linux, it is possible to create tileset from a .ttf font programmatically in the terminal. The following command will open a terminal window with your desired font, rendered appropriately for ''Dwarf Fortress'', and screenshots it. It requires xterm, the screenshot utility xwd, and a text file containing the code page 437 characters in the appropriate order.
  
Line 47: Line 49:
 
<pre>fc-list :scalable=false:spacing=mono family pixelsize</pre>
 
<pre>fc-list :scalable=false:spacing=mono family pixelsize</pre>
  
=== How colors other than white and magenta work ===
+
<!--=== How colors other than white and magenta work ===
 +
 
 
When the game draws a tile, it will select a foreground color, a background color, and a tile based on the item being drawn.  The background color will be used in place of magenta (Hex code #FF00FF or RGB 255 0 255).  All other colors in the tile will be treated as a mask against the foreground color.  Pure white (#FFFFFF) will always show the foreground color, while light grey (#CCCCCC) will be a slightly darker version of the foreground color, and dark grey (#888888) will be a dark version of the foreground color.  Black (#000000) will always be black.  It is impossible to use different shades of the background color.
 
When the game draws a tile, it will select a foreground color, a background color, and a tile based on the item being drawn.  The background color will be used in place of magenta (Hex code #FF00FF or RGB 255 0 255).  All other colors in the tile will be treated as a mask against the foreground color.  Pure white (#FFFFFF) will always show the foreground color, while light grey (#CCCCCC) will be a slightly darker version of the foreground color, and dark grey (#888888) will be a dark version of the foreground color.  Black (#000000) will always be black.  It is impossible to use different shades of the background color.
  
Line 92: Line 95:
 
As illustrated by this example, colors in the tileset can result in colors that aren't in the foreground color or the tile graphic.  In this case, a brown foreground color with a cyan pixel color in the tileset results in a final color of green.
 
As illustrated by this example, colors in the tileset can result in colors that aren't in the foreground color or the tile graphic.  In this case, a brown foreground color with a cyan pixel color in the tileset results in a final color of green.
  
Theoretically, the way the game handles color masks could be used to display different graphics for items that use the same tile (but whose respective colors use different color component channels).  For example, if a bright red object and a bright blue object use the same tile, the tile can use bright red for all pixels that only the red object uses, bright blue for all pixels only the blue object uses, and bright magenta (but NOT #FF00FF, it would have to be #FE00FE or something similar) for all pixels both objects use.  In this fashion the two objects that share a tile would look completely different.  In practice however, this is probably impossible because so many objects share the same tile, the chances of the potential foreground colors sharing a red, green, or blue color component are too great.
+
Theoretically, the way the game handles color masks could be used to display different graphics for items that use the same tile (but whose respective colors use different color component channels).  For example, if a bright red object and a bright blue object use the same tile, the tile can use bright red for all pixels that only the red object uses, bright blue for all pixels only the blue object uses, and bright magenta (but NOT #FF00FF, it would have to be #FE00FE or something similar) for all pixels both objects use.  In this fashion the two objects that share a tile would look completely different.  In practice however, this is probably impossible because so many objects share the same tile, the chances of the potential foreground colors sharing a red, green, or blue color component are too great.-->
  
 
== What tiles are used for what ==
 
== What tiles are used for what ==
* Items marked with * can have their tile changed in the [[modding|raw data]] files. <small>[This list need validating for v0.50]</small>
+
 
 +
* Items marked with * can have their tile changed in the [[modding|raw data]] files.
 
* Items marked with <sup>#</sup> can have their tile replaced by a [[graphic set]] image, in addition to having their tile changed in the raw data.
 
* Items marked with <sup>#</sup> can have their tile replaced by a [[graphic set]] image, in addition to having their tile changed in the raw data.
 
* Items marked with <sup>$</sup> can be changed in the [[d_init.txt]] file.
 
* Items marked with <sup>$</sup> can be changed in the [[d_init.txt]] file.
Line 952: Line 956:
  
 
== Detailed use list by type ==
 
== Detailed use list by type ==
The tile used by each entity is defined in each entity's vanilla object files. These can be overridden by using a mod. (See [[Modding]]) Changing the vanilla files is not recommended.
 
 
 
=== Creatures ===
 
=== Creatures ===
 
==== Main creature tiles ====
 
==== Main creature tiles ====
This is a list of tiles used by [[creature]]s.  
+
This is a list of tiles used by [[creature]]s. In all cases the tile can be changed in the raws, and a graphic can be assigned.
 +
 
 
<small>001</small> {{TST|☺}}
 
<small>001</small> {{TST|☺}}
 
(Civilian) [[dwarves]]
 
(Civilian) [[dwarves]]
Line 1,127: Line 1,130:
 
<small>234</small> {{TST|Ω}}
 
<small>234</small> {{TST|Ω}}
 
[[Sea nettle jellyfish]]
 
[[Sea nettle jellyfish]]
 
 
==== Vermin ====
 
==== Vermin ====
 
These creatures are classified as "vermin" and cannot have their tiles changed.
 
These creatures are classified as "vermin" and cannot have their tiles changed.
Line 1,138: Line 1,140:
  
 
==== Additional Tiles Used by Creatures ====
 
==== Additional Tiles Used by Creatures ====
Some creature specify secondary tiles. They are listed here
+
Some creature raw specify secondary tiles. They are listed here
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,171: Line 1,173:
 
|can be removed, reassigned, or overridden by graphics
 
|can be removed, reassigned, or overridden by graphics
 
|}
 
|}
 
<small> This table needs updating to v0.50 object file specifics </small>
 
  
 
=== Plants ===
 
=== Plants ===
 
==== Trees on map ====
 
==== Trees on map ====
 +
The tiles can all be changed in the raws.
  
 
<small>005</small>&nbsp;{{TST|♣}}
 
<small>005</small>&nbsp;{{TST|♣}}
Line 1,319: Line 1,320:
  
 
==== Grasses ====
 
==== Grasses ====
Most grasses have 4 tiles that are alternatively used.
+
Grass tiles can be changed in the plant raws. Most grasses have 4 tiles that are alternatively used.
  
 
{|
 
{|
Line 1,371: Line 1,372:
  
 
=== Unmined inorganic material ===
 
=== Unmined inorganic material ===
 +
The tiles can all be changed in the raws.
 
==== Stones ====
 
==== Stones ====
 
{|
 
{|
Line 1,506: Line 1,508:
  
 
=== No known use ===
 
=== No known use ===
These are ideal for using to change tiles in a mod.
+
These are ideal for using to change tiles in the raw data or init.txt.
  
 
↕ ∟ ↔ ½ 255
 
↕ ∟ ↔ ½ 255

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 1 hidden category: