A high-performance, backwards-compatible, and asynchronous easy-to-use pathfinding library written in Java.
Pathetic leverages the A* algorithm with customizable heuristics for real-time pathfinding in Spigot/Paper environments.
- Advanced A* Algorithm: Employs multiple distance metrics (Manhattan, Octile, Perpendicular) and height differences for pathfinding, optimized for 3D worlds like Minecraft.
- Asynchronous Pathfinding: Non-blocking operations using
CompletableFuture
to minimize server impact during pathfinding. - Fibonacci Heap for Efficient Queuing: The open set (frontier) is managed using a Fibonacci heap, ensuring optimal node retrieval with faster
insert
andextract min
operations. - Customizable Heuristics: Fine-tune pathfinding behavior using
HeuristicWeights
for balanced navigation in any world configuration. - Regional Grid Optimization: Uses
ExpiringHashMap
and Bloom filters to efficiently track explored regions, minimizing memory overhead. - Dynamic Path Filters: Define custom filters to modify node validity or prioritize paths based on criteria such as passability, block type, or world boundaries.
To integrate pathetic into your project, follow the following steps:
(We advise you to relocate pathetic)
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.Metaphoriker.pathetic</groupId>
<artifactId>pathetic-mapping</artifactId>
<version>VERSION</version>
</dependency>
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.Metaphoriker.pathetic:pathetic-mapping:VERSION'
}
See the pathetic-example module for a detailed example usage.
We welcome contributions! Feel free to fork the repository and submit pull requests. For major changes, open an issue first to discuss what you'd like to change.Special thanks to @Ollie, the co-founder of pathetic, who helped building up pathetic in the very beginning!