I am developing simple 2D game. I render tiled map and several moving entities, one of which is the character controlled by a player, and other ones are NPCs that are moved by simple AI strategy - chase a character using shortest path finding algorithm (tiled map data structure contains graph property that allows entities to find paths by BFS or Dijkstra).
I am wondering how should I handle collisions between those entities. I am currently able to handle collisions between an entity and tile map objects. But the problem is when more than 1 NPCs are engaged in chasing, they can end up overlapping each other, which is not what I want to see.
I was thinking about bounding box based collision detection, but it doesn't work well with path traversing algorithm, since sometimes velocity changes result in not natural chaotic movement.
Another way is to check if tile is currently occupied by an entity and prevent movement if needed. However this lead to a problem of recreating path (graph should be copied and reduced by one node, path should be generated again)
Third option is to create some kind of relation between all NPCs to prevent collisions or change their coordinates on demand. However this is not quite scalable solution.