How to make different players can avoid each other - without using RVO

HI,
In my project, I need players can avoid each other. but I don’t want to use RVO.
for example:
1、In one line, there are three positions: A,B,C.
2、B is in the middle of the AC.
3、player1 is standing on the A and player2 is on the B.

How can I just using A* pathfinding pro to go to C. My ideal solution is that A* pathfinding can give me a path from A to C without passing through B.

Thanks advance.

Hi

Ideally this requires some kind of cooperative pathfinding (which I have done experiments with, but nothing is released yet, and it will probably not be released for a while) so that it can take into account how the other agents move.
If this is a turn based game it is easier however, but for other games this will also work to some degree: use a graph update to mark the node under the players with their own unique tag (e.g tag 1 for player 1, tag 2 for player 2 etc., I’m assuming here that you have less than 31 players) and then set each Seeker’s allowed tags to be only the default tag and their own tag. You can alternatively allow all tags, but have a really high penalty for moving into other players. This might be preferable because usually the other player has moved when the player gets to the position the other player had when the path was calculated.

See http://arongranberg.com/astar/docs/graph-updates.php
See http://arongranberg.com/astar/docs/class_seeker.php#ab2deda12dc8cad2e4263b8d051ca92f9

Haha, Thanks for your response. I’ve used your way to solve my problems.:grinning:

1 Like

How did you solve it?

I have been reading up on these methods and have a question. I have the graph update set up and set the tags that each AI can walk on. What method do you use to change the tag that the AI is on?

To change the tag of the node(s) nearest your Seeker, you’ll probably want to do something like this:

csharp

Bounds bounds = new Bounds(transform.position, seekerRadius);
GraphUpdateObject guo = new GraphUpdateObject(bounds)
guo.modifyTag = true;
guo.setTag = seekerTag;

AstarPath.active.UpdateGraph(guo);

Where seekerRadius and seekerTag are your corresponding values.