Skip to content

Repository files navigation

ArcNET

.NETC#Build StatuscodecovLicense

Modular SDK for Arcanum: Of Steamworks and Magick Obscura editors, content tooling, and save workflows. Span-based, low-allocation, UI-agnostic library APIs — usable from console tools, Avalonia editors, Blazor WASM, and anything in between.

⭐ Please star this project if you find it useful. ⭐

Packages · Quick Example · NuGet Publishing · Example Catalogue · Editor Implementation Targets · Editor SDK Roadmap · Public API


Packages

Published NuGet libraries currently tracked in src/ArcNET.PackageVersions.props:

PackageDescriptionNuGetStatus
ArcNET.CoreSpanReader / SpanWriter, primitive types (Location, ArtId, Color, GameObjectGuid, PrefixedString)NuGet🚧 WIP
ArcNET.GameObjectsFull game-object model — 22 typed data classes with explicit Read + WriteNuGet🚧 WIP
ArcNET.FormatsBinary format parsers/writers: MES, SEC, ART, DLG, SCR, PRO, MOB, JMP, TFAI, TFAF, GSI, TMF, and structural save-global filesNuGet🚧 WIP
ArcNET.ArchiveDAT archive pack / unpack backed by MemoryMappedFile; TFAF sub-archive supportNuGet🚧 WIP
ArcNET.GameDataGameDataLoader, GameDataStore, GameDataSaver, and GameDataExporter for loose/extracted content with per-source MES/SEC/PRO/MOB/SCR/DLG trackingNuGet🚧 WIP
ArcNET.BinaryPatchJSON-driven binary patching — field-level PRO/MOB mutations and raw byte patches with backup/revert/verifyNuGet🚧 WIP
ArcNET.EditorUnified editor workspace loading, asset catalog with DAT/loose provenance, map/sector/proto/dialog/script/art index queries, dialog and script composition builders, save-game editing pipeline. See Editor SDK Roadmap.NuGet🚧 WIP

All packages target net10.0 and are AOT / trim compatible. Runtime dependencies are intentionally small; the shared non-BCL package currently used across the core libraries is Bia.ValueBuffers for low-allocation buffer building.

The packable NuGet libraries are intended to remain multiplatform across Windows, Linux, and macOS. Internal diagnostics foundations and host applications live alongside them under src/Diagnostics/*, src/App/*, src/Benchmarks/*, and src/DocTest/*.

Key internal projects in the current repo:

ProjectRolePlatform
ArcNET.DiagnosticsRuntime-oriented diagnostics services, launch planning, capability models, and debugger-facing snapshotsCross-platform library
ArcNET.Diagnostics.FileTimeOffline save/object audits, dump templates, and analysis services shared by diagnostics toolingCross-platform library
ArcNET.Diagnostics.WindowsWindows runtime/process integration used by live debugger workflowsWindows-only library
ArcNET.AppConsole host for archive, editor, patch, and diagnostics workflowsCross-platform executable
ArcanumDebugger.AppAvalonia desktop shell for diagnostics workflowsWindows desktop executable
ArcNET.Benchmarks and ArcNET.DocTestPerformance probes plus public API/documentation verificationInternal tooling

Package versions are now explicit per library via src/ArcNET.PackageVersions.props. Use dotnet Build.cs package-version ArcNET.Core to inspect the current version, then tag ArcNET.Core-v<that version> to publish that package. See docs/NuGetPublishing.md for the local pack and CI publish flow.

The NuGet packages are already consumable, but the overall SDK is still under active construction toward the full modular editor goal described in docs/EditorSdkRoadmap.md. For the concrete near-term build order, use docs/EditorImplementationTargets.md.


Quick Example

usingArcNET.Formats;// Parse a MES message file from disk — one allocation (File.ReadAllBytes)MesFilemesFile=MessageFormat.ParseFile("arcanum/mes/game.mes");IReadOnlyList<MessageEntry>messages=mesFile.Entries;// Or from a buffer you already own — zero extra allocationsReadOnlyMemory<byte>buf=awaitFile.ReadAllBytesAsync("game.mes");mesFile=MessageFormat.ParseMemory(buf);// Serialize back to bytesbyte[]bytes=MessageFormat.WriteToArray(inmesFile);

For more examples see the Example Catalogue.


Example Catalogue

The docs/examples.md file contains copy-paste-ready examples for the main public libraries and tooling surfaces:

  • ArcNET.Formats — MES, SEC, ART, DLG, SCR, PRO, MOB, JMP, FAC, TDF, GSI, TFAI, TFAF, PRP parsers; round-trip serialization; file discovery
  • ArcNET.Archive — open, enumerate, extract single/all entries, read without extracting, pack a directory, TFAF sub-archive
  • ArcNET.GameObjects — read full game objects, read headers only, GameObjectStore
  • ArcNET.GameData — load MES/SEC/PRO/MOB/SCR/DLG from directory or in-memory buffers (per-source origin tracking), save to disk / memory restoring original source paths, dirty tracking, AOT-safe JSON export
  • ArcNET.Diagnostics — runtime workspace composition, launch planning, file-time save/object audits, and HighRes patch install / uninstall helpers
  • ArcNET.BinaryPatch — JSON-driven binary patching: field-level PRO/MOB mutations, raw byte offsets, backup/revert/verify, patch state tracking
  • ArcNET.Editor — workspace loading (EditorWorkspaceLoader), asset catalog with DAT/loose provenance (EditorWorkspace.Assets), load diagnostics (EditorWorkspace.LoadReport), workspace validation (EditorWorkspace.Validation), map/sector/proto/dialog/script/art index queries (EditorWorkspace.Index), dialog and script builders (DialogBuilder, DialogEditor, ScriptBuilder), save-game round-trip (LoadedSave, SaveGameEditor), and fluent content builders
  • ArcNET.Core — low-level SpanReader / SpanWriter, primitive round-trips, EnumLookup

NuGet dependency graph

ArcNET.Core
ArcNET.GameObjects -> ArcNET.Core
ArcNET.Archive -> ArcNET.Core
ArcNET.Formats
├── ArcNET.Core
└── ArcNET.GameObjects -> ArcNET.Core
ArcNET.GameData
├── ArcNET.Core
├── ArcNET.GameObjects -> ArcNET.Core
└── ArcNET.Formats (→ see above)
ArcNET.BinaryPatch
├── ArcNET.Archive -> ArcNET.Core
└── ArcNET.Formats (→ see above)
ArcNET.Editor
├── ArcNET.Archive -> ArcNET.Core
├── ArcNET.Core
├── ArcNET.Formats (→ see above)
├── ArcNET.GameData (→ see above)
└── ArcNET.GameObjects -> ArcNET.Core

Internal diagnostics libraries and host applications layer on top of this package graph rather than shipping as NuGet packages today.


Building

dotnet tool restore
dotnet Build.cs build

NuGet Packaging

dotnet Build.cs list-packages
dotnet Build.cs package-version ArcNET.Core
dotnet Build.cs pack
dotnet Build.cs pack ArcNET.Core

Tagging ArcNET.<Package>-v<semver> publishes only that package via GitHub Actions. The full release contract is documented in docs/NuGetPublishing.md.

CI validates package packing on Windows, Ubuntu, and macOS for the publishable library projects.

Testing

TUnit tests use the Microsoft Testing Platform runner:

dotnet Build.cs test
dotnet Build.cs coverage

Formatting

dotnet csharpier format .# whitespace + brace style (run first)
dotnet format style ArcNET.slnx # naming conventions, usings
dotnet format analyzers ArcNET.slnx # Roslyn analyzer violations

Public API Reference

See docs/PublicApi.md for the complete public API reference.


Credits

Reverse-engineering references that informed the binary format implementations:

  • arcanum-ce — C rewrite of the Arcanum engine; primary source for object field tables (obj.c, obj_flags.h), archive format (database.h), script structures (script.h), sector layout (sector.h), and more. See references.md for the full cross-reference.
  • GrognardsFromHell/OpenTemple — ToEE / Arcanum open-source engine; used for save-game format details (SaveGameInfoReader.cs, ArchiveIndexReader.cs).
  • AxelStrem/ArtConverter — Reference implementation for Arcanum ART sprite format (artconverter.cpp).

License

MIT — Copyright (c) 2026 Bia10

About

Arcanum modding toolkit.

Topics

Resources

Contributing

Security policy

Stars

11 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages