BeyondImmersion.Bannou.AssetLoader 2.0.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package BeyondImmersion.Bannou.AssetLoader --version 2.0.0
                    
NuGet\Install-Package BeyondImmersion.Bannou.AssetLoader -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BeyondImmersion.Bannou.AssetLoader" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BeyondImmersion.Bannou.AssetLoader" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BeyondImmersion.Bannou.AssetLoader" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BeyondImmersion.Bannou.AssetLoader --version 2.0.0
                    
#r "nuget: BeyondImmersion.Bannou.AssetLoader, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BeyondImmersion.Bannou.AssetLoader@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BeyondImmersion.Bannou.AssetLoader&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BeyondImmersion.Bannou.AssetLoader&version=2.0.0
                    
Install as a Cake Tool

Bannou Asset Loader SDK

Engine-agnostic core SDK for downloading, caching, and deserializing Bannou asset bundles.

Overview

The Asset Loader SDK provides a layered architecture for loading assets from Bannou bundles:

  • Core Layer - Bundle reading, HTTP downloading, disk/memory caching
  • Network Adapters - URL resolution via WebSocket (clients) or mesh (servers)
  • Engine Extensions - Type-specific deserialization for Stride, Godot, Unity

This is the core package - it has no network dependencies. For game clients, use asset-loader-client which provides the AssetManager facade. For servers, use asset-loader-server or direct API access.

Installation

# Core SDK (required by all)
dotnet add package BeyondImmersion.Bannou.AssetLoader

# For game clients (recommended)
dotnet add package BeyondImmersion.Bannou.AssetLoader.Client

# For game servers (when loading bundle contents)
dotnet add package BeyondImmersion.Bannou.AssetLoader.Server

# For engine support
dotnet add package BeyondImmersion.Bannou.AssetLoader.Stride

Quick Start (Game Clients)

For game clients, use the AssetManager facade from asset-loader-client:

using BeyondImmersion.Bannou.AssetLoader.Client;

// Connect and load assets
await using var manager = await AssetManager.ConnectAsync(
    "wss://bannou.example.com/connect",
    email, password,
    new AssetManagerOptions { CacheDirectory = "./cache" });

await manager.LoadAssetsAsync(assetIds);
var bytes = await manager.GetAssetBytesAsync(assetId);

See the Asset Loader Client README for full documentation.

Core Usage (Advanced)

For custom configurations or when building your own facade:

Direct URL Loading

using BeyondImmersion.Bannou.AssetLoader;
using BeyondImmersion.Bannou.AssetLoader.Cache;
using BeyondImmersion.Bannou.AssetLoader.Sources;

// Create source with pre-known URLs
var source = new HttpAssetSource();
source.RegisterBundle(
    "my-bundle",
    new Uri("https://cdn.example.com/bundles/my-bundle.bannou"),
    sizeBytes: 1024 * 1024,
    assetIds: new[] { "asset-1", "asset-2" });

// Create cache and loader
var cache = new FileAssetCache("./cache");
var loader = new AssetLoader(source, cache);

// Load assets
var result = await loader.EnsureAssetsAvailableAsync(new[] { "asset-1", "asset-2" });
var bytes = await loader.GetAssetBytesAsync("asset-1");

Local File Loading

// For development or offline testing
var source = new HttpAssetSource();
source.RegisterBundle(
    "local-bundle",
    new Uri("file:///path/to/bundle.bannou"),
    sizeBytes: 0,
    assetIds: new[] { "asset-1" });

var loader = new AssetLoader(source);  // No cache needed for local files

Custom Options

var options = new AssetLoaderOptions
{
    MaxConcurrentDownloads = 4,      // Parallel download limit
    ValidateBundles = true,          // SHA256 integrity checks
    PreferCache = true,              // Use cache over fresh downloads
    AutoRegisterBundles = true       // Auto-register after download
};

var loader = new AssetLoader(source, cache, options);

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                         AssetManager (Facade)                       │
│              (in asset-loader-client, for game clients)             │
└─────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────┐
│                          AssetLoader (Core)                         │
│  - EnsureAssetsAvailableAsync() - resolution + download             │
│  - LoadBundleAsync() - single bundle loading                        │
│  - LoadAssetAsync<T>() - typed deserialization                      │
│  - GetAssetBytesAsync() - raw bytes                                 │
└─────────────────────────────────────────────────────────────────────┘
         │
    ┌────┴────────────────────┬──────────────────────┐
    ▼                         ▼                      ▼
┌────────────────┐   ┌────────────────┐   ┌────────────────────┐
│  IAssetSource  │   │  IAssetCache   │   │  BundleRegistry    │
│  (URL resolve) │   │  (persistence) │   │  (O(1) lookup)     │
└────────────────┘   └────────────────┘   └────────────────────┘
         │                    │
         │                    ▼
         │           ┌────────────────┐   ┌────────────────┐
         │           │ FileAssetCache │   │MemoryAssetCache│
         │           │  (disk LRU)    │   │  (in-memory)   │
         │           └────────────────┘   └────────────────┘
         ▼
┌─────────────────────────┐   ┌─────────────────────────┐
│ BannouWebSocketAssetSource │   │ BannouMeshAssetSource    │
│   (asset-loader-client) │   │   (asset-loader-server) │
└─────────────────────────┘   └─────────────────────────┘

Components

IAssetSource Implementations

Source Package Use Case
BannouWebSocketAssetSource asset-loader-client Game clients
BannouMeshAssetSource asset-loader-server Game servers
HttpAssetSource asset-loader Direct URLs, offline

IAssetCache Implementations

Cache Best For Persistence
FileAssetCache Game clients, VMs Disk-based, survives restarts
MemoryAssetCache Containers, testing In-memory only

BundleRegistry

Thread-safe registry providing O(1) asset-to-bundle lookup:

// Typically accessed via loader
var registry = loader.Registry;

bool hasAsset = registry.HasAsset("asset-id");
bool hasBundle = registry.HasBundle("bundle-id");
string? bundleId = registry.FindBundleForAsset("asset-id");

Type Loaders

Register engine-specific loaders for typed asset loading:

public class MyModelLoader : AssetTypeLoaderBase<MyModel>
{
    public override IReadOnlyList<string> SupportedContentTypes =>
        new[] { "application/x-my-model" };

    public override async Task<MyModel> LoadAsync(
        ReadOnlyMemory<byte> data,
        BundleAssetEntry metadata,
        CancellationToken ct)
    {
        return MyModelSerializer.Deserialize(data.ToArray());
    }

    public override void Unload(MyModel asset)
    {
        asset.Dispose();
    }
}

// Register
loader.RegisterTypeLoader(new MyModelLoader());

// Load typed
var result = await loader.LoadAssetAsync<MyModel>("asset-id");
if (result.Success)
{
    var model = result.Asset;
}

Key Features

Feature Description
Zero service dependencies Core SDK works offline with HttpAssetSource
Pluggable sources WebSocket, mesh, HTTP, or custom
LRU caching Disk and memory caches with eviction
Progress reporting IProgress<BundleDownloadProgress> callbacks
Type-safe loading Generic LoadAssetAsync<T>()
Thread-safe Concurrent loading with semaphore
Integrity validation Optional SHA256 hash verification

Package Hierarchy

BeyondImmersion.Bannou.AssetLoader           ← Core (this package)
    │
    ├── BeyondImmersion.Bannou.AssetLoader.Client   ← Game clients
    │       └── AssetManager facade
    │       └── BannouWebSocketAssetSource
    │
    ├── BeyondImmersion.Bannou.AssetLoader.Server   ← Game servers
    │       └── BannouMeshAssetSource
    │
    └── BeyondImmersion.Bannou.AssetLoader.Stride   ← Engine support
            └── StrideModelTypeLoader
            └── StrideTextureTypeLoader

Further Reading

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on BeyondImmersion.Bannou.AssetLoader:

Package Downloads
BeyondImmersion.Bannou.AssetLoader.Godot

Godot 4.x engine extension for Bannou Asset Loader. Provides type-specific loaders for Godot Texture2D, Mesh, and AudioStream assets from Bannou bundles.

BeyondImmersion.Bannou.AssetLoader.Stride

Stride engine extension for Bannou Asset Loader. Provides type-specific loaders for Stride models, textures, and animations. Note: Full functionality requires Windows.

BeyondImmersion.Bannou.AssetLoader.Server

Mesh-based asset source for Bannou Asset Loader. Provides URL resolution for game servers and backend services using the generated AssetClient.

BeyondImmersion.Bannou.AssetLoader.Client

WebSocket-based asset source for Bannou Asset Loader. Provides URL resolution for game clients and developer tools using the Bannou Client SDK.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1-preview.manual... 72 1/17/2026
2.0.1-preview.11 41 1/29/2026
2.0.1-preview.10 50 1/22/2026
2.0.1-preview.9 47 1/19/2026
2.0.0 162 1/17/2026
1.0.0 175 1/16/2026
0.1.0-preview.manual... 49 1/16/2026