JeremyLeland / caves

0 stars 0 forks source link

Enemies should avoid each other #12

Open JeremyLeland opened 3 years ago

JeremyLeland commented 3 years ago

I tried this by tracking occupants of nodes in the pathfinding. This just led to some really awkward pathfinding. Rather than try to go all the way around, they should wait until the optimal path is clear.

They should try not to cluster when attacking the player, but the constant running around to vacant nodes is nauseating. They should try to flock or something instead.

JeremyLeland commented 3 years ago

This gets complicated if enemies are trying to go opposite directions through a bottleneck. If someone just waits, it's always possible they will be preventing anyone else from doing anything. Maybe it's better to try to prevent clustering by limiting the number who attack at once, having them head near the player rather than directly to them, have them take quick breaks if they are close to each other, etc.

But don't enforce any of this, or you'll just get deadlocks.