Crowded Destination with Follower Entity

Hello!
I am working on Starcraft-like RTS game. I just upgraded to the Follower Entity for the performance gains and so far it’s great! I’ve got a couple of questions:

  1. I saw in the feature list here that it supports automatically stopping when reaching a crowded destination when using local avoidance. Is this supported yet? I don’t see any settings or mentions of it in the code and having trouble getting it to work.
  2. When moving a big group of units to the same destination, none of the units ever reach their destination, keeping them stuck updating their path every 2s. Is this expected?
  3. In the video you can see that the units in the front seem to move faster than the ones in the back, creating a variation in how they move. Can’t seem to adjust the settings to remove this effect. The desired behavior is they all move at the same speed.
  4. At the end of the video you can see the units sometimes smash other units into the walls causing them to flicker. Any recommendations on how to avoid this?
  5. In the second video, you can see a unit trying to go through a crowd of units. The unit makes it through but really slows down in the process. Is there a way to make it so the moving unit’s speed is preserved? Is this a symptom of the unit’s in the cluster being stuff in their move command and not in an idle state?

Thanks so much and appreciate this tool a lot!

Video 1:

Here’s the second video!

Video 2

Hey there! I built an empty test environment to try this out and see what I could figure out. I’m playing with this now and learning what I can, and will answer what I can!

Starting with #4,

At the end of the video you can see the units sometimes smash other units into the walls causing them to flicker. Any recommendations on how to avoid this?

I turned on ‘Use Navmesh as Obstacle’ and that kept them from getting wonky against the walls. Check it out here, under the section labeled “Keeping the agents on the navmesh”.

Looking into the other ones now to see what I can find.

Adding on to this, for #5:

In the second video, you can see a unit trying to go through a crowd of units. The unit makes it through but really slows down in the process. Is there a way to make it so the moving unit’s speed is preserved? Is this a symptom of the unit’s in the cluster being stuff in their move command and not in an idle state?

So I myself wasn’t able to find any direct options that say something like “keep speed in crowds” or anything like that. However I was able to mimic the effect in a few ways. For starters, playing with Priorities, the radius of the units, and max neighbors can make for wildly different results.

In this case, what I would personally do (and Aron please feel free to let me know if this is overkill or overengineering) is I’d probably try to write some code to detect upcoming groups of units- Maybe at the center of units with unified orders, take note of the Vector3 closely corresponding with the crowds center. Then you can check along the path to see if that group spot intersects with the moving unit’s path- if so, something like a boxcast could tell them to all move to the side and clear a path.

That’s just my first thought- I wouldn’t call it the smartest or most performant, but I think with a bit of custom logic + playing with individual agent’s properties could yield some positive results.

EDIT: Piling on an answer for #2 here:

When moving a big group of units to the same destination, none of the units ever reach their destination, keeping them stuck updating their path every 2s. Is this expected?

This is expected yes, with the Dynamic Repath Policy. The default period to recalculate paths under this mode is every two seconds, even if the destination hasn’t changed. If the destination has changed drastically (Check this for more details on the math that would count as “drastically”), then the unit will calculate a new path. But even if the destination hasn’t changed at all, it will recalculate in regular intervals. Try “Never”, if you don’t think you’ll be pathfinding to moving objects, otherwise, you could change the period to something north of 20 seconds or whatever you see fit.

Thanks for posting your findings, I was having similar issues and the navmesh as obstacle fixed it :slight_smile:

1 Like

Thanks for posting your findings, I was having similar issues and the navmesh as obstacle fixed it :slight_smile:

Glad to help!!

@Pawn, got one more “answer” for you here as well, for number 3:

In the video you can see that the units in the front seem to move faster than the ones in the back, creating a variation in how they move. Can’t seem to adjust the settings to remove this effect. The desired behavior is they all move at the same speed.

So, I’m not seeing anything that has any effect along the lines of “keep units at X speed”- realistically I’m not even sure how that could work, but, depending on your other settings, the “Position Smoothing” slider may help keep units actively moving.

EDIT: Also, last one! For the first question:

I saw in the feature list here that it supports automatically stopping when reaching a crowded destination when using local avoidance. Is this supported yet? I don’t see any settings or mentions of it in the code and having trouble getting it to work.

Yes this is supported. From what I’m understanding about it, it’s moreso an “automatic” thing, where they will stop before getting to the actual destination, but then try moving towards it again when space is available. The funny thing about that, is that when things are working as intended, it’d be hard to notice if they’re actually stopping. It is implemented though :+1:

And with that, I think that’s all the questions! Let us know if you need any more help!