RichAI Path Length

Hey! Id like to use a RecastGraph and RichAI to get some debug infos about the level im creating (since that configuration worked for me out of the box). I’m interested in the total length of the final path, that the RichAI would actually use. (after it’d been altered by richfunnel(?))

In the seeker I can " GetCurrentPath().GetTotalLength() " but thats not what I really want. Do I have to let the bot actually walk the path and measure the time it needs?

I also tried to use layeredgridgraph, and I think it would give me a way better estimate of how long the way actually is, but i’d have to rebuild most of my levels for it to work (they are all one giant object in the same layer) and id like to avoid that…

Hi

The RichAI component doesn’t know the full length of the path. It only uses the funnel algorithm on a small part of the path at a time to get the next few corners to move towards.
What you can do is to attach the FunnelModifier to the same GameObject as the RichAI, the funnel modifier will simplify the whole path (the RichAI component will completely ignore whatever the FunnelModifier does to the path). Then you will be able to use GetTotalLength and get a more reasonable result.

wow, that was a really fast answer and it works like a charm! ty very much!!!

1 Like