A* Pathfinding Project

RVO weird behavior


#1


#2

Hi

Do you think you could post your movement script and RVOController settings?
Also which version of the package are you using?


#3

It should be 4.1.10, according to changelog, I downloaded it today or yesterday.

I believe settings were same as in RVO 2D example or very similar. Changed it several times so I dont remember but the behavior is still same.

Do you want me to post my current settings?


#4

Yes. Posting your current settings would be nice.


#5

I tried to tinker with all the settings and it seems the behavior is still same. From left to right, it tries to avoid, from right to left, it come through directly (half of each yellow circle overlaps).

My code is simple, I just call StartPath:
owner.seeker.StartPath(owner.transform.position,owner.moveTarget);

All the settings on image are on actor except RVO simulator, which is on some random object in scene (yes, there is only one copy of it). Enlarge the image since preview shows only half of it.

Thanks for fast support anyways!


#6

So do you know what is happening? :slight_smile:


#7

Hi

One thing. If you are using the AIPath script you shouldn’t use seeker.StartPath. That’s mostly for when you are writing your own movement script. Use AIPath.destination = someValue instead.
See https://arongranberg.com/astar/docs/aipath.html#destination

Can you replicate this in the example scene?


#8

I found out that it must be the script I am using because I was not able to simulate that in example scene and moreover, if I use AIDestinationSetter, it works.


#9

After like 6 hours of debugging, I finally found out what is happening. My script flips the character when walking opposite way, multiplaying the X scale of master container by -1. That is, why the problem happened only when walking from right side to the left.

Can you help me fix it?


#10

Hi

Ah. Well, I’d suggest putting your graphics on a child object which you flip instead.


#11

No other way? Will be lot of work.


#12

Hi

In the RVOController.cs script you could change the line

rvoAgent.Radius = Mathf.Max(0.001f, radius * scale.x);

to

rvoAgent.Radius = Mathf.Max(0.001f, radius * Mathf.Abs(scale.x));