Randomizing AI paths

Hello,

Is there any way to sort of randomize the path that an AI takes to its target? We’ve found that our AI enemies always take the most direct route to attack the player, and in gameplay it just ends up like a line of ants all trying to get to the food, but we’d like them to spread out and take multiple paths instead of the most direct line. This was easier in older Unreal engines where path nodes still existed, what we did was to slightly randomize the cost of each node so that they’d take more organic routes and not all follow the same line like robots. Is there any way to do this with the default navigation code?

Thanks

Not anymore really, since the engine now uses a completely different navigation system so the AI can plot a path itself rather than follow pre-determined ones.

All I can suggest for now, is enabling and using RVO avoidance to cause the characters to ‘steer’ away from one another. It’s a very cheap way to make it look as though AI are avoiding each other, simply by modifying the velocity of the object. Since characters auto-magically turn to follow whatever direction they’re moving in, it should be relatively trivial to setup.

Anything outside of that will require a bit more hands-on programming I’m afraid.

EDIT: Also, gonna move this into the AI sub-forum.

Edit #2: Oh, we don’t have one…

Okay, I’ll take a look at that for starters. Thanks for the info.

You can check out the game ai tutorial series they’ve been doing on the livestream or watch this video. You should be able to set your enemies to influence their pathing so that they don’t crowd near each other.