Sponsored By

GCG Feature: 'Book Excerpt: Killer Game Programming in Java'

In the latest technical feature for Gamasutra sister educational site Game Career Guide, we present an excerpt by Andrew Davison from _Killer Game Programming in Jav

Brandon Boyer, Blogger

December 1, 2006

1 Min Read
Game Developer logo in a gray background | Game Developer

In the latest technical feature for Gamasutra sister educational site Game Career Guide, we present an excerpt by Andrew Davison from Killer Game Programming in Java explaining in detail flocking, a computer model for the coordinated motion of groups of entities called boids, in the context of Java game coding. In this extract, Davison explains the basics of flocking, which can be used not only for groups of its quasi-namesake, but also for any large group with some manner of unpredictable but coordinated behavior: "Flocking is a computer model for the coordinated motion of groups (or flocks) of entities called boids. Flocking represents group movement—as seen in bird flocks and fish schools—as combinations of steering behaviors for individual boids, based on the position and velocities of nearby flockmates. Though individual flocking behaviors (sometimes called rules) are quite simple, they combine to give boids and flocks interesting overall behaviors, which would be complicated to program explicitly. Flocking is often grouped with Artificial Life algorithms because of its use of emergence: complex global behaviors arise from the interaction of simple local rules. A crucial part of this complexity is its unpredictability over time; a boid flying in a particular direction may do something different a few moments later. Flocking is useful for games where groups of things, such as soldiers, monsters, or crowds move in complex, coordinated ways. " You can now read the full Game Career Guide feature to learn more about how separation, alignment, and cohesion steer the flocking, with plenty of code examples to help get you started (no registration required, please feel free to link to this column from external websites).

About the Author

Brandon Boyer

Blogger

Brandon Boyer is at various times an artist, programmer, and freelance writer whose work can be seen in Edge and RESET magazines.

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like