A* Pathfinding Project

Curved trajectory for Agents


#1

Hello, I’ve made a grid graph and some agents using the RVOController.
I wanted the agents to follow random paths so I adapted the AgentWanderer Script. My problem is the ships are working but they don’t move naturally as I would like to and I dont know how to make it.
This is how they currently move:

https://youtu.be/AZxxFQSTtOA

And this is how I would like the boat to move when possible:
57

The magenta ray is the raycast my random script throws and if detects no obstacles are there chooses that direction to set a point (after that I check if the point is valid or not), and then I move it using the RVOController.

This is the setup of the agent:

Am I asking too much for the agents ? :sweat_smile:
Thanks,
pistoleta


#2

You could try messing around with the rotation values.
Additionally manually calculating x-amount of in between points. That the agent will navigate through.

Similar to similar posts about car movement, there is a lot of details here that modify the behaviour.


#3

Thanks ToastyStoemp for your answer,
but the only rotation value available for RVOControllers I see is rotation speed.
Anyway Ill try to find those car movement posts.
Regards,
pistoleta


#4

It’s definitely a tricky subject. Especially with RVO I’ll put it on my list of future project ideas :slight_smile:


#5

Are you also developer of the asset ToastyStoemp?


#6

Nope, just helping out where I can.
Though I’ve been trying to work on some extension modules for the asset :slight_smile:
Allows me to work on small simple pieces of code, and I learn more about the A* PP through using the various utilities it offers :slight_smile:


#7

I see, interesting, are you specialized on C# ? or do you come from another language?


#8

Let’s talk over Direct message, that way we can keep the forum posts focused on their individual topics


#9

I’d. like to bump this up since I didn’t find a satisfactory way of doing this. :roll_eyes:


#10

Hi

Curved trajectories are kinda tricky. This library does not support planning with curved trajectories because it requires a lot more state and changes to the algorithms to work.
On an open area like the sea you can in most cases assume it is possible to take a relatively direct turn towards the target.

There’s nothing in this package that does this, but I can recommend the chapter “Postprocessing for High-Quality Turns” in the book AI Game Programming Wisdom 4 which details how the game Company of Heroes does it. There is a really old path modifier in the package called “Advanced Smooth” which does some of what is described in that article, however it doesn’t take the starting direction of the agent into account.

Local avoidance based on RVO is more intended for bipedal agents. The reason is that one of the assumptions in that algorithm is that agents can change their velocity instantaneously, which is something that ships have a very hard time doing (they have to turn around).