ART FROM CODE: FLOCKING GAME

This project simulates flocking behavior, inspired by natural phenomena such as birds flying in flocks or fish swimming in schools. It uses a set of simple rules (alignment, cohesion, and separation) to govern the movement of the individual objects that you see onscreen. It allows the player to interact with the objects in a relaxing way, which I found almost gamified the process, hence the name.

I became interested by the work of Craig Raynolds, and I was inspired to find a way of incorporating his findings into an interactive art piece. I began by learning the behavior of the objects, and how to incorporate them into my own processing sketches.

I first did this by making a simple sketch that got an object to follow my cursor (the circle), which was the first step to incorporate behavior. It better allowed me to understand how to incorporate direction and magnitude for the objects I was going to be making. The cursor represents a dynamic target that constantly changes, which also taught me more about the importance of real time updates, feedback loops, and responsiveness with in systems like these.

Next I started working on a sketch with multiple objects that follow a flow field. This helped me switch from working with a single object model to a multi object system. It was not quite a simulation however it allowed me to practice using more forces that I would need to input following this.

After the flow field, I was able to implement forces on the objects that outline a flocking simulation, and from there I started trying to figure out how to make the objects visually appealing. It took a lot of fine tuning, but I eventually got a result that I was satisfied with.

The final step in the process for me was making the sketch interactable so that it would somewhat be a game. The way this was done was by making the forces applied to the boids changeable as the sketch ran. Including what I had learned with the beginning sketch I had done, I included attraction or repulsion to the cursor that can be toggled also.

This project allowed me to learn and work through many processes that did not come naturally for me. Since I have not taken a formal coding class before this, I was able to find a new appreciation for computer science that I have not had previously. I have taken many pure mathematics courses, so understanding how many topics that I have learned previously are applied to this was also very intriguing. I will be looking forward to applying the skills I have learnt to other similar fields.

Author: James Hunt