Skip to content

Comment on Neat Algorithms - Flocking

Comments

I used flocking in a game project in college (getting ad-hoc starship fleets to get into ad-hoc formations) with another condition: When the basic requirements are met, each ship should also try to align with a master "fleet admiral" ship, and the group of boids under consideration was limited to only ships specifically defined as part of the fleet.

It kind of worked, there were issues with stragglers and making it look organic that I couldn't fix in time. If ships got too far outside the formation sometimes they would only try aligning with the leader instead of catching up first. Also, when they did get in formation, they were eerily good at matching the leader's alignment: all ships would turn in unison and kind of ruin the organic feel of the pure flocking algorithm.

Sounds like something you could have fixed with another, slightly randomized factor: "attention-span". Long boughts of straight flying would result in an increasingly large but seemingly random delay.

Cool sounding use case though!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.