FollowerEntity jumps back for one frame during moving

  • A* version: [5.3.8]
  • Unity version: [6000.0.47]

FollowerEntity bounces back one frame when moving. I was able to reproduce this behavior in a Unity test project. But the forum won’t let me post a link to the project and the video. How can I provide the project to Unity?

Thanks.

Give this a try now? Changed your user settings.

2 Likes

video

Unity project

Thanks.

Got it, gonna look into this soon! It may have to go on the plate for tomorrow as Unity is taking a lil bit to install on my machine right now. :thinking: If you haven’t heard back from me in a day or two feel free to bump this thread/tag me!

1 Like

So, what you’re seeing and what I’m seeing are two different ‘seeings’. My agent is not jittering around so wildly at all. What’s your system setup like? Also have you recently updated Astar especially major versions?

https://imgur.com/a/fHMmXD1

1 Like

Yes, I have.
A* version: [5.3.8]
Unity version: [6000.0.47]

I’m very sorry, I didn’t specify the name of the scene. It’s called “Move”, not “GraphMoverJitter”.
GraphMoverJitter scene works fine for me too.

So there’s a lot of things at play here. Some of it boils down to performance and some of it is implementation:

  1. Your graph is pretty dense. It’s not horribly dense (I’ve seen more insane). But depending on your game 250x250 with a node size of .4 could be rough. Try lowering your graph size and raising your node size- you don’t need that granular of detail for convincing movement. This is mainly an issue paired with this next point:
  2. Your Update Distance for your procedural graph is too short. The graph ends up calculating way too often which is causing some hitches when the graph is scanned again. It’s 5 right now, but try 20.
  3. Outside of Astar, your call to move your camera’s position happens at a sub-optimal spot. Instead of placing it in Update() move it to LateUpdate(). That had a huge impact.
  4. Your destination interval on your TestMover.cs script was set to 0 so, if I’m reading the code right, they were getting a new destination every… frame?? I set it to 2, 2.

So yeah specifically on this scene I changed these and it was moving much more smoothly. Hope this is helpful :smiley:

1 Like

Thank you for the recommendation on the settings. They really do make the movement smoother. However, I spent a lot of time specifically tuning them so that this bug would be reproduced consistently, making it easy for you to catch. The problem isn’t that the camera moves a bit jerkily, but that the FollowerEntity jumps backward by several meters.

I’ve slightly modified the test. Now, during the test, you can toggle the reproduction of this bug on and off. Just switch “Update delay” checkbox at the MainCamera. Also I leave the only one scene GraphMoverJitter2.

Update delay checked
Update delay unchecked
Updated project

  1. Your graph is pretty dense. It’s not horribly dense (I’ve seen more insane). But depending on your game 250x250 with a node size of .4 could be rough. Try lowering your graph size and raising your node size- you don’t need that granular of detail for convincing movement. This is mainly an issue paired with this next point:

In my game there aren’t just open spaces but also buildings with doors and furniture. It would be great if you could use multiple GridGraphs with different cell sizes and have seamless transitions between them.

  1. Your Update Distance for your procedural graph is too short. The graph ends up calculating way too often which is causing some hitches when the graph is scanned again. It’s 5 right now, but try 20.
  2. Your destination interval on your TestMover.cs script was set to 0 so, if I’m reading the code right, they were getting a new destination every… frame?? I set it to 2, 2.

When a mob pursues its target, I have to keep the distance and time values pretty small.

I’m seeing more what you’re meaning here now. I don’t know what your actual project looks/plays like so I have to make assumptions where I can, sorry about that.

This also answers the question of what the Update() in the camera script was doing- it’s, as the variable it’s attached to suggests, an update delay :joy: So now I see you’re using that to create an artificial performance bottleneck. I think I was missing that detail- that this was related directly and specifically to how FollowerEntity acts during sluggish performance.

So this leads me to a few questions and thoughts:

  1. How many units are you seeing in your game?
  2. Whats your graph setup like in your game? Size, and nodes and all.

If this is a performance related issue I think I need specific detail about your individual case. If you don’t agree that it’s performance related though, definitely let me know :slight_smile: Depending on your graph settings and game world it may be worthwhile to use a Recast Graph instead, too. It does work with Graph Mover after all.

This is an idea I’ve been playing around with in my head and meaning to try and cook up a custom graph to see if it works out. Feel free to post this in a separate thread as a suggestion for what it’s worth.

1 Like
  1. How many units are you seeing in your game?

10-20

  1. Whats your graph setup like in your game? Size, and nodes and all.

Exactly the same as in the project

I don’t quite understand. You think jumping back isn’t a bug? To me, agents should never jerk their position like that—let alone jump backward by a frame. It’s one thing if they slow down or pause because the path hasn’t been found yet due to performance limits. But their movement should always be smooth, without jerking back.

No yeah I agree that’s definitely not intended behavior… But only when you’re working within the confines of the limitations. Which you certainly are- you shouldn’t be seeing merely 20 units jumping around like that. I asked because I expected many many thousands of units to be active if you’re seeing jumping so drastically.

I guess here’s what I need to know more specifically myself: The project you sent me has the same graph set up, similar/the same agent set up, the same graph move settings, correct? And just like… what, the camera delay is the only real thing changed? Like you just took your project and added the delay to simulate the issue? Correct? Or am I missing something?

1 Like

Yes. I set the same settings in the project as in the game.
In the game, I use custom rules and also make some modifications to the A* project (the nodes include additional fields that are populated by those custom rules).

Here is the game settings


Hi

I think this is related to the same issue as the other scene you sent me the other day. Check the next beta release for updates and see if that makes it better.

1 Like

Hi,

When is this new beta release expected?