BEEmod/BEE2.4

Pathfinding

Opened this issue · 2 comments

Description of the feature

A system for pathfinding between two points. It would need:

  • The option to follow walls
  • How many units it should travel before turning
  • How many units it needs to turn
  • What obstructions should it care about
  • What to do when it fails to find a path

Why should this be implemented

Ideally antlines, catwalks, vactubes, and any other item/feature that can use pathfinding should use the same system. This would make future items way easier and dramatically improve existing items. If antlines could be completely split to a new system they might even be able to follow blocks and angles.

Additional information

No response

There's many pathfinding algorithms developed by people, I just need to grab a library for it. Actually the way they work is based on cost - for each cell position, you tell it what connections are allowed (stairs, corners, etc), and how much each would "cost". Then it tries to find the route with the smallest cost. So for antlines for instance we'd want to add an additional cost to corners to discourage that, but we'd need to tune how much that needs to be.

A prerequisite system though is having a collision system, so we can tell where items are and not run straight through them.

This could also be useful for catwalks and gel pipes if we add dynamic test chambers in the future.