This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Assets

Game data stored on the disk.

Assets are classified as either Primitive or Aggregate. Primitive assets MUST contain only information about themselves, while aggregate assets MAY contain references to other assets.

Planned primitives:

  • Image
  • Mesh
  • Audio
  • Input action map
  • Shader

Planned aggregates:

  • Material (shader + images)
  • Model (mesh + materials)
  • Construct (fixed-length transform hierarchy)
  • Level

File format

This section is a work in progress. I plan to use Concise Binary Object Representation (CBOR) for serialization, as it provides some desired attributes to the asset files:

  • Named fields to avoid data loss when struct definitions change
  • Small file size
  • Existing Odin core library

File loading

Inspiration from Timothy Cain’s video, Arcanum “dat” files, development builds use a raw OS file system, release builds use packed bundles.

  • data locality on the disk
  • “seek” is much faster than “open”
  • avoid file descriptor limits
  • less overhead for many tiny assets (block alignment, OS file nodes)
  • easy patches/modding with sequential overriding of the asset database
  • more efficient compression

1 - Mesh

A primitive asset for storing vertex data.

Mesh overview

Mesh assets store an object’s vertex data, and how the vertices are connected to form triangles.

This page is currently being rewritten to support the new asset format.

2 - Material

An aggregate asset to describe how meshes are rendered.

WIP

Materials are an asset that associate a Shader with properties such as Textures and number values.