Skip to content

Epic: Asset Management #428

@tyevco

Description

@tyevco

Overview

Create a centralized asset management system for loading, caching, and lifecycle management of game resources. Handles textures, audio, models, animations, and custom asset types.

Why Asset Management?

Currently, each plugin loads resources directly:

  • Graphics: graphics.CreateTexture(path)
  • Audio: audio.LoadClip(path)
  • Animation: Load clips manually

Problems:

  • Duplicate loading (same texture loaded twice)
  • No reference counting (when to unload?)
  • No async loading (frame hitches)
  • No hot-reload support

Architecture

KeenEyes.Assets/                    # Single project
├── Core/                           # AssetManager, handles
├── Loaders/                        # Type-specific loaders
├── Caching/                        # Reference counting, LRU
└── Pipeline/                       # Async loading, streaming

Design Principles

  1. Opaque handles - Assets identified by handles, not paths
  2. Reference counting - Assets stay loaded while referenced
  3. Async loading - Non-blocking loads with callbacks
  4. Pluggable loaders - Register loaders for custom types
  5. Hot-reload ready - Watch for file changes (dev mode)

Key Types

Type Purpose
AssetHandle<T> Type-safe reference to loaded asset
IAssetLoader<T> Loads specific asset type
AssetManager Central loading and caching
AssetRef<T> Component-friendly asset reference

Deliverables

  • #TBD - Create KeenEyes.Assets project

Success Criteria

  • Load assets by path, get handle back
  • Reference counting (auto-unload when unused)
  • Async loading with progress callbacks
  • Built-in loaders: textures, audio, models
  • Custom loader registration
  • Asset bundles for packaging
  • Hot-reload in development mode
  • No duplicate loads (caching)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions