Skip to content

Converted content formats

Krzyhau edited this page Aug 8, 2023 · 10 revisions

XNB content files contained within FEZ's .pak archives contain only one resource, which is read by a specific data type reader. In order to make game assets easily editable by modders after unpacking, they're converted into file formats which allow easier manipulation of data they're representing. These file formats are also used to determine what content type should be used when converting a file back into the XNB content file.

File bundle

Some assets are exported to/from multiple files. Files creating a single asset are called a file bundle. Each file in a bundle is has a following naming scheme: [path].[bundle_extension].[file_extension]. For instance, ArtObject has a bundle extension .fezao and exports three file types: OBJ, PNG and JSON. Art object with a name bellao will be saved into three files named bellao.fezao.obj, bellao.fezao.png and bellao.fezao.json.

This naming scheme is also used to identify a conversion format in cases when multiple formats have the same file extension. This way, foo.fezlvl.json will be exported to a level, and foo.fezsong.json will be exported to a tracked song, despite both of them ending up with the same asset name foo.

File formats

Here's a list of all content formats and paired file types.

Texture2D

XNB asset containing primary type of Texture2D stores a 2D texture and is converted into loselessly compressed PNG image file.

AnimatedTexture

XNB asset containing primary type of AnimatedTexture stores an animated texture used mostly by player and NPC sprites. It is converted into an animated GIF by splicing the animation atlas texture into individual frames with alpha channel and giving each of them their defined timing. This process is then reversed when converting it back into XNB file by parsing frame timing and arranging frames into an atlas texture.

Due to GIF's limitation, animated textures can have only 256 unique colors per frame and binary transparency. In the future, I'm planning to re-implement WebP support and leave GIF as a supplementary format for backwards compatibility.

ArtObject

XNB asset containing primary type of ArtObject stores data about in-game models and is converted into file bundle with .fezao bundle extension. The bundle can contain up to four file types:

  • .obj - Wavefront OBJ file containing geometry of the art object.
  • .png - PNG image containing albedo texture for the cubemap of the art object.
  • .apng - PNG image containing emission texture for the cubemap of the art object.
  • .json - additional data of the art object stored in a JSON file.

More information about how each of these files are processed can be found in this wiki page

TrileSet

XNB asset containing primary type of TrileSet stores data about triles (Trixel Engine's tiles in 3D space) and is converted into file bundle with .fezts bundle extension. The bundle can contain up to four file types:

  • .obj - Wavefront OBJ file containing geometry of all triles, separated into groups.
  • .png - PNG image containing albedo texture for the cubemap atlas of the trile set.
  • .apng - PNG image containing emission texture for the cubemap atlas of the trile set.
  • .json - additional data of the trile set stored in a JSON file.

More information about how each of these files are processed can be found in this wiki page

Dictionary[String,Dictionary[String,String]]

This type is primarily used by a language file, which defines dialogues for every language in the game. It's converted into a JSON file with .fezdata.json extension, with each key of dictionaries being a JSON property.

SpriteFont

XNB asset containing primary type of SpriteFont stores data about game's sprite fonts and is converted into a file bundle with .fezfont bundle extension. The bundle contains two file types:

  • .png - PNG image containing texture atlas of all characters.
  • .json - Data containing information about each character included in a texture atlas, stored in a JSON format.

More information about how each of these files are processed can be found in this wiki page

Level

XNB asset containing primary type of Level store all necessary level data and is converted into a JSON file with .fezlvl.json extension. The structure is slightly altered compared to how it's stored in the game. More on that can be read in this wiki page.

MapTree

XNB asset containing primary type of MapTree stores tree of level nodes seen in the map menu, and is converted into a JSON file with .fezmap.json extension. The structure is slightly altered compared to how it's stored in the game. More on that can be read in this wiki page.

NpcMetadata

XNB asset containing primary type of NpcMetadata stores NPC metadata, and is converted into a JSON file with .feznpc.json extension. More on that can be read in this wiki page.

Sky

XNB asset containing primary type of Sky stores NPC metadata, and is converted into a JSON file with .fezsky.json extension. More on that can be read in this wiki page.

TrackedSong

XNB asset containing primary type of TrackedSong stores information on how to play OGG tracks, and is converted into a JSON file with .fezsong.json extension. More on that can be read in this wiki page.

Effect

XNB assets of type Effect are containers for binary XNA effect files, and are saved as such (with .xfb extension).

SoundEffect

XNB assets of type SoundEffect are PCM WAV sound files at its core, and are saved as such (with .wav extension), but several limitations are involved:

  • Because of how XNA reads SoundEffect assets, it is impossible to load sound files which sample bit resolution isn't divisible by 16 without it being corrupted on playback. Make sure your sound files are not, for instance, 24-bit.
  • Any other additional data which isn't a part of canonical WAVE file format is ignored.