AI flocking behavior simulation in C++ using Bullets physics engine.

This project focuses on the development of AI algorithms relating to the flocking behavior of NPC units illustrating flocking forces. The world is populated with a large number of identical “Birds” which form a bird flock and avoid obstacles by applying physical and flocking forces on them.

AI techniques include:

  • Physical forces: Direction (normalized velocity vector), Lift Force(negated gravity force), Drag Force (negated velocity), Angular Drag Force and Thrust.
  • Flocking forces: Cohesion & Alignment (Birds formulate a flock and stick together), Seperation (A seperation force is applied on each bird to keep the flock consistent)
  • Avoidance Forces: Boids calculate distance from obstacles and avoid them whilst staying aligned and cohesive within the flock and retaining the force balance.

Downloads:

Contact me for executable and source code


Tags: C++, Bullet Physics Engine, AI


This application was a project for Game Physics & AI module at Computer Games Technology MSc, City University of London, 2016.