Greetings,
Is it possible to modify the RVO movement so it doesn’t rotate the character without breaking the RVO system?
Using A* Pathfinding Pro 4.0.10
Thank you.
Greetings,
Is it possible to modify the RVO movement so it doesn’t rotate the character without breaking the RVO system?
Using A* Pathfinding Pro 4.0.10
Thank you.
Hi
The RVO system doesn’t care about rotation at all. It’s the movement script that does this.
Which movement script are you using?
If you are using the AIPath movement script then currently it is not possible to disable rotation from the inspector, however you can easily change the right line of code:
Take a look at this topic: AI Path Movement without Rotation
Looking good! Just need to fix the the agents going outside of the wall.
Thanks
Hi
Try to add a single RVONavmesh component to the scene. This assumes you are using a recast, navmesh or grid graph however.
See https://arongranberg.com/astar/docs/class_pathfinding_1_1_r_v_o_1_1_r_v_o_navmesh.php
There is indeed already a RVONavmesh in the scene. I am also using a grid graph. Is there a configure step I’m missing?
The wall issue has been fixed, just added a collider2D to make sure the Agent never goes out of the wall.
I have an issue with the enemies stacking on each other when reaching the target. Although it is not necessarily in issue for my game, when there are more than ~20 agents following a target the stacking becomes problematic where they wont try to avoid the local RVOs agents whatsoever and get stuck in between each other. My AI system stops CanMove on the AIPath script (I also tried Locking the RVOController but to no success) when the agent reaches a certain distance. Maybe I am misunderstanding how RVOs are supposed to behave. I also tried messing around with every parameter but the outcome remains the same. Any idea?
Hm… I do not know why they are not properly avoiding each other. Locking the RVOController (and probably setting ‘Lock When Not Moving’ to false because otherwise that will repeatedly set the ‘Locked’ field) is definitely the way to go.
If you just set the ‘Can Move’ field on the AIPath script then the AIPath script will stop doing everything related to movement. This includes handling local avoidance so even though the RVOController tells the AIPath script that it should move to avoid a collision, the AIPath script will just ignore it. Setting the ‘Locked’ field on the RVOController informs the local avoidance system that the agent will not move out of the way to avoid collisions.
I replaced all my CanMove = false to Locked = true, the problem still persists. I took a look at the source code and I don’t see what could be causing the RVO to stop working.
It seems like when the RVO is getting closer to the target, even without reaching it, it disregards the RVO behavior
Is there perhaps some other script that is also moving the character?
Also. I looked in to why the RVONavmesh component didn’t work for you.
I’m not really sure how, but it seems I have introduced a bug recently that caused it to stop working for 2D games. I have fixed this now and it will be included in the next update.
I’ll test out the new RVONavmesh component once it gets released, thanks.
The only thing moving my AIs is this simple block of code. When the weight is appropriate, the coroutine gets executed. I’m still looking into the issue though. I’ll keep you updated if I find something.
public override IEnumerator _Execute(Brain brain)
{
brain.isExecutingAction = true;
brain.pathfinder.target = brain.entity.highestThreatTarget.entity.transform;
brain.pathfinder.canMove = true;
brain.rvoController.locked = false;
while (!brain.isInAttackRange) {
if (brain.entity.highestThreatTarget == null)
break;
if (requiresLos) {
if (brain.CheckLineOfSight(brain.transform.position, brain.entity.highestThreatTarget.entity.transform.position, brain.entity.highestThreatTarget.entity.name, losMask, brain.attackRange))
break;
}
yield return null;
}
// ADD Clean up so pathfinder stop searching.
//brain.pathfinder.canMove = false;
brain.rvoController.locked = true;
brain.isExecutingAction = false;
}