GBX.NET.LZO 2.1.6

GBX.NET.LZO

NuGet Discord

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.

The compression logic is split up from the read/write logic to allow GBX.NET 2 library to be distributed under the MIT license, as Oberhumer distributes the open source version of LZO under the GNU GPL v3. Therefore, using GBX.NET.LZO 2 requires you to license your project under the GNU GPL v3, see License.

Gbx header is not compressed and can contain useful information (icon data, replay time, ...), and also many of the internal Gbx files from Pak files are not compressed, so you can avoid LZO for these purposes.

Usage

At the beginning of your program execution, you add the Gbx.LZO = new Lzo(); to prepare the LZO compression. It should be run only once.

The Lzo implementation uses 999 compression, which is slightly more efficient than the compression used by Nadeo games.

This project example expects you to have <ImplicitUsings>enable</ImplicitUsings>. If this does not work for you, add using System.Linq;.

using GBX.NET;
using GBX.NET.Engines.Game;
using GBX.NET.LZO; // Add this

Gbx.LZO = new Lzo(); // Add this ONLY ONCE and before you start using Parse methods

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

Console.WriteLine($"Block count: {map.GetBlocks().Count()}");

You should not get the LZO exception anymore when you read a compressed Gbx file.

In your final builds, in case you want to package the liblzo2 library into the executable, use <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>.

MiniLZO

If you want to use the port of minilzo 2.06, just use the MiniLZO class. MiniLZO uses 1 compression which is less efficient than the one used by Nadeo games.

using GBX.NET.LZO;

Gbx.LZO = new MiniLZO(); 

In your final builds, this allows you to remove the additional liblzo2 library file generated by the build, as it is not used by MiniLZO.

License

GBX.NET.LZO library is GNU GPL v3 Licensed.

If you use the LZO compression library, you must license your project under the GNU GPL v3.

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

Packages Downloads
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
195
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
194
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
192
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
188
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
187
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
185
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
184
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
181
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
180
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
179
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
176
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
174
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
173
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
171
GBX.NET.Tool.CLI
CLI implementation for the GBX.NET tool framework using Spectre.Console.
169

.NET 10.0

.NET 8.0

.NET 9.0

.NET Standard 2.0

Version Downloads Last updated
2.1.6 1 07/30/2026
2.1.5 109 04/04/2026
2.1.4 125 01/28/2026
2.1.3 120 01/06/2026
2.1.2 285 09/12/2025