GridForge 3.0.0

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

GridForge

SwiftCollections Icon

.NET CI

A high-performance, deterministic voxel grid system for spatial partitioning, simulation, and game development.

Lightweight, framework-agnostic, and optimized for lockstep engines.


๐Ÿš€ Key Features

  • Voxel-Based Spatial Partitioning โ€“ Build efficient 3D voxel grids with fast access & updates.
  • Deterministic & Lockstep Ready โ€“ Designed for synchronized multiplayer and physics-safe environments.
  • ScanCell Overlay System โ€“ Accelerated proximity and radius queries using spatial hashing.
  • Dynamic Occupancy & Obstacle Tracking โ€“ Manage moving occupants, dynamic obstacles, and voxel metadata.
  • Minimal Allocations & Fast Queries โ€“ Built with SwiftCollections and FixedMathSharp for optimal performance.
  • Framework Agnostic โ€“ Works in Unity, .NET, lockstep engines, and server-side simulations.
  • Multi-Layered Grid System โ€“ Dynamic, hierarchical, and persistent grids.

โ“ Why GridForge?

GridForge is built for developers who need deterministic, high-performance, and framework-agnostic spatial grids. Whether you're building a lockstep multiplayer game, a server-driven simulation, or a high-fidelity physics system, GridForge provides the tools to manage voxelized spatial data with predictable and efficient results โ€” all without relying on any specific engine.

๐Ÿ“ฆ Installation

Non-Unity Projects

  1. Install via NuGet:

    dotnet add package GridForge
    
  2. Or Download/Clone:

    git clone https://github.com/mrdav30/GridForge.git
    
  3. Include in Project:

    • Add GridForge to your solution or reference its compiled DLL.

Unity

GridForge is maintained as a separate Unity package. For Unity-specific implementations, refer to:

๐Ÿ”— GridForge-Unity Repository.


๐Ÿงฉ Dependencies

GridForge depends on the following libraries:

These dependencies are automatically included when installing.


๐Ÿ“– Library Overview

๐Ÿ—‚ Core Components

Component Description
GlobalGridManager Manages VoxelGrids, global spatial queries, and grid registration.
VoxelGrid Represents a single grid containing voxels & scan cells.
Voxel Represents a voxel cell with occupant, obstacle, and partition data..
ScanCell Handles spatial indexing for fast neighbor and radius queries..
GridTracer Trace lines, areas, and paths across voxels and scan cells.
GridObstacleManager Manage dynamic grid obstacles at runtime..
GridOccupantManager Manage and query occupants in voxels.
GridScanManager Optimized scan queries (radius, box, path, etc).
Blockers Define static or dynamic voxel blockers.
Partitions Adds meta-data and custom logic to voxels.

๐Ÿ“– Usage Examples

๐Ÿ”น Creating a Grid

GridConfiguration config = new GridConfiguration(new Vector3d(-10, 0, -10), new Vector3d(10, 0, 10));
GlobalGridManager.TryAddGrid(config, out ushort gridIndex);

๐Ÿ”น Querying a Grid for Voxels

Vector3d queryPosition = new Vector3d(5, 0, 5);
if (GlobalGridManager.TryGetGridAndVoxel(queryPosition, out VoxelGrid grid, out Voxel voxel))
 Console.WriteLine($"Voxel at {queryPosition} is {(voxel.IsOccupied ? "occupied" : "empty")}");
}

๐Ÿ”น Adding a Blocker

BoundingArea blockArea = new BoundingArea(new Vector3d(3, 0, 3), new Vector3d(5, 0, 5));
Blocker blocker = new Blocker(blockArea);
blocker.ApplyBlockage();

๐Ÿ”น Attaching a Partition to a Voxel

if (GlobalGridManager.TryGetGrid(queryPosition, out VoxelGrid grid, out Voxel voxel))
{
    PathPartition partition = new PathPartition();
    partition.Setup(voxel.GlobalVoxelIndex);
    voxel.AddPartition(partition);
}

๐Ÿ”น Scanning for Nearby Occupants

Vector3d scanCenter = new Vector3d(0, 0, 0);
Fixed64 scanRadius = (Fixed64)5;
foreach (IVoxelOccupant occupant in ScanManager.ScanRadius(scanCenter, scanRadius))
{
    Console.WriteLine($"Found occupant at {occupant.WorldPosition}");
}

๐Ÿงช Testing and Validation

GridForge includes comprehensive unit tests and a BenchmarkDotNet performance suite.

Run tests with:

dotnet test

Run benchmarks with:

dotnet run --project tests/GridForge.Benchmarks/GridForge.Benchmarks.csproj -c Release -- list
dotnet run --project tests/GridForge.Benchmarks/GridForge.Benchmarks.csproj -c Release -- all --filter '*'

Benchmark reports are written to BenchmarkDotNet.Artifacts/results/.


๐Ÿ”„ Compatibility


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ‘ฅ Contributors

  • David Oravsky - Lead Developer
  • Contributions Welcome! Open a PR or issue.

๐Ÿ’ฌ Community & Support

For questions, discussions, or general support, join the official Discord community:

๐Ÿ‘‰ Join the Discord Server

For bug reports or feature requests, please open an issue in this repository.

We welcome feedback, contributors, and community discussion across all projects.


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 was computed.  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 was computed.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 86 3/11/2026
2.0.0 218 7/2/2025
1.3.0 209 7/1/2025
1.2.0 207 6/26/2025
1.1.6 230 6/19/2025
1.1.5 206 6/19/2025
1.1.4 208 6/18/2025
1.1.3 207 6/17/2025
1.1.2 212 6/16/2025
1.1.1 216 6/14/2025
1.1.0 340 6/9/2025
1.0.7 274 6/9/2025
1.0.6 180 4/11/2025
1.0.5 191 2/20/2025
1.0.4 163 2/20/2025
1.0.3 189 2/19/2025
1.0.2 197 2/18/2025
1.0.1 185 2/17/2025
1.0.0 187 2/17/2025