Implementing pathfinding for bots in my arcade game.

Feb 22, 2021 4:46 PM

Implementing pathfinding for bots in my arcade game.

It's still a little twitchy, but they follow paths well even when being pushed around and bouncing off other asteroids. The pathfinding uses the wonderful A* Pathfinding Project library, but because the game uses asteroid-style physics where there's very little friction and you have to thrust in the opposite direction to stop, the tricky part was implementing the movement to follow the paths.

In the end, it uses a blend of three different approaches depending on where the player is. There's a simple path follow for slow speeds, a closed-loop control system for middle and high speeds, and then a special slow-down-and-stop system for when it gets close to the target.

gif

video_games

indie_dev

gaming

indie_game