Avoidance Question

EDIT:

Okay let me rewrite all of this cause I think I straight up was confused…

Dynamic Grid Obstacle are for things that are moved into the scene after the grid has been scanned, if I’m understanding…

So what is the difference of the SingleNodeBlocker and the Local Avoidance?

I’m working on a multiplayer grid-based movement, non turnbased game, with a large world… I know currently that I can technically update movements of players/monsters via Dynamic Grid Obstacle, but from my understand that generally isn’t a good idea as it can cause some issues with them trying to avoid themselves if I recall reading… What would be the best course to have both entities to avoid each other when trying to get to a particular spot on the map?

Okay after I did some looking…

I think what I technically need is something like local avoidance, but without the movement via velocity being set.

Is there anyway to set it up to move via a grid based movement using rigidbody.moveposition? (not little by little, but using set locations 1 unit apart (grid movement)? Or is that something more in terms of how the SingleNodeBlocker is set up?

Perhaps there is a better system for it, but for the time being I’ve began setting Heavy penalties in the player/monster nodes to deter others from walking there and did a simple raycast to the position if the monster/player tries to move there anyway just to help the chance they try to stack. I’m sure there is a much cleaner/better way to do this so hopefully someone here can chime in.

Hi

Grid based local avoidance that is non-turn based is not trivial to do.
Especially with multiplayer you pretty much will have stacking agents unless you use a master server to validate everything and calculate the paths. So I think your approach with penalties is reasonable.
A SingleNodeBlocker (or something else based on an ITraversalProvider) would work pretty well too.

So all my movement is done through server side authority, so it’s the only thing really authenticating the movement so there’s not a bunch of different actors from different clients deciding movement.

I’ve tried to use the SingleNodeBlocker but I had no luck getting it to properly route. If my understanding is correct with it, the obstacles that the ITraversalProvider uses needs to have a list of every SingleNodeBlocker in the scene/area to move around that particular node. So I’d need to have a dynamic list that has monsters and players on it. Then keep it updated on the movement script for the ITraversalProvider to use. The list though isn’t dynamically update right? I’d have to keep calling for a new ITraversalProvider each time something is added or removed?

It depends on how your implement your ITraversalProvider. You could for example alternatively use a large boolean array, or a hash table. It’s up to you.