How to make a 2D free movement with dynamic obstacles system?

Hi. I just started using the A* Pathfinding, and I need some help with my game.
It’s a 2D strategy game, and it is NOT grid-based. I have some agents in a scene, and these agents have to attack each other using an AI system.

So far, it’s working, but I needed a way for them to get to each other by looking for a path, and also, to keep a good experience, one agent should not pass through another agent. The agents are moving constantly, so I also need to recalculate the graph every time (which I did, and it’s working properly so far).

The problem is: I tried using A* with the grid graph, but I used the nodes size the same size as the agents size, which caused weird movement. So I tried reducing the nodes size, and now the movement is very fluid, however, the agents are passing through one another. It’s like they are ignoring the tiles because they are too small, however, if I mike them bigger, the paths do not work properly.

The movement is working correctly, but the agents are passing through one another.

Is there any way to solve this? Just to clarify: I need free movement (not grid based) of agents that are constantly moving, and when moving to their target, they cannot pass through one another, insted, they should turn around.

Thank you.


I would strongly recommend that you use some kind of local avoidance for this instead.
Using pathfinding for this gets really tricky.