Star

Description

The A* algorithm is a pathfinding algorithm: it can be used to search for paths between points in a graph. This mod provides a pathfinding function that can be used to perform such searches in the voxel-based fame world of Luanti. It can be used, for instance, for mob AI.

The intent of this mod is to provide a better alternative for Luanti's built-in pathfinder core.find_path. Although the built-in pathfinder is fast, it lacks various useful features, such as the ability to work with mobs larger than 1x1 nodes. Therefore, this implementation allows specifying width and height and comes with various other improvements.

These improvements are not completely free, and searches will take longer: (on my machine, CPU: Ryzen 5) the built-in core.find_path often takes far less than 1 ms to produce a path. In contrast, it is rare (again, on my machine) for star.find_path to take less than 1 ms. However, the performance is, in my opinion, acceptable after several runs. Maybe LuaJIT somehow optimizes it?

Current status:

  • Entity size works
  • Avoiding danger (lava, etc.) works
  • Climbing ladders works
  • Diagonal movement works?

Testing tool disabled starting from 2026-01-18.

API 🔗

star.find_path(pos1, pos2, settings) 🔗

Returns a path as a flat array (from end to start): {x1, y1, z1, x2, y2, z2, ...}

Arguments:

  • pos1, pos2: {x = ..., y = ..., z = ...}
    • pos1 is the starting position and pos2 the target position.
  • settings: {height = ..., etc.}

Settings (values must be positive natural numbers):

  • width: Specifies the object size along x- and z-axes. Defaults to 1.
  • height: Specifies the object size along the y-axis. Defaults to 2.
  • max_jump: Specifies the maximum jump height. Defaults to 1.
  • max_drop: Specifies the maximum drop height. Defaults to 1.
  • max_iter: Specifies the maximum number of main loop iterations before quitting. Defaults to 256. For now, has a hard limit of 1024.
  • climb: Sets the ability to climb ladders (true or false). Defaults to false.

TODO:

  • Weighted terrain
  • Sometimes behaves weirdly???

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

2026-01-23

Download

Luanti 5.13+

2026-01-23 17:56 UTC

2026-01-23 🔗

  • Diagonal movement
  • Fixed some issues

2026-01-18-EXP

Download

Luanti 5.13+

2026-01-18 12:09 UTC

2026-01-18-EXP 🔗

  • Added setting to enable climbing
  • Climbing is now disabled by default

2026-01-17-WIP

Download

Luanti 5.13+

2026-01-17 16:23 UTC

2026-01-17-WIP 🔗

  • Added capability to climb ladders
All releases

Information

Provides

star

Dependencies

Required
priority_queue

Information

Type
Mod
Technical Name
star
Languages
English
License
GPL-3.0-or-later
Maintenance State
Beta
Added
2026-01-10 11:40 UTC
Maintainers
Wiz