Dijkstra map for Godot

This GDNative plugin provides a Dijkstra Map pathfinding node for Godot, offering versatility for pre-computing paths in games like tower defense, RTS, and roguelikes. It is written in Rust and supports C# integration, providing a performance boost over GDScript.

https://github.com/MatejSloboda/Dijkstra_map_for_Godot

Preview Images

Preview
Preview
Preview
Preview

Enhanced Pathfinding with Dijkstra Maps in Godot

This GDNative plugin introduces a Dijkstra Map pathfinding node for the Godot game engine, offering a flexible alternative to the built-in AStar pathfinding. It excels at pre-computing shortest paths across an entire graph from a given origin, making it ideal for various game genres.

Key Features and Use Cases

  • Pre-computed Pathfinding: Efficiently calculates shortest paths for tower defense, RTS, and roguelike games.
  • Turn-Based Games: Simplifies listing available moves for turn-based gameplay.
  • AI Behavior: Aids in creating sophisticated movement-related AI.
  • Rust Implementation: Written in Rust for performance comparable to C/C++, significantly faster than GDScript.
  • Terrain Weights: Supports terrain-based pathfinding adjustments, allowing for different movement costs based on terrain types.
  • C# Support: Includes a C# wrapper for seamless integration and strongly typed inputs/outputs.

Installation and Usage

The plugin can be installed via the AssetLib or manually from GitHub. Manual installation involves compiling the Rust code and configuring the GDNativeLibrary resource in Godot. Example scenes and unit tests are provided to demonstrate the plugin's capabilities.

Performance Considerations

The Rust implementation ensures high performance, but threading is considered for further optimization in future versions. Using terrain weights allows for fine-grained control over pathfinding behavior based on terrain types, optimizing path calculations for diverse unit types and movement restrictions.

Resource Details

library

MatejSloboda



3.5.1