A* Pathfinding Project

Endless recalculation of the path from the destination


#1

I using pro-version.
Pathfind-type: Recast.
Small map, small objects and short cuts.

The agent ALMOST INCIDES to a destination that is not blocked. And the endless movement to this point begins, then the agent passes by and tries to bring it back.

Every 3-10 secods animal going to random point.
Animation RUN work, if AIPath.velocity != Vector.zero
All settings, logs in video: https://youtu.be/oOt1JwN_Lz8?t=8

It’s normal or bug?


#2

Up. Maybe there are developers of this product? I would be very grateful for the help.


#3

Hi

Does your “Enemy” script apply any sort of movement? I see that it has a velocity field.
Are you using the RVONavmesh component somewhere in your scene?
Is any sort of root motion being applied?


#4
  1. Enemy every 3-10 seconds a random point is selected, but the countdown of this time begins half as soon as it approaches the previous (reach) point at 0.6.
public class EnemyStateWander : State {
		public float nextWanderTime { get; private set; }
		public Enemy actor { get { return (Enemy) machine; } }


		public override void Enter() {
			base.Enter();
			actor.aiPath.destination = MovingUtils.RandomPoint(actor.spawnPosition, actor.homeRadius);
			//actor.SetRunning(true);
		}

		public override void Execute() {
			base.Execute();

			
			if (!actor.aiPath.hasPath) {
				return;
			}
			
			Debug.Log("==================== end path");
			
			nextWanderTime = Time.time + Random.Range(5.0f, 10.0f);
			//actor.SetRunning(false);
			actor.ChangeState<CreatureStateIdle>();
		}
	}

Entered to this State, if nextWanderTime < Time.time.

  1. enemy.moveSpeed not used.

  2. Yes, we are using RVO Simulator:
    http://prntscr.com/nqii2f


#5

That was not what I asked about. I asked about the RVONavmesh component.


#6

Sorry, misunderstood. RVONavmesh not using, only RVOController.


#7

It should not be? I can add debags if tell me which way to work better.


#8

Hmm… I’m not sure what could be the issue.
Do you get the same result if you try to create a new simple agent without any animation and other scripts? Just using the AIPath+Seeker scripts and optionally the AIDestinationSetter component.