Using A*PP in a different coordinate orientation

Hi Guys. I’m just evaluating A*PP for my next game and was trying to make aGrid Path from a mesh I have where it’s oriented along the X/Y plane. It’s a 2D game and therefore all my graphics will sit flat on the X/Y plane. I would like the path generator to effectively scan INTO the scene but it seems to still scan “down” the Y axis.

Can A*PP handle this situation or will I have to generate my paths in one orientation and then in my code translate all the returned coordinates from the path into my own orientation. e.g. Take every Z coordinate and use it for the Y coordinate?

Many thanks
Aaron

Hi

Most pathfinding logic tries to avoid assuming coordinate conventions.
But some things do, especially movement scripts.
The grid graph works best with XY, it can be rotated freely and does not depend on XZ coordinate usage at all.

The funnel modifier requires XZ coordinate usage.

One trick you can use is to convert all coordinates from XY to XZ coordinates when requesting the path, and then convert back to XY coordinates when you get the path back.

Not sure how well this plays with the game, but it might work.

Hi Aron, thanks for the reply.

How does the GridGraph generator know which way to cast the ray in order to look for collisions/no ground? Does it take the GridGraph rotation parameter and use that to calculate the direction?

If so, does that mean so long as I have rotated the GridGraph bounds over my mesh (In the X/Y plane with ditches going into Z) it should find the nodes? What I’m getting is no nodes are found - I guess my issue is to do with Graph generation at present, and not paths so sorry if that confused you.

Hope that makes sense.

Thanks

Yes, it uses the rotation setting to cast the ray in the correct direction.

The graph should be generated correctly in any orientation. So if you are not getting any results now, it is not because of the rotation (possibly you might want to rotate it 180 degrees around the Y axis so that the correct axis is up in graph space).