ChunkL 1.0.0

dotnet add package ChunkL --version 1.0.0
                    
NuGet\Install-Package ChunkL -Version 1.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="ChunkL" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ChunkL" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ChunkL" />
                    
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 ChunkL --version 1.0.0
                    
#r "nuget: ChunkL, 1.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 ChunkL@1.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=ChunkL&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ChunkL&version=1.0.0
                    
Install as a Cake Tool

ChunkL

ChunkL (.chunkl) is a domain-specific language to describe the binary serialization structure of classes and their chunks. Each .chunkl file corresponds to one engine class and declares how its chunks and archive types are read from or written to a binary stream, in a way that stays backwards compatible across game versions.

For the full language reference, see SPECIFICATION.md.

What ChunkL looks like

CGameCtnBlock 0x03057000 // Block placed on a map.

0x002 [TM10]
  ident BlockModel
  byte<Direction> Direction // Facing direction of the block.
  byte3 Coord // Position in block coordinates.
  int Flags

archive
  id Name
  byte<Direction> Direction
  byte3 Coord
  v0=
    short Flags
  v1+
    int Flags

enum Direction
  North
  East
  South
  West

Installing the library

The library is published as a NuGet package:

dotnet add package ChunkL

Using the library

using ChunkL;

// Parse a .chunkl file from disk
var result = ChunkLParser.Parse("CGameCtnBlock.chunkl");

// Or parse ChunkL source text directly
var result2 = ChunkLParser.ParseSource(sourceText);

// Or parse from a stream (an embedded resource or network stream)
using var stream = File.OpenRead("CGameCtnBlock.chunkl");
var result3 = ChunkLParser.Parse(stream);

if (!result.Success)
{
    foreach (var diagnostic in result.Diagnostics)
    {
        Console.WriteLine(diagnostic); // Severity, position, message, and optional code
    }
    return;
}

var file = result.File!;
Console.WriteLine($"{file.Header.ClassName} ({file.Header.ClassId})");

foreach (var chunk in file.Chunks)
{
    Console.WriteLine($"Chunk {chunk.Offset.HexValue}: {chunk.Body.Count} statements");
}

// Write the parsed AST back to ChunkL source
var written = ChunkLParser.Write(file);

VS Code extension

The vscode-chunkl extension adds .chunkl language support to VS Code: syntax highlighting (via a TextMate grammar) and editor completions. See that folder for build/packaging instructions.

Building and testing

dotnet build
dotnet test

License

Licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on ChunkL:

Repository Stars
BigBang1112/gbx-net
General purpose library for Gbx files - data from Nadeo games like Trackmania or Shootmania, written in C#/.NET. It supports high performance serialization and deserialization of 400+ Gbx classes.
Version Downloads Last Updated
1.0.0 0 7/7/2026
0.7.6 1,712 12/17/2025
0.7.5 948 5/23/2025
0.7.4 153 5/23/2025
0.7.3 2,038 6/29/2024
0.7.2 644 3/24/2024
0.7.1 316 3/3/2024
0.7.0 242 3/3/2024
0.6.1 280 2/25/2024
0.6.0 234 2/25/2024
0.5.0 282 2/15/2024
0.4.0 239 2/3/2024
0.3.2 298 1/11/2024
0.3.1 236 1/10/2024
0.3.0 227 1/10/2024
0.2.0 257 1/3/2024
0.1.2 266 12/30/2023
0.1.1 222 12/30/2023
0.1.0 260 12/25/2023