Prisma Engine manages all runtime content through a centralizedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Excurs1ons/PrismaEngine/llms.txt
Use this file to discover all available pages before exploring further.
AssetManager. It provides thread-safe loading, reference-counted caching, and a pluggable serialization layer that supports human-readable JSON and compact Base64+zstd binary formats. Every asset type inherits from a common Asset base class, keeping resource lifetime consistent across the engine.
AssetManager overview
AssetManager lives in src/engine/core/AssetManager.* and is owned by the engine core. It maintains a cache keyed by asset path; subsequent Load calls for the same path return the cached instance without re-reading the file.
All loads are thread-safe. You can issue asset requests from worker threads;
AssetManager serializes access to the internal cache with a shared mutex.Asset types
TextureAsset
Loads image data via
stb_image. Supports PNG, JPEG, BMP, TGA, and HDR. The decoded pixel buffer is passed directly to IResourceFactory::CreateTexture on the active render backend.MeshAsset
Holds vertex and index buffers for 3D geometry. Serializable to both JSON and binary formats.
TilemapAsset
Parses TMX files produced by the Tiled map editor via
tinyxml2. Stores tile layers, object groups, and tileset references.CubemapTextureAsset
Six-face texture used for skyboxes and environment reflections. Each face is loaded as a separate
TextureAsset slice and combined at upload time.Serialization formats
The engine serialization system is built around two abstract archive types —OutputArchive / InputArchive — with concrete implementations for JSON and binary.
| Format | Archive classes | Use case |
|---|---|---|
| JSON | JsonOutputArchive / JsonInputArchive | Authoring, debugging, editor round-trips |
| Binary | BinaryOutputArchive / BinaryInputArchive | Shipping builds; ~60% smaller, faster I/O |
zstd. TMX tilemaps are always read as XML via tinyxml2 and converted internally.
Serializable interface
Every asset implements theSerializable interface:
Asset (which already extends IResource and Serializable), then implement both virtual methods:
Loading and saving assets
Using AssetSerializer directly
Android asset loading
On Android, assets are read viaAAssetManager. The pattern mirrors the desktop API:
projects/android/PrismaAndroid/app/src/main/assets/.
Versioning
The serialization system embeds a version header in every file:Error handling
HotReloadManager
HotReloadManager watches asset directories for file changes and triggers a reload of the affected Asset instances without restarting the engine. It is intended for editor and debug builds; enable it alongside PRISMA_ENABLE_IMGUI_DEBUG.
Resource placement guidelines
| Resource category | Location |
|---|---|
| Common assets (all platforms) | resources/common/ |
| Platform-specific runtime assets | resources/runtime/{platform}/ |
| Editor-only assets | resources/editor/ |
| Android runtime assets | projects/android/PrismaAndroid/app/src/main/assets/ |