Skip to content

Sprites and atlases

Tirlititi edited this page Aug 14, 2024 · 4 revisions

Sprites are generally packed within "atlas files", which consists of an image that contains multiple sprites together with informations about each sprite's location on this image and other properties.

Atlas modding

Atlases are made so that many sprites are contained inside single assets, but it can be problematic to replace the whole atlas texture when one wants to mod only specific sprites. Thus, in a mod folder, one can provide a TPSHEET file specifying which sprites of the atlas are modded. When doing so, the texture is not required to contain the duplicate of all the other sprites of the atlas.

TPSHEET files can also define new sprites that don't exist in the vanilla atlas (like adding more item icons without replacing existing ones).

When an atlas texture is provided without a TPSHEET file, it should contain the sprites of all the original atlas at their original locations.

TPSHEET files must be placed next to their related atlas with the same filename as them but with the extension .tpsheet. For example, {ModFolder}/EmbeddedAsset/UI/Atlas/Icon Atlas.tpsheet is the TPSHEET describing what the mod does to the Icon Atlas sprites.

They are text files that should look like that:

:format=40000
:size=XxY
:append=true
sprite_name;X;Y;WIDTH;HEIGHT;PIVOT_X;PIVOT_Y
sprite_name;X;Y;WIDTH;HEIGHT;PIVOT_X;PIVOT_Y;PADDING_LEFT;PADDING_RIGHT;PADDING_TOP;PADDING_BOT;BORDER_LEFT;BORDER_RIGHT;BORDER_TOP;BORDER_BOT
... where each line after the header should contain a (lower-case) sprite_name followed by the numerical properties of the corresponding sprite. The padding and border values are optional but you must specify them all as soon as one of them is specified.

The coordinates X and Y is the position of the top-left corner of the sprite.

For example, the following image and TPSHEET replaces the item icon of the Dagger (item01_00, so replacing the normal Dagger's colour scheme) and create a new colour variant for the Hammer (item00_01: the colour variant _01 is usually used for variations with golden colours). The texture Icon Atlas contains both new icons side by side and the corresponding Icon Atlas.tpsheet consists of these lines:

:format=40000
:append=true
item00_01;0;0;64;64;0;0
item01_00;64;0;64;64;0;0

The original atlas name must be used (case insensitive) but since you can now use .png on modded atlases, you have the keep the full name with extension before extension .tpsheet. e.g. General Atlas.png -> General Atlas.png.tpsheet

The easiest way to start is to activate graphics export and you'll have a base. In Memoria.ini, in the section [export], set the options Enabled to 1 and Graphics to 1, then launch the game once: everything will be saved in {Game folder}/StreamingAssets/UI/. Next you'll have to place modded versions of these atlases in the correct folders in your mod.

List of Atlases

Archive Atlas path Description Sprite samples
sharedassets2 EmbeddedAsset/EndGame/card_image Blackjack menu
sharedassets2 EmbeddedAsset/QuadMist/Atlas/quadmist_image0 Tetra Master generic UI
sharedassets2 EmbeddedAsset/QuadMist/Atlas/quadmist_image1 Tetra Master cards
sharedassets2 EmbeddedAsset/QuadMist/Atlas/quadmist_text_it Written Tetra Master messages (italian)
sharedassets2 EmbeddedAsset/QuadMist/Atlas/quadmist_text_us Written Tetra Master messages (US english)
resources EmbeddedAsset/QuadMist/Atlas/quadmist_text_uk Written Tetra Master messages (UK english)
resources EmbeddedAsset/QuadMist/Atlas/quadmist_text_es Written Tetra Master messages (spanish)
resources EmbeddedAsset/QuadMist/Atlas/quadmist_text_fr Written Tetra Master messages (french)
resources EmbeddedAsset/QuadMist/Atlas/quadmist_text_gr Written Tetra Master messages (german)
resources EmbeddedAsset/QuadMist/Atlas/quadmist_text_jp Written Tetra Master messages (japanese)
sharedassets2 EmbeddedAsset/UI/Atlas/Gray Atlas Gray "normal" interface
sharedassets2 EmbeddedAsset/UI/Atlas/Blue Atlas Blue "classic" interface
sharedassets2 EmbeddedAsset/UI/Atlas/Chocograph Atlas Chocograph menu
sharedassets2 EmbeddedAsset/UI/Atlas/Ending Text US JP GR Atlas Written messages at the game's ending
resources EmbeddedAsset/UI/Atlas/Ending Text FR IT ES Atlas Written messages at the game's ending
sharedassets2 EmbeddedAsset/UI/Atlas/Face Atlas Playable character portraits
sharedassets2 EmbeddedAsset/UI/Atlas/General Atlas Diverse UI elements
sharedassets2 EmbeddedAsset/UI/Atlas/Icon Atlas Icons and buttons
sharedassets2 EmbeddedAsset/UI/Atlas/Screen Button Atlas Diverse UI elements
sharedassets2 EmbeddedAsset/UI/Atlas/Movie Gallery Atlas Cinematic previews
sharedassets2 EmbeddedAsset/UI/Atlas/TutorialUI Atlas Tutorial windows