AI can't go straight in plane constraint mode

Hi

I have a problem with AI in side scroller game.
My AI has plain constraint and walk between pathnodes.
These pathnode are on the same line with AI character.
It seems that in some cases (guess longer distance) my AI can’t go straight and making semi pathnode on the way, which is not on route to exact pathnode.
Problem is AI can’t reach it because movement is locked to 2D plane, so it turns and eventually quits and go to another pathnode using service.

Only workaround I found so far is to use “direct move to” node.

Is there any way to make AI move directly in 2D plane walking mode?

Here’s a video:

and screenshots:

It’s UE 4.10.1

Try to enable bUseVisibilityTestsSimplification flag in PathFollowingComponent (config settings). It should removed middle points from straight path segments. It makes small “post process” on path so it is disabled by default (performance optimization).

Hey hamsterPL,

Why do you need to restrict AI movement to a specific plane? I’m asking because it’s pretty strange to on one hand restrict AI to never leave a specified plane, and on the other hand giving it navmesh that by principle describes where AI is allowed to go. I’d suggest you picked one or the other, combination is not really supported.

Regarding bUseVisibilityTestsSimplification usage, I wouldn’t recommend it since it doesn’t work in non-trivial cases, and it’s going away in 4.13.

Cheers,

–mieszko

Hi Mieszko

I owe you some details :stuck_out_tongue:

This is 2.5D game - player can move only in left or right. That’s why I need AI to move in the same axis, that’s plane constrain in on. :slight_smile:

You are right - I could make narrow nav mesh along moving axis, but it’s not ideally solution - if AI run into another AI or jump on his head, generally when AI move into something rounded, he can change axis a bit - check the screen shot.

It is very unlikely, but it can occur.

Have you tried mixing both approaches? The main problem with your initial approach was that generated path was slightly off of the allowed movement plain. This should no longer be a (real) problem if you reduce navigable space, like on the screen you’ve attached.