Flocking

Info

Type game: Unity and Javascript

Platform: Web

Team: 1 Developer

Time: 8 days

Date: Oktober 2016

Play (Javascritpt/ 2D): click here

Play (Unity/ 3D with fish): click here

Github (Unity/ 3D with fish): click here

Description

This project was made to understand the flocking algorithm and group behaviour.

I devided this project in two: a javascript project to understand the algorithm and a Unity project to implement it in 3D with animals (fish to be precise).

The flocking algorithm is aplied to each agent in a group. Each agent follows the flocking algorithm based on 3 rules:

  • Cohesion (agent wants to be part of the group based on de the average position of their neighbours.)
  • Seperation (agent doesn't want to get too close so takes the distance of each neigbour and adds it up to its vector and the namde negative.)
  • Allignment (agent wants to get the same direction as its neighbours, so it takes the average direction vector of its neighbours.)
  • The agent adds all these three vectors to one direction and then it has its direction it wants to go to be in the group.

    My role

    ---Javascript project---


  • Made javascript art
  • Implemented the flocking algorithm
  • CSS programmed (based on "Orbit"s CSS.)
  • ---Unity project---


  • Implemented the flocking algorithm
  • Level design
  • Camera/player movement
  • Different fish behaviour
  • Fish model source
    Rock model source

    Game features:

    ---Javascript project---


  • Adjustable variables tweaking
  • Attractors/magnets the agents want to follow (mouse)
  • Different spawning mechanics
  • ---Unity project---


  • Camera/player movement
  • Different schools of fish
  • Different fish behaviour
  • Recordings Unity project

    Recordings Javascript project