While studying I was doing a lot of different projects. One of them was a simple simulation of bird flock movements. This will be a series of posts about changes in this project. It will contain a lot of code reviews and development information’s.

Project is hosted on GitHub if you want to follow the code and changes.

https://github.com/Michal Franc ik/SilverlightBoids

I use Trello to manage ideas, tasks, bug fixes  etc.

Project Overview

This app is simulating movement of bird flocks. Each object that is representing single bird is called BOID. Each of them can perform various actions which are influencing behavior and in the end vector, that is responsible for the movement in the next iteration.

More complex description of the algorithms involved in this project.

http://www.red3d.com/cwr/boids/

 

Boid is rendered as a simple pixel. There are options like

  • Add new boid
  • Add Random boid
  • Options for different behavious

It is very simple

Simulation

Each Iteration of the simulation world is divided into these actions

image

For each Boid we perform Do Actions function which iterates through Action list and create a Vector class that is describing current movement and position change of the Boid. After caluclation we perform position change and Rerender of world. This is just a simple explanation of engine.

Future Changes

I want to move core logic to separated project because in the future I want to separate and support presentation layer in form of html 5 and canvas. I want to use .Net to calculate complex calculations and web service as a transport layer to the canvas rendering in the browser. I will see how it works and if there will be any performance issues then I will think about moving algorithms calculations to the javascript.

I also have to think about nice and easy Gui.

Future Features

I want to support couple of nice features in future releases

  • Ability to modify\ behavioral algorithms
  • Simple Game based on the engine
  • Html 5 Canvas rendering + web service communication
  • Storing state either on Redis or MsSql with NHibernate layer