RepositoryJavaScriptINIndia
anuraghazra

anuraghazra/EvolutionAquerium

:fish: :bug: Small Inteli Creatures Based On Steering Behaviours

197stars
24forks
0issues
4views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: boids

#1 Repository of the month

1
TINIX TRENDING·Topic: steering-behaviours

#1 Repository of the month

1
TINIX TRENDING·Topic: genetic-algorithm

#1 Repository of the month

Evolution Aquerium

Check out Evolution Aquerium case study.

Try Out The demo

Craig Reynold's

Check-out DevEnv Branch for Beta Optimization and Development which includes Refactored Code and EcoSystem.js Class to manage Creatures and Easy-to-use API for making new Agents.

How It Works?

Well that's an obvious question.

These Creatures are based on Craig Reynold's Steering Behaviors and Flocking System

It's also implements Genetic Algorithm and mutations.

You can learn more about them on Daniel Shiffman's YouTube Channel The Coding Train

How My Code Works?

My code is actually pretty simple.

Agent Class

I made a Agent class which handles all the Basic behavior like

  • flock()
  • align()
  • separate()
  • cohesion()

And added some basic parameters like

this.radius = radius; //size of the agent

this.health = 1; // health 

this.healthDecrease = 0.003; // how much health will decrease over time

this.goodFoodDie = 0.5; // food increase the health by that amount 

this.badFoodDie = -0.4; // poison decrease the health by that amount

I also added a sex variable for the agents and all of them also has unique names

this.sex = (Math.random() < 0.5) ? 'male' : 'female';

Fear Behavior

And for the most important part, i added a defineFear() method which handles Fear behavior.

It's a robust function to define fear which can be also used inversly with negative values.

defineFear() function allows Agents to add Steering Forces simultaneously on each other

// list, weight, perception, ?callback
creature.defineFear(predators, -4, 50);

Reproduction System

Reproduction System checks for male and female agents and if their radius is greater than 8 and they are close enough to each other, then they can reproduce with their specific DNA and creates a small Agent based on their DNA data and with some mutation.

Predator class

Predators are simple but deadly they just has a sex property set to 'predator'

and i used defineFear() function inversely to attack the Creatures

And bigger they get slower they became.

Avoider Class

Avoiders are very very very fast but they are very agile too. they just has a sex property set to 'avoider'

and i used defineFear() function to avoid every poison and Predator.


Have Fun Watching Them All Day

Try To Contact Me

I AM A PROUD INDIAN.

Similar Projects

Discover other similar projects and AI models.

RepositoryC#
nvjob/nvjob-boids

#NVJOB Simple Boids (Flocks of Birds, Fish and Insects). Flocking Simulation. Free Unity Asset.

105
Apr 10, 2023
RepositoryJavaScript
cubedhuang/boids

An interactive 2D bird flocking simulation using a spatial subdivision method to optimize performance for thousands of agents.

81
Feb 3, 2026
RepositoryPython
mesa/mesa

Mesa is an open-source Python library for agent-based modeling, ideal for simulating complex systems and exploring emergent behaviors.

4.0k
Dec 1, 2026
RepositoryC
clainstone/cbirds

A flock of birds in your terminal: Craig Reynolds' boids, in braille in any terminal and as sprites in Kitty and Ghostty. One C99 program, no dependencies. Linux and macOS

325
Nov 18, 2026
RepositoryC++
Cultrarius/Swarmz

A free, header-only C++ swarming (flocking) library for real-time applications

141
Oct 31, 2019
RepositoryPython
paul-shuvo/MSN-Flocking-Formation-Control

:flying_saucer: An implementation of multi-agent flocking formation control with specific formations that can follow a target without collision and can avoid obstacles.

71
Apr 16, 2025
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryJavaScript
react/react

The library for web and native user interfaces.

253.0k
Nov 30, 2026
RepositoryJavaScript
trekhleb/javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

196.8k
Jul 26, 2026