Skip to main content

Asset Pipeline Overview

Polygon Engine uses a GUID-based asset pipeline. Source files live under Assets/, imported runtime files live under Library/, and scenes reference imported assets by GUID through Library/asset_db.json.

This split matters for PS1 builds. The editor can keep source files and import settings, while the runtime only receives compact files that are staged into Build/ps1/disc_root/DATA.

Supported Asset Types

CategorySourceImported outputRuntime use
Models.obj, .fbx in Assets/Models/.mshMesh Renderer asset meshes
Skeletal animationhard-skinned .fbx in Assets/Models/.sknAnimator mesh and baked clips
Level Builder meshes.pmsh in Assets/Meshes/.mshReusable editor-authored meshes
Textures.png, .bmp, .tga in Assets/Textures/.texMaterials and UI images
Materials.mat.json in Assets/Materials/material asset entry / staged material dataMesh Renderer materials
Resident audio.wav in Assets/Audio/.vagAudio Source effects and short loops in SPU RAM
Streaming music.wav with Streaming Music (CD-XA) enabled.xa staged during buildGlobal Music playback from CD-ROM
Scripts.lua in Assets/Scripts/validated, precompiled Lua bytecode at build timeLua Behaviour components and UI callbacks

Import Workflow

The pipeline is: source file in Assets -> importer settings and metadata -> compiled file in Library -> GUID reference in scenes and materials -> staged PS1 asset during Build.

  1. Place a source file in the correct Assets/ folder.
  2. The editor creates or updates the source metadata.
  3. For a dense static model, open PS1 Asset Optimizer, review the recommendation, and generate a constrained lower-poly copy.
  4. The import step writes runtime-ready output to Library/.
  5. Library/asset_db.json records the GUID, type, display name, paths, and stats. Import settings and the optimization recipe live in the source .meta.json.
  6. Scene GameObjects reference assets by GUID.
  7. The build pipeline stages only the data needed by the PS1 runtime.

Asset Database

Library/asset_db.json is generated by the editor. Do not hand-edit it during normal work.

Each entry can include:

{
"guid": "a1b2c3d4-...",
"type": "Mesh",
"name": "HallWall",
"path": "Library/meshes/a1b2c3d4-....msh",
"sourcePath": "Assets/Meshes/HallWall.pmsh",
"stats": {
"vertexCount": 128,
"triangleCount": 64,
"fileSize": 4096
}
}

The exact fields vary by asset type.

Reimporting

Use the editor rather than editing generated files:

  1. Select the source asset in the Project panel.
  2. Adjust import settings in the Inspector.
  3. Click Apply, Import, or Reimport depending on the asset type.
  4. Check Problems and PS1 Budget if the asset affects runtime budgets.

Build Staging

During a PS1 build, imported assets are staged into disc-friendly locations such as:

Build/ps1/disc_root/DATA/M/  # meshes
Build/ps1/disc_root/DATA/K/ # skeletal animation assets
Build/ps1/disc_root/DATA/T/ # textures
Build/ps1/disc_root/DATA/R/ # materials
Build/ps1/disc_root/DATA/A/ # audio
Build/ps1/disc_root/DATA/X/ # CD-XA streaming music
Build/ps1/disc_root/DATA/L/ # Lua scripts

The runtime resolves those files through DATA/MANIFEST.JSN.

Production Rule

Treat Assets/ as the source of truth, Library/ as imported cache/output, and Build/ps1/ as disposable generated build output. See Skeletal Animation for the hard-skinned FBX path and Audio Import before deciding whether a WAV should be resident or streamed. The PS1 Asset Optimizer is non-destructive: it preserves the project source model and stores a reproducible optimization recipe in its metadata while replacing only generated output.