I added collision detection to the game, so now all the characters test against each other and the inanimate objects. The results are not pretty.
The problem here is not collision detection, which is being done properly. The problem is collision resolution. Right now I’m treating all objects in the game as totally inelastic, which means that when they collide their velocities are swapped. That’s simple. The problem is that I also need to push them far enough away from each other that they don’t just collide again next frame, and swap their velocities back, which will cause them to get stuck forever. We can clearly see that happening to the hunters at the end there.
Right now I’m just going with the hackish “change velocity appropriately, then move them by double what we would normally move them by according to their velocity”, which kind of works, but has those cases, like with the hunters, where we get trapped in the infinite loop. What I really need to do, is calculate the shortest path to not colliding, then move them a bit.