Hi everyone i work on a game , on this a lot of people walk from waypoint to waypoint randomly , but some time this people Collision together that is sound too bad , how can i fix it !?
I am using A* in our RPG which is tile based. Players and enemies have two gameobjects with box colliders attached. One for the current and another I use to reserve the next tile while the controller moves the player or enemy from tile to tile. When not moving this 2nd collider is hidden.
My A* implementation raycasts tile centre to tile centre at head height above the tile’s floor and therefore sees these box colliders as impassible. Granted this does mean that the paths fail where two enemies walk in opposing directions but it is sufficient for m purposes and seems to scale well enough so far.
You could of course, upon collision with these box colliders during pathing attempt to negotiate with the owning enemy and naturally there may actually be a path by the time the enemy gets there, but it’s reasonable to just repath later, if potentially computationally more expensive.
Hope that helps
Ian H