Material Modding
You can add your own textures to be used as wall and floor materials in the game, by defining in a TyD file.
The game will take all the default and your supplied textures and put them in 3 huge texture atlasses, which the game then maps walls and floors to. Note that how many materials you can have in the game depends on the maximum size of textures your GPU supports. If your GPU supports 4k textures, you can have a maximum of (4096^2)/(256^2)=256 materials. This also means additional materials only adds to the loading time of the game and won't affect in-game performance, as all building floors and walls are drawn in 1 single draw call (player chosen colors are also mapped to a global color texture).
Material mod structure
Main structure
You can add your own materials to the game by creating a new folder inside the Materials folder in the root of the game.
Inside your new folder you should add a "materials.tyd" file and all your textures as 256x256 png files. the tyd file should contain a table for each material you want to add.
Materials
Each material will be named after the name of its table. The player will never see this name, but the game uses it for serialization purposes, so you should make the name as unique as possible to avoid overlap. If a material is named the same as another one, it will replace it, which you can use to replace in-game materials.
Each material should have records defining its Category, either Floor, Interior, Exterior, Roof or Path, optional paths to its Base, Bump and Extra textures and optionally a Skirting record which you can use to remove skirtings on interior wall materials using Skirting False.
You can also add an optional FloorType record to floor materials, with the value set to either Wood, Ceramic, Carpet(default) or Concrete, which changes which footstep sound effects to use when employees walk over the floor.
You can also add up to 8 color presets, that makes it easier for the player to pick colors. Just add a list of lists of up to 2 colors each, e.g. Presets [ [ "#FF0000"; "#00FF00" ]; [ "#0000FF"; "FF00FF" ] ]
Finally, to control the second color the player can choose you can either add SecondaryColorEnabled False or SecondaryColorEnabled True and ForcedSecondaryColor #FF00FF.
Material textures
Materials consist of:
- Base texture, which is a texture that can be colored by the player.
- The red channel is the first player mapped color
- The green channel is the optional second player mapped color
- The blue channel should be 0 to enable custom player colors, if blue is > 0 then the color will just be output as is, ignoring any player chosen colors. This can be used to add details like gold adornments.
- Bump texture, which is the normal map. These are usually purple, signifying a direction pointing along the normal of the surface.
- Extra texture. The material uses the 4 color channels of the extra texture to modify the material.
- The red channel controls occlusion, i.e. how dark a material appears, even in direct light, to simulate crevices.
- The green channel controls smoothness/specularity, where 100% green means very shiny.
- The blue channel controls metallic, where 100% blue means completely metallic and reflective. Note that the reflectiveness is limited as the game is simulating this based on the player's graphics settings and does not support RTX
- As of Alpha 10.10, the alpha channel of the Extra texture controls snow and rain.
- 100% alpha or completely opaque means no snow and rain
- 75% alpha means no snow and about 25% rain
- 50% alpha means snow in the middle of winter and about 50% rain
- 0% alpha means 100% rain and snow at the start of winter.
- If you are using Photoshop, it is recommended that you add the alpha channel as a new channel and save your texture using the SuperPNG plugin to avoid alpha channel corruption.
TyD example
CoredumpingBestWall { Category Interior Base base.png Bump bump.png Extra extra.png Skirting False SecondaryColorEnabled False ForcedSecondaryColor #FF0000 } CoredumpingBestFloor { Category Floor Base base.png Bump bump.png Extra extra.png FloorType Ceramic SecondaryColorEnabled True Presets [ [ "#FF0000"; "#00FF00" ] [ "#FFFF00"; "#00FFFF" ] ] }
Texture example
Base texture
The texture can be colored using 2 colors by the player, both for the brick and mortar. The blue channel isn't used, since the texture has no parts that the player can't color.
Bump texture
Extra texture
Note the colors:
- Very low red in the crevices to simulate ambient occlusion.
- 0% green, as this material isn't smooth at all
- 0% blue, as this material isn't metallic/reflective at all
Extra texture alpha
Note how the snow gets added the same way you would use threshold in Photoshop, so you should use gradients to control where snow starts to gather in crevices. The wetness/shininess is faded in as the alpha channel moves from 100% to 0%. The alpha channel never hits 100% as we want it to become wet all over, in rainy conditions, and the crevices are almost completely transparent/black, as snow gathers there initially.