GridForge 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package GridForge --version 1.0.4                
NuGet\Install-Package GridForge -Version 1.0.4                
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="1.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GridForge --version 1.0.4                
#r "nuget: GridForge, 1.0.4"                
#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.
// Install GridForge as a Cake Addin
#addin nuget:?package=GridForge&version=1.0.4

// Install GridForge as a Cake Tool
#tool nuget:?package=GridForge&version=1.0.4                

GridForge

SwiftCollections Icon

.NET CI

A high-performance, deterministic spatial grid management system for simulations and game development.


๐Ÿš€ Key Features

  • Deterministic Execution โ€“ Supports lockstep simulation and fixed-point arithmetic.
  • Optimized Grid Management โ€“ Low memory allocations, spatial partitioning, and fast queries.
  • Multi-Layered Grid System โ€“ Dynamic, hierarchical, and persistent grids.
  • Node-Based Spatial Queries โ€“ Retrieve occupants, obstacles, and meta-data partitions efficiently.
  • Custom Blockers & Partitions โ€“ Define obstacles and attach metadata dynamically.
  • Framework Agnostic โ€“ Works with Unity, Lockstep Engines, and .NET-based frameworks.

๐Ÿ“ฆ 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 grids, nodes, & spatial queries. | | Grid | Represents a single grid containing nodes & scan cells. | | Node | Represents a grid position, storing occupants, obstacles, & state. | | ScanCell | Handles spatial indexing for faster queries. | | GridTracer | Efficiently retrieves covered nodes, scan cells, & paths. | | GridObstacleManager | Manages grid-wide obstacles dynamically. | | GridOccupantManager | Handles occupant tracking & retrieval. | | ScanManager | Optimized scan queries for spatial lookups. | | Blockers | Defines dynamic and static obstacles. | | Partitions | Adds meta-data and custom logic to nodes. |

๐Ÿ“– 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 Nodes

Vector3d queryPosition = new Vector3d(5, 0, 5);
if (GlobalGridManager.TryGetGridAndNode(queryPosition, out Grid grid, out Node node))
	Console.WriteLine($"Node at {queryPosition} is {(node.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 Node

if (GlobalGridManager.TryGetGrid(queryPosition, out Grid grid, out Node node))
{
    PathPartition partition = new PathPartition();
    partition.Setup(node.GlobalCoordinates);
    node.AddPartition(partition);
}

๐Ÿ”น Scanning for Nearby Occupants

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

๐Ÿงช Testing and Validation

GridForge includes comprehensive unit tests.

Run tests with:

dotnet test

๐Ÿ”„ Compatibility

  • .NET Framework 4.7.2+
  • Unity 2020+ (via - GridForge-Unity.)
  • Supports FixedMathSharp for deterministic precision
  • Supports SwiftCollections for optimal performance

๐Ÿ“„ 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.

๐Ÿ“ง Contact

For questions or support, open an issue on GitHub.

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • No dependencies.

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
1.0.5 47 2/20/2025
1.0.4 38 2/20/2025
1.0.3 64 2/19/2025
1.0.2 80 2/18/2025
1.0.1 84 2/17/2025
1.0.0 80 2/17/2025