Boids implementation inside the Blender Game Engine


Blender is a free modeling/simulation software that has been out since 1993, most used only to create 2D and 3D content. It has recently been extended to include modeling, texturing, animation, particle simulation, rendering, game creation, etc. The Blender Game Engine is a very powerful tool, allowing games to be created without the need for explicit programming. Although Blender has extensive particle-based tools, including hair styling, these are absent from the game module. A submodule of the particle system is a rather sophisticated Boid System. In this project we intend to incorporate a Boid system inside the Blender Game Engine, enhancing Blender’s capability, leading to many opportunities for AI-based algorithms, including Particle Swarm Optimization, manipulation of crowds, etc. The collective behavior of Boids is called flocking, which can be characterized as an emergent behavior caused by following three steering behaviors: separation, alignment, and cohesion. Boids are commonly used in games as non-player characters since they can behave like real entities by themselves without the need for explicit control. Our implementation involved the development of a new Modifier inside Blender. This modifier is called RTPS because it depends on the library Real-Time Particles System (RTPS) developed by Ian Johnson as part of his work on Smooth Particle Hydrodynamics (SPH). RTPS is a library that currently defines two different particle systems: SPH and FLOCK, which is the system presented here. RTPS also incorporates CPU and GPU implementations of both systems. For the GPU implementation OpenCL was chosen as the GPU programming language to ensure portability between different graphics cards.