Skip to content
JeanxPereira edited this page May 28, 2026 · 2 revisions

AssetData.Parser

A reverse-engineered parser for Darkspore's binary asset format.


AssetData.Parser reads Darkspore's binary asset files — .noun, .phase, .aicondition, .level, and ~140 other formats — out of AssetData_Binary.package (DBPF/DBBF) and turns them into an inspectable tree. It is a faithful mirror of the retail client's own reflection-based serializer: one generic recursive parser keyed by FNV-1a hash, with one fluent DSL stub per format instead of a hand-written loader for each.

This wiki documents both sides of that contract — how the original Darkspore client loads assets (reverse-engineered from Darkspore.exe), and how this C# port mirrors it — plus the auto-generated reference for every catalogued format.

Navigation

Page What you'll find
Getting Started Install from a release, parse your first asset with the CLI, use the library.
Asset System How the original client loads assets: one parser, one global catalog, reflection stubs. The ground truth.
Binary Format The wire format: header/blob split, the sentinel hash table, value types, array dispatch, catalog files.
Parser Architecture How this C# port is built — the lean L1 core and the L2 editor adapter.
Adding a Format Add support for a new asset format with a single catalog stub.
Catalog Reference Index of every documented structure and enum (full list in the sidebar).

At a glance

flowchart TB
    subgraph L2 ["L2 — Editor (Avalonia, MVVM)"]
        EN["EditorNode hierarchy<br/>INotifyPropertyChanged<br/>ObservableCollection"]
        ETB["EditorTreeBuilder.Build(AssetValue)"]
        ETB --> EN
    end

    subgraph L1 ["L1 — Core (lean, immutable)"]
        Dbpf["DbpfReader<br/>DBPF/DBBF + RefPack<br/>O(1) lookups by ResourceKey/name"]
        Parser["AssetParser.Parse(bytes, rootStruct, headerSize)<br/>Recursive dispatch on FNV-1a hash"]
        Registry["TypeRegistry<br/>FindTypeByHash(uint) -> TypeDescriptor"]
        Value["AssetValue tree<br/>StructValue - ArrayValue - StringValue<br/>NumberValue - BoolValue - EnumValue<br/>VectorValue - LocalizedStringValue - NullValue"]
        Catalog["src/Core/Catalog/<br/>fluent stubs, one per format"]

        Dbpf --> Parser
        Catalog -.->|registers via DSL| Registry
        Parser -->|uses| Registry
        Parser --> Value
    end

    Value -.->|consumed by| ETB
Loading

The dispatch in AssetParser mirrors Darkspore.exe's AssetParser::DeserializeObject (0x009cd2c0): for each field, TypeRegistry.FindTypeByHash(field.typeHash) either resolves to a registered struct (recurse) or returns null — in which case the hash is a wire-shape sentinel (Array, Nullable, Asset, Key, CharPtr, Char, LocalizedAssetString, Enum) or a value type (Bool, Int, Float, Vector2/3/4, Orientation, …) handled inline. See Binary Format for the full table.

Quickstart

Grab a self-contained binary from the latest release — no .NET install required — or run from source:

dotnet run --project src/CLI -- -d AssetData_Binary.package -r registries -v -a PC_EL_Rogue.noun

As a library:

using AssetData.Parser;
using AssetData.Parser.Model;

using var dbpf = new DbpfReader("AssetData_Binary.package");
var service = new AssetService();

byte[]? bytes = dbpf.GetAsset("PC_EL_Rogue.noun");
AssetValue root = service.Load(bytes, "noun", headerSize: 8);

Full walkthrough on Getting Started.

Project status

  • Hash-keyed TypeRegistry + game-faithful dispatch — done
  • DBPF reader: O(n) -> O(1) lookups, single FNV implementation — done
  • L1/L2 split (lean Core POCO tree, EditorNode adapter for the UI) — done
  • Per-format coverage — ~94 of 143 registered formats catalogued; the rest are mechanical, data-only stubs (the generic parser already handles every wire shape). Tracked on Catalog Reference.

Roadmap: binary write-back (modified asset -> disk), enum editing in the editor, asset diff/compare.

Stack

.NET 10 · C# 14 · Avalonia 11.3 (editor) · CommunityToolkit.Mvvm · central package management. The Core library depends on nothing but the BCL.


Reverse-engineering ground truth lives in the ReCap project under docs/architecture/assetdata-system/. The catalog reference pages (listed in the sidebar under Catalog Assets) are generated automatically from the registered schema.

Darkspore AssetData

Base

Guides

Catalog Assets

Structures
Enums

Clone this wiki locally