How i make RichAI change path immediately

Hi All

for the user operate unit(with RichAI & ROVController) , i want it can fast respond.

something like p.BlockUntilCalculated()

//Fake code
ABPath p = RichAI.GetNowPath();
p.BlockUntilCalculated();

you can see in the gif

user fist click time is 1.11s
path change at 1.27s (Gap = 0.16s)

the second one click time is 4.28s
path change at 5.12s (Gap = 0.84s)

the path calucalte sometime veryfast,sometime is not.

i search in forum. some one have the same issue


i already call SearchPath on each time the unit set new destination. but seemd not working .

also i try block calculate the seeker path immediately. but still not right.

if (mIsFastRespond)
{
    mRichAI.SearchPath();
    mSeeker.GetCurrentPath().BlockUntilCalculated(); //same seeker attach with richAI
}

need help for that.

Thanks.

Hi

Doing:

ai.destination = ...; (or move the target for the AIDestinationSetter)
ai.SearchPath();

should be very fast. Within a frame or two it should update its path.
You can also do

seeker.GetCurrentPath().BlockUntilCalculated();

afterwards to force it to complete within the current frame, but usually that is not necessary.

But you seem to have already tried this, I’m not sure why it wouldn’t be working for you…

turn out is my mistake :sob:

the top AI logic for the performance issue , slow down the AI tick function . so there will be a dely for truly set the destation to RichAI.

problem solved.

thanks for your help :grinning:

1 Like