The creature in the game is called the Darting Flock. In the prototype, the center (shown as a white rectangle) is the controlling element. The green fliers try to guard it. As the player shoots their way through the flock, the controller creates more fliers that encircle it. Some even dive-bomb you. The fun is trying to cut a hole through the flock and shoot the center while dodging incoming fliers.
As described by the "boids" system, flocking works by having many objects follow a small set of steering rules. I've simplified the system more but also added some changes to it to keep it interesting. The new actions are: 1. Find the closest neighbor. 2. Follow a target position offset behind the neighbor by a random angle. 3. Recheck for the closest neighbor every few seconds. The exceptions are a few 'leader fliers' which need to know where the flock is going. They are forced to follow the controller at a certain distance, while all other fliers connect from there. When the leaders follow the controller, they are actually following a position just outside the controller that orbits the controller itself. This indirection gives even more motion to the group.
The blue lines in the image are between the flier and their target. The white lines are from the flier that is getting followed by another flier. You can trace the chain of fliers as they follow each other to see the order.
Flocking can be more expensive than homing from a processing standpoint since every flier has to check the distance to every other flier. By staggering and delaying how often this happens we can ease the burden on the processor.
Several neat behaviors come from this. The fliers may fly outwards suddenly but will eventually come back around, usually in a wild spiral. When the player kills fliers, for a few seconds some of them will follow their dead friends down before reacquiring a new neighbor! This makes the fight a lot more exciting and can create some really intelligent looking emergent behavior from relatively simple programming.
3 comments:
I love this - as it makes me want to play this game even more. I think my first experience with shooting a core amidst a "guarding mechanism" that contained motion was in the arcade Phoenix (like...a 25 years ago). But that was just the silly band of barrier after you shoot through the big mass at the bottom of the mother ship. There is something about an enemy with this sort of meat sheild that makes it that much more frustrating and rewarding to kill.
Of course, I would have named your new enemy Flocking von Flockington...but what do I know.
Sounds and looks awesome. I can't wait! Now how do I go about incorporating your flocking logic into a communications server? Life seeming suddenly boring...
Communications server? Ha! I can see the data following each other around, going to one server, then another. Not sure if that'd work out so well.
If you're bored, I've got a fun game you could help me on...
Post a Comment