GBX.NET 2.2.2-nightly.20251108.cc7ee0c7

GBX.NET

NuGet Discord

A 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.

For more details, see the main README.

Framework support

Due to the recently paced evolution of .NET, framework support has been limited only to a few ones compared to GBX.NET 1:

  • .NET 9
  • .NET 8
  • .NET 6
  • .NET Standard 2.0

You can still use GBX.NET 2 on the old .NET Framework, but the performance of the library could be degraded.

Usage

These examples expect you to have <ImplicitUsings>enable</ImplicitUsings>. If this does not work for you, add using System.Linq; at the top.

Map information

Additional package GBX.NET.LZO is required in this example.

using GBX.NET;
using GBX.NET.Engines.Game;
using GBX.NET.LZO;

Gbx.LZO = new Lzo();

var map = Gbx.ParseNode<CGameCtnChallenge>("Path/To/My.Map.Gbx");

foreach (var block in map.GetBlocks().GroupBy(x => x.Name))
{
    Console.WriteLine($"{block.Key}: {block.Count()}");
}

Map information from Gbx header

using GBX.NET;
using GBX.NET.Engines.Game;
using GBX.NET.LZO;

var map = Gbx.ParseHeaderNode<CGameCtnChallenge>("Path/To/My.Map.Gbx");

Console.WriteLine(map.MapName);
Console.WriteLine(map.Xml);

Header contains a lot less information than the full node.

Modify and save a map

using GBX.NET;
using GBX.NET.Engines.Game;
using GBX.NET.LZO;

Gbx.LZO = new Lzo();

var gbx = Gbx.Parse<CGameCtnChallenge>("Path/To/My.Map.Gbx");
var map = gbx.Node; // See Clarity section for more info

map.MapName = "My new map name";

gbx.Save("Path/To/MyNew.Map.Gbx");

The trick here is that the Gbx properties are saved in the gbx object variable (Gbx class).

If you were to go with ParseNode in this case, this would not work for TMF and older games, but it is still possible if you specify the Gbx parameters in the Save method:

map.Save("Path/To/MyNew.Map.Gbx", new()
{
    PackDescVersion = 2 // Latest known PackDesc version in TMF
});

For TMS or TMN ESWC, you would have to specify ClassIdRemapMode for example:

map.Save("Path/To/MyNew.Map.Gbx", new()
{
    ClassIdRemapMode = ClassIdRemapMode.Id2006
    PackDescVersion = 1
});

These save parameters depend on the game of choice, but since Trackmania 2, this does not matter.

Processing multiple Gbx types

Additional package GBX.NET.LZO is required in this example.

This example shows how you can retrieve ghost objects from multiple different types of Gbx:

using GBX.NET;
using GBX.NET.Engines.Game;
using GBX.NET.LZO;

Gbx.LZO = new Lzo();

var node = Gbx.ParseNode("Path/To/My.Gbx");

var ghost = node switch
{
    CGameCtnReplayRecord replay => replay.GetGhosts().FirstOrDefault(),
    CGameCtnMediaClip clip => clip.GetGhosts().FirstOrDefault(),
    CGameCtnGhost g => g,
    _ => null
};

if (ghost is null)
{
    Console.WriteLine("This Gbx file does not have any ghost.");
}
else
{
    Console.WriteLine("Time: {0}", ghost.RaceTime);
}

Using pattern matching with non-generic Parse methods is a safer approach (no exceptions on different Gbx types), but less trim-friendly.

Read a large amount of replay metadata quickly

In case you only need the most basic information about many of the most common Gbx files (maps, replays, items, ...), do not read the full Gbx file, but only the header part. It is a great performance benefit for disk scans.

using GBX.NET;
using GBX.NET.Engines.Game;

foreach (var filePath in Directory.EnumerateFiles("Path/To/My/Directory", "*.Replay.Gbx", SearchOption.AllDirectories))
{
    try
    {
        DisplayBasicReplayInfo(filePath);
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Gbx exception occurred {Path.GetFileName(filePath)}: {ex}");
    }
}

void DisplayBasicReplayInfo(string filePath)
{
    var nodeHeader = Gbx.ParseHeaderNode(filePath);

    if (nodeHeader is CGameCtnReplayRecord replay)
    {
        Console.WriteLine($"{replay.MapInfo}: {replay.Time}");
    }
}

File types

Some of the common types to start with (a lot more are supported):

Latest extension Class Can read Can write Other extension/s
Map.Gbx CGameCtnChallenge Yes Yes Challenge.Gbx
Replay.Gbx CGameCtnReplayRecord Yes No
Ghost.Gbx CGameCtnGhost Yes Yes
Clip.Gbx CGameCtnMediaClip Yes Yes
Item.Gbx CGameItemModel Yes Yes Block.Gbx
Mat.Gbx CPlugMaterialUserInst Yes Yes
Mesh.Gbx CPlugSolid2Model Yes Yes
Shape.Gbx CPlugSurface Yes Yes
Macroblock.Gbx CGameCtnMacroBlockInfo Yes Yes
LightMapCache.Gbx CHmsLightMapCache No No
SystemConfig.Gbx CSystemConfig Yes Yes
FidCache.Gbx CMwRefBuffer Yes Yes
Profile.Gbx CGamePlayerProfile Up to TMF Up to TMF
Scores.Gbx CGamePlayerScore No No

Supported games

Many essential Gbx files from many games are supported:

  • Trackmania (2020), December 2024 update
  • ManiaPlanet 4(.1), TM2/SM
  • Trackmania Turbo
  • ManiaPlanet 3, TM2/SM
  • ManiaPlanet 2, TM2/SM
  • ManiaPlanet 1, TM2
  • TrackMania Forever, Nations/United
  • Virtual Skipper 5
  • TrackMania United
  • TrackMania Nations ESWC
  • TrackMania Sunrise eXtreme
  • TrackMania Original
  • TrackMania Sunrise
  • TrackMania Power Up
  • TrackMania (1.0)

License

GBX.NET library (this package) is MIT Licensed.

However, if you would use GBX.NET.LZO package with it (which is usually required), you'd need to follow the GNU GPL v3 License. See License section on the main README for more details.

Special thanks

Without these people, this project wouldn't be what it is today (ordered by impact):

  • Stefan Baumann (Solux)
  • Melissa (Miss)
  • florenzius
  • Kim
  • tilman
  • schadocalex
  • James Romeril
  • frolad (Juice)
  • Mika Kuijpers (TheMrMiku)
  • donadigo

And many thanks to every bug reporter!

Showing the top 20 packages that depend on GBX.NET.

Packages Downloads
GBX.NET.LZO
An LZO compression plugin for GBX.NET to allow de/serialization of compressed Gbx bodies. This official implementation uses lzo 2.10 from NativeSharpLzo and minilzo 2.06 port by zzattack.
198
GBX.NET.Tool
Base library for creating rich tools for different environments with GBX.NET.
168
GBX.NET.Imaging.SkiaSharp
Provides extensions for image handling in GBX.NET (Google's Skia with SkiaSharp).
150
GBX.NET.ZLib
Support for zlib compressed parts of Gbx, integrated with GBX.NET. This official implementation uses Iconic.Zlib.Netstandard.
126
GBX.NET.ZLib
Support for zlib compressed parts of Gbx, integrated with GBX.NET. This official implementation uses Iconic.Zlib.Netstandard.
121
GBX.NET.Hashing
Hashing features (CRC32) for GBX.NET 2.
115
GBX.NET.Tool
Base library for creating rich tools for different environments with GBX.NET.
112
GBX.NET.PAK
Support for reading Pak (NadeoPak) package files, integrated with GBX.NET.
106
GBX.NET.ZLib
Support for zlib compressed parts of Gbx, integrated with GBX.NET. This official implementation uses Iconic.Zlib.Netstandard.
105
GBX.NET.PAK
Support for reading Pak (NadeoPak) package files, integrated with GBX.NET.
105
GBX.NET.Tool
Base library for creating rich tools for different environments with GBX.NET.
105
GBX.NET.Tool
Base library for creating rich tools for different environments with GBX.NET.
104
GBX.NET.ZLib
Support for zlib compressed parts of Gbx, integrated with GBX.NET. This official implementation uses Iconic.Zlib.Netstandard.
102
GBX.NET.ZLib
Support for zlib compressed parts of Gbx, integrated with GBX.NET. This official implementation uses Iconic.Zlib.Netstandard.
101
GBX.NET.PAK
Support for reading Pak (NadeoPak) package files, integrated with GBX.NET.
101
GBX.NET.PAK
Support for reading Pak (NadeoPak) package files, integrated with GBX.NET.
100
GBX.NET.ZLib
Support for zlib compressed parts of Gbx, integrated with GBX.NET. This official implementation uses Iconic.Zlib.Netstandard.
99
GBX.NET.Tool
Base library for creating rich tools for different environments with GBX.NET.
97

Version Downloads Last updated
2.3.3 5 02/06/2026
2.3.3-nightly.20260210.c24fcba4 0 02/10/2026
2.3.3-nightly.20260209.c24fcba4 3 02/09/2026
2.3.3-nightly.20260208.cb9e7d37 4 02/08/2026
2.3.3-nightly.20260207.cb9e7d37 4 02/07/2026
2.3.3-nightly.20260206.c876e805 6 02/06/2026
2.3.3-nightly.20260205.c876e805 8 02/05/2026
2.3.2 20 01/31/2026
2.3.2-nightly.20260204.c36b2750 9 02/04/2026
2.3.2-nightly.20260203.ce70bca8 9 02/03/2026
2.3.2-nightly.20260202.c5155b72 11 02/02/2026
2.3.2-nightly.20260201.c08e9cf0 11 02/01/2026
2.3.2-nightly.20260131.ca3d31a1 15 01/31/2026
2.3.2-nightly.20260130.c71043e7 14 01/30/2026
2.3.2-nightly.20260129.cab73d6a 14 01/29/2026
2.3.1 17 01/28/2026
2.3.0 46 01/06/2026
2.3.0-nightly.20260128.cca24500 14 01/28/2026
2.3.0-nightly.20260127.c901462b 15 01/27/2026
2.3.0-nightly.20260126.c901462b 14 01/26/2026
2.3.0-nightly.20260125.c901462b 14 01/25/2026
2.3.0-nightly.20260124.c901462b 14 01/24/2026
2.3.0-nightly.20260123.c901462b 16 01/23/2026
2.3.0-nightly.20260122.c7a55df5 15 01/22/2026
2.3.0-nightly.20260121.c7a55df5 13 01/21/2026
2.3.0-nightly.20260120.c7a55df5 18 01/20/2026
2.3.0-nightly.20260119.c7a55df5 17 01/19/2026
2.3.0-nightly.20260118.c7a55df5 16 01/18/2026
2.3.0-nightly.20260117.c7a55df5 16 01/17/2026
2.3.0-nightly.20260116.c90625c0 17 01/16/2026
2.3.0-nightly.20260115.c90625c0 14 01/15/2026
2.3.0-nightly.20260114.c90625c0 16 01/14/2026
2.3.0-nightly.20260113.cbc80995 19 01/13/2026
2.3.0-nightly.20260112.cacd11b1 18 01/12/2026
2.3.0-nightly.20260111.cacd11b1 19 01/11/2026
2.3.0-nightly.20260110.cacd11b1 16 01/10/2026
2.3.0-nightly.20260109.cb7e37fc 20 01/09/2026
2.3.0-nightly.20260108.c8bc1866 20 01/08/2026
2.3.0-nightly.20260107.c8bc1866 17 01/07/2026
2.3.0-nightly.20260106.c02413cc 18 01/06/2026
2.3.0-nightly.20260105.c02413cc 23 01/05/2026
2.3.0-nightly.20260104.cf04ebd8 18 01/04/2026
2.3.0-nightly.20260103.c4dfc285 17 01/03/2026
2.3.0-nightly.20260102.c4dfc285 20 01/02/2026
2.3.0-nightly.20260101.c4dfc285 29 01/01/2026
2.3.0-nightly.20251231.c4dfc285 29 12/31/2025
2.3.0-nightly.20251230.c4dfc285 24 12/30/2025
2.3.0-nightly.20251229.c4dfc285 28 12/29/2025
2.3.0-nightly.20251228.c4dfc285 26 12/28/2025
2.3.0-nightly.20251227.c4dfc285 26 12/27/2025
2.3.0-nightly.20251226.c4dfc285 32 12/26/2025
2.3.0-nightly.20251225.c4dfc285 26 12/25/2025
2.3.0-nightly.20251224.c4dfc285 27 12/24/2025
2.3.0-nightly.20251223.c4dfc285 24 12/23/2025
2.3.0-nightly.20251222.c5e605d0 30 12/22/2025
2.3.0-nightly.20251221.c5e605d0 29 12/21/2025
2.3.0-nightly.20251220.c5e605d0 33 12/20/2025
2.3.0-nightly.20251219.c5e605d0 30 12/19/2025
2.3.0-nightly.20251218.c5e605d0 34 12/18/2025
2.3.0-nightly.20251217.cf86955d 34 12/17/2025
2.3.0-nightly.20251216.c7d5e6b0 28 12/16/2025
2.3.0-nightly.20251215.cdd724b7 37 12/15/2025
2.3.0-nightly.20251215.c7d5e6b0 51 12/15/2025
2.3.0-nightly.20251214.cb34438e 35 12/14/2025
2.3.0-nightly.20251214.c8b776c7 34 12/14/2025
2.3.0-nightly.20251214.c2b1ee1f 42 12/14/2025
2.3.0-nightly.20251213.c8b776c7 29 12/13/2025
2.3.0-nightly.20251212.c8b776c7 34 12/12/2025
2.3.0-nightly.20251211.c8b776c7 30 12/11/2025
2.3.0-nightly.20251210.c8b776c7 29 12/10/2025
2.3.0-nightly.20251209.c7a2121c 32 12/09/2025
2.3.0-nightly.20251208.c7a2121c 35 12/08/2025
2.3.0-nightly.20251207.c7a2121c 26 12/07/2025
2.3.0-nightly.20251206.c7a2121c 36 12/06/2025
2.3.0-nightly.20251205.c7a2121c 34 12/05/2025
2.3.0-nightly.20251204.c7a2121c 30 12/04/2025
2.3.0-nightly.20251203.c7a2121c 44 12/03/2025
2.3.0-nightly.20251202.c7a2121c 36 12/02/2025
2.3.0-nightly.20251201.c7952f69 35 12/01/2025
2.3.0-nightly.20251130.cee286e5 40 11/30/2025
2.3.0-nightly.20251129.cee286e5 51 11/29/2025
2.3.0-nightly.20251128.cee286e5 42 11/28/2025
2.3.0-nightly.20251127.cee286e5 44 11/27/2025
2.3.0-nightly.20251126.cee286e5 40 11/26/2025
2.3.0-nightly.20251125.cee286e5 36 11/25/2025
2.3.0-nightly.20251124.cee286e5 67 11/24/2025
2.3.0-nightly.20251123.cee286e5 60 11/23/2025
2.3.0-nightly.20251122.cee286e5 67 11/22/2025
2.3.0-nightly.20251121.cee286e5 55 11/21/2025
2.3.0-nightly.20251120.cee286e5 66 11/20/2025
2.3.0-nightly.20251119.cee286e5 72 11/19/2025
2.3.0-nightly.20251118.cee286e5 73 11/18/2025
2.3.0-nightly.20251117.cee286e5 70 11/17/2025
2.3.0-nightly.20251116.cd6cbb8f 57 11/16/2025
2.3.0-nightly.20251115.cd6cbb8f 43 11/15/2025
2.3.0-nightly.20251114.cd6cbb8f 28 11/14/2025
2.2.2 199 09/12/2025
2.2.2-nightly.20251113.cc7ee0c7 52 11/13/2025
2.2.2-nightly.20251112.cc7ee0c7 38 11/12/2025
2.2.2-nightly.20251111.cc7ee0c7 45 11/11/2025
2.2.2-nightly.20251110.cc7ee0c7 58 11/10/2025
2.2.2-nightly.20251109.cc7ee0c7 51 11/09/2025
2.2.2-nightly.20251108.cc7ee0c7 48 11/08/2025
2.2.2-nightly.20251107.cc7ee0c7 44 11/07/2025
2.2.2-nightly.20251106.cc7ee0c7 47 11/06/2025
2.2.2-nightly.20251105.cc7ee0c7 51 11/05/2025
2.2.2-nightly.20251104.cc7ee0c7 41 11/04/2025
2.2.2-nightly.20251103.cc7ee0c7 53 11/03/2025
2.2.2-nightly.20251102.c43def11 55 11/02/2025
2.2.2-nightly.20251101.c43def11 44 11/01/2025
2.2.2-nightly.20251031.c43def11 57 10/31/2025
2.2.2-nightly.20251030.c43def11 60 10/30/2025
2.2.2-nightly.20251029.c43def11 68 10/29/2025
2.2.2-nightly.20251028.ce6a6ed6 68 10/28/2025
2.2.2-nightly.20251027.ce6a6ed6 47 10/27/2025
2.2.2-nightly.20251026.ce6a6ed6 62 10/26/2025
2.2.2-nightly.20251025.ce6a6ed6 63 10/25/2025
2.2.2-nightly.20251024.ce6a6ed6 56 10/24/2025
2.2.2-nightly.20251023.ce6a6ed6 66 10/23/2025
2.2.2-nightly.20251022.ce6a6ed6 58 10/22/2025
2.2.2-nightly.20251021.ce6a6ed6 59 10/21/2025
2.2.2-nightly.20251020.cd56d4a7 60 10/20/2025
2.2.2-nightly.20251019.cf7d66e0 64 10/19/2025
2.2.2-nightly.20251018.cf7d66e0 54 10/18/2025
2.2.2-nightly.20251017.c5a52eb9 64 10/17/2025
2.2.2-nightly.20251016.c5a52eb9 61 10/16/2025
2.2.2-nightly.20251015.c5a52eb9 54 10/15/2025
2.2.2-nightly.20251014.c5a52eb9 54 10/14/2025
2.2.2-nightly.20251013.c5a52eb9 56 10/13/2025
2.2.2-nightly.20251012.c5a52eb9 63 10/12/2025
2.2.2-nightly.20251011.c5a52eb9 66 10/11/2025
2.2.2-nightly.20251010.c5a52eb9 54 10/10/2025
2.2.2-nightly.20251009.c5a52eb9 63 10/09/2025
2.2.2-nightly.20251008.c5a52eb9 66 10/08/2025
2.2.2-nightly.20251007.c55d6ba0 53 10/07/2025
2.2.2-nightly.20251006.c55d6ba0 69 10/06/2025
2.2.2-nightly.20251005.c2c8c81e 64 10/05/2025
2.2.2-nightly.20251004.c2c8c81e 72 10/04/2025
2.2.2-nightly.20251003.cce76ab7 59 10/03/2025
2.2.2-nightly.20251002.cce76ab7 72 10/02/2025
2.2.2-nightly.20251001.cce76ab7 73 10/01/2025
2.2.2-nightly.20250930.cce76ab7 72 09/30/2025
2.2.2-nightly.20250929.cce76ab7 59 09/29/2025
2.2.2-nightly.20250928.cce76ab7 64 09/28/2025
2.2.2-nightly.20250927.cce76ab7 66 09/27/2025
2.2.2-nightly.20250926.cce76ab7 47 09/26/2025
2.2.2-nightly.20250925.cce76ab7 77 09/25/2025
2.2.2-nightly.20250924.cce76ab7 59 09/24/2025
2.2.2-nightly.20250923.cce76ab7 78 09/23/2025
2.2.2-nightly.20250922.cce76ab7 78 09/22/2025
2.2.2-nightly.20250921.cce76ab7 78 09/21/2025
2.2.2-nightly.20250920.cce76ab7 78 09/20/2025
2.2.2-nightly.20250919.cce76ab7 54 09/19/2025
2.2.2-nightly.20250918.cce76ab7 48 09/18/2025
2.2.2-nightly.20250917.cce76ab7 59 09/17/2025
2.2.2-nightly.20250916.cce76ab7 55 09/16/2025
2.2.2-nightly.20250915.cce76ab7 51 09/15/2025
2.2.2-nightly.20250914.cce76ab7 83 09/14/2025
2.2.2-nightly.20250913.cce76ab7 64 09/13/2025
2.2.2-nightly.20250912.cba11d3c 54 09/12/2025
2.2.2-nightly.20250911.cba11d3c 60 09/11/2025
2.2.2-nightly.20250910.cba11d3c 63 09/10/2025
2.2.2-nightly.20250909.cba11d3c 74 09/09/2025
2.2.2-nightly.20250908.cba11d3c 68 09/08/2025
2.2.2-nightly.20250907.cba11d3c 70 09/07/2025
2.2.2-nightly.20250906.cba11d3c 69 09/06/2025
2.2.2-nightly.20250905.cba11d3c 82 09/05/2025
2.2.2-nightly.20250904.cba11d3c 84 09/04/2025
2.2.2-nightly.20250903.cba11d3c 89 09/03/2025
2.2.2-nightly.20250902.cba11d3c 85 09/02/2025
2.2.2-nightly.20250901.cba11d3c 88 09/01/2025
2.2.2-nightly.20250831.cba11d3c 84 08/31/2025
2.2.2-nightly.20250830.cba11d3c 75 08/30/2025
2.2.2-nightly.20250829.cba11d3c 58 08/29/2025
2.2.2-nightly.20250828.cde940d2 72 08/28/2025
2.2.2-nightly.20250827.c8257ead 85 08/27/2025
2.2.1-nightly.20250826.c1aa6590 95 08/26/2025
2.2.1-nightly.20250825.c3a861aa 83 08/25/2025
2.2.1-nightly.20250824.c3a861aa 89 08/24/2025
2.2.1-nightly.20250823.c3a861aa 79 08/23/2025
2.2.1-nightly.20250822.c3a861aa 57 08/22/2025
2.2.1-nightly.20250821.c3a861aa 89 08/21/2025
2.2.1-nightly.20250820.c3a861aa 52 08/20/2025
2.2.1-nightly.20250819.c3a861aa 55 08/19/2025
2.2.1-nightly.20250818.c5bbab68 77 08/18/2025
2.2.1-nightly.20250817.ce814990 63 08/17/2025
2.2.1-nightly.20250817.c6817f0a 83 08/17/2025
2.2.1-nightly.20250816.c6817f0a 54 08/16/2025
2.2.1-nightly.20250815.c6817f0a 95 08/15/2025
2.2.1-nightly.20250814.c6817f0a 56 08/14/2025
2.2.1-nightly.20250813.c6817f0a 94 08/13/2025
2.2.1-nightly.20250812.c6817f0a 88 08/12/2025
2.2.1-nightly.20250811.c6817f0a 49 08/11/2025
2.2.1-nightly.20250810.c6817f0a 61 08/10/2025
2.2.1-nightly.20250809.c6817f0a 52 08/09/2025
2.2.1-nightly.20250808.c6817f0a 63 08/08/2025
2.2.1-nightly.20250807.c6817f0a 55 08/07/2025
2.2.1-nightly.20250806.c6817f0a 52 08/06/2025
2.2.1-nightly.20250805.c6817f0a 53 08/05/2025
2.2.1-nightly.20250804.c6817f0a 118 08/04/2025
2.2.1-nightly.20250803.c6817f0a 84 08/03/2025
2.2.1-nightly.20250802.c6817f0a 70 08/02/2025
2.2.1-nightly.20250801.c6817f0a 57 08/01/2025
2.2.1-nightly.20250731.c6817f0a 64 07/31/2025
2.2.1-nightly.20250730.c6817f0a 89 07/30/2025
2.2.1-nightly.20250729.c6817f0a 70 07/29/2025
2.2.1-nightly.20250728.ca7f9be8 81 07/28/2025
2.2.1-nightly.20250727.cd7b47aa 68 07/27/2025
2.2.1-nightly.20250726.cd7b47aa 81 07/26/2025
2.2.1-nightly.20250725.cd7b47aa 71 07/25/2025
2.2.1-nightly.20250724.cd7b47aa 89 07/24/2025
2.2.1-nightly.20250723.cd7b47aa 86 07/23/2025
2.2.1-nightly.20250722.cd7b47aa 76 07/22/2025
2.2.1-nightly.20250721.cd7b47aa 93 07/21/2025