[go: up one dir, main page]

Skip to content

Metaphoriker/pathetic

Repository files navigation

Transparent

Pathetic - A Pathfinding library for Minecraft

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.

Key Features

  • 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 and extract 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.

Showcase

ezgif-3-caa688a773

Installation

To integrate pathetic into your project, follow the following steps:
(We advise you to relocate pathetic)

Maven

<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>

Gradle

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.Metaphoriker.pathetic:pathetic-mapping:VERSION'
}

Example Usage

See the pathetic-example module for a detailed example usage.

Documentation

View Javadocs

Contributions

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!

Discord Server

Join our Discord server to get in touch!

Sponsored By

Pathetic is sponsored by JetBrains.

JetBrains_beam_logo