A* Pathfinding Project

Does the A* pathfinding project support (realtime) rotation?


#1

Hello,

I am interested in this product, but my use case is possibly a little bit different from most.

I am making a game where a lot of the gameplay takes place on a moving and rotating object (a spaceship).

AI characters are parented to this spaceship, and move and rotate as the ship does.

Is this going to cause issues with the pathfinding project? IE, is it possible to generate correct pathfinding solutions on board a ship that is moving and rotating in real time?

I came across this post:

That seems to indicate that it is possible, but tricky, to do this, but that is from 2013, so I am hoping things have changed since then?

Thank you for any advice.


#2

Hi

In the pro version there is an example scene called ‘Moving’ which shows pathfinding on a moving ship. This is not that well documented at the moment, but it does work reasonably well. It is only implemented for the RichAI movement script at the moment.
If possible I would suggest keeping the spaceship fixed and move the rest of the world though, that will solve a lot of other problems if you e.g use physics or anything like that.


#3

That’s good, I’m glad that it seems to be possible.

Keeping the ship fixed and moving the world is something I may end up doing in the future, it would solve a few problems, but there are some technical reasons why I can’t do that at the moment.

Thanks for your reply.


#4

Ok.
Also note that what my scripts do for this case is that they keep track of the ship’s orientation and then transform the path request coordinates from ship space to graph space when a path is requested. The graph does not actually move, it is in a fixed position in the world. So movement works well with this, however updating the graph can be quite tricky because the ship is not actually at the some position as the graph.


#5

Right, so it’s a little like a “floating origin” system? That’s actually what I am currently using already for moving the ships over long distances.


#6

Sort of.

Here are the two relevant scripts that are used to add support to it to the built-in RichAI movement script.
https://pastebin.com/MDRySrge
https://pastebin.com/MtnkrcE9


#7

Thank you, that’s very helpful.