Stan44 becedccadd updated memory memory handling to be more safe.
added some missing function.
added XML documentation formatting.
added MemoryUsageReporter to track memory usage.
added ChunkMark Benchmarking tool to benchmark the performance of the chunk manager.
added ChunkMark MemoryReporter to track memory usage.

fixed some bugs.
2025-05-10 02:36:54 -05:00
2025-05-09 20:04:37 -05:00

AdvChkSys

AdvChkSys is a high-performance, extensible chunked world management library for .NET, designed for games, simulations, and voxel engines. It provides efficient memory management, chunk loading/unloading, resource tracking, event hooks, serialization, and optional constraints for 2D and 3D chunk-based worlds.


Features

  • 2D and 3D Chunk Management
    Efficient, thread-safe managers for 2D and 3D chunks with support for custom data types.

  • Memory Efficiency
    LRU caching, array pooling, and all-air chunk singletons minimize memory usage and maximize performance.

  • Resource Tracking
    Built-in resource manager tracks allocated chunks and supports diagnostics and pooling.

  • Event System
    Thread-safe events for chunk lifecycle: loading, unloading, saving, and more.

  • World Constraints
    Optional constraints for world size and loaded chunk limits.

  • Serialization
    Fast binary serialization/deserialization for chunk data.

  • Async Utilities
    Helpers for running chunk tasks asynchronously.

  • Python/.NET Interop
    Python bindings for scripting and integration.


Getting Started

Requirements

  • .NET Standard 2.1 or later

Building

dotnet build src/AdvChkSys/AdvChkSys.csproj

Basic Usage

using AdvChkSys;
using AdvChkSys.Manager;

// Create a 2D chunk manager
var manager2D = AdvChkSys.AdvChkSys.Create2DManager();

// Create or load a chunk
var chunk = manager2D.LoadOrCreateChunk(0, 0, 32, 32);

// Set a cell value
chunk[0, 0] = 42;

// Unload a chunk
manager2D.UnloadChunk(0, 0);

Python Bindings

Python bindings are available in src/bindings/python/.
See src/bindings/python/README.md for usage.


Project Structure

advchksys/
  src/
    AdvChkSys/
      Chunk/
      Manager/
      Constraints/
      Events/
      Interfaces/
      Resources/
      Serialization/
      Threading/
      Util/
      AdvChkSys.csproj
  bindings/
    python/
    godot/
  tests/
    AdvChkSys.Tests/
  README.md
  LICENSE

Documentation

  • API documentation can be generated with DocFX.
  • XML documentation is included in the build.

License

This project is licensed under the MIT License. See LICENSE for details.


Acknowledgments

  • Inspired by voxel engines and chunked world systems such as Minecraft.
  • Uses DocFX for documentation generation.

Contributing

Pull requests and issues are welcome! Please see CONTRIBUTING.md if available, or open an issue to discuss your ideas.


Description
AdvChkSys is a high-performance, extensible chunked world management library for .NET, designed for games, simulations, and voxel engines. It provides efficient memory management, chunk loading/unloading, resource tracking, event hooks, serialization, and optional constraints for 2D and 3D chunk-based worlds.
Readme 6.2 MiB
Languages
C# 78.9%
Python 18.6%
Batchfile 2.3%
Shell 0.2%