-
Notifications
You must be signed in to change notification settings - Fork 2
Home
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.
| 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). |
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
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.
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.
- 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,
EditorNodeadapter 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.
.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.
Structures
- ability
- affix
- AffixTuning
- AIDefinition
- AudioTriggerDef
- cAffixDifficultyTuning
- cAgentBlackboard
- cAICondition
- cAIDirector
- cAINode
- cAnimatedData
- cAnimatorData
- cAssetProperty
- cAssetPropertyList
- cAssetQueryString
- Catalog
- CatalogEntry
- cAttributeData
- cAudioEventData
- cCameraComponent
- cCameraComponentData
- cCinematicView
- cCombatantData
- cControllerState
- cDecalData
- cDoorDef
- cEffectEventData
- cEliteAffix
- cGambitDefinition
- cGameObjectGfxStateData
- cGameObjectGfxStates
- cGfxComponentDef
- cGraphicsData
- cGrassData
- ChainLevel
- ChainLevels
- CharacterAnimation
- CharacterType
- cHardpointInfo
- Cinematic
- cInteractableData
- cKeyAsset
- cLabsMarker
- ClassAttributes
- cLayerPrefs
- cLineLightData
- cLobParams
- cLocomotionData
- cLongDescription
- cLootData
- cMapCameraData
- cNewGfxState
- cOccluderData
- CollisionVolumeDef
- CombatantDef
- CombatEvent
- Condition
- cParallelLightData
- cPointLightData
- cPressureSwitchDef
- cProjectileParams
- CrystalDef
- CrystalDropDef
- CrystalLevel
- CrystalTuning
- cSpaceshipCameraTuning
- cSPBoundingBox
- cSplineCameraData
- cSplineCameraNodeBaseData
- cSpotLightData
- cSwitchDef
- cThumbnailCaptureParameters
- cToolPos
- cVolumeDef
- cWaterData
- cWaterSimData
- DifficultyTuning
- DirectorBucket
- DirectorClass
- DirectorTuning
- EditorPrefs
- EliteNPCGlobals
- EventListenerData
- EventListenerDef
- ExtentsCategory
- GameObjectGfxStateTuning
- Gfx
- GravityForce
- InteractableDef
- labsCharacter
- labsCrystal
- labsPlayer
- Level
- LevelCameraSettings
- LevelConfig
- LevelKey
- LevelMarkerset
- LevelObjectives
- LocomotionTuning
- LootData
- LootPreferences
- LootPrefix
- LootRigblock
- LootSuffix
- MagicNumbers
- Markerset
- NavMeshLayer
- NavPowerTuning
- NonPlayerClass
- Noun
- NPCAffix
- ObjectExtents
- objective
- OrbitDef
- Phase
- PlayerClass
- PopupTip
- ProjectileDef
- SectionConfig
- ServerEvent
- ServerEventDef
- SharedComponentData
- SpaceshipSpawnPointDef
- SpaceshipTuning
- SpawnPointDef
- SpawnTriggerDef
- sporelabsObject
- TeleporterDef
- TestAsset
- TriggerVolumeComponentDef
- TriggerVolumeDef
- TriggerVolumeEvents
- UnlockDef
- UnlocksTuning
- WeaponDef
- WeaponTuning
Enums
- cGfxComponentDef.gfxType
- cHardpointInfo.bodyCap
- cHarpointInfo.type
- cLabsMarker.navMeshSetting
- cLabsMarker.shadowed
- cLabsMarker.type
- CollisionShape
- CrystalDef.rarity
- CrystalDef.type
- cVolumeDefShape
- EditorPrefs.cameraMode
- EditorPrefs.transformSpace
- gfxPickMethod
- LevelType
- LocomotionType
- Markerset.condition
- NonPlayerClass.creatureType
- NonPlayerClass.dropType
- NonPlayerClass.mNPCType
- NounType
- phaseType
- PhysicsType
- PlayerClass.creatureClass
- PlayerClass.creatureType
- PlayerClass.descriptionTag
- PlayerClass.homeworld
- PlayerClass.primaryAttribute
- presetExtents
- ProjectileDef.targetType
- SpawnPointDef.sectionType
- spawnTeamId
- targetType
- triggerActivationType
- TriggerShape
- type
- UnlockDef.unlockFunction
- UnlockDef.unlockType