Project Overview

Homochromaticity is an artificial life simulation based loosely on the concepts of groupthink and conformity.

This project uses the Artificial Life Javascript library created by Graham Wakefield, which can be found here. The local version running the preview below can be found here.

The source code can be found here, or by looking at the code running the preview below.

Below is an embedded preview of the project output. The project will output something different every time, so if you want to test it out a few times, right click on the dark grey part of the frame below and select "Reload frame," or simply refresh this page.

Clicking inside the frame randomizes the colour of every agent, in case things get too boring or homochromatic.


The idea

This system is a chromatic representation of the idea of groupthink or assimilation. Agents adapt the colour of encountered neighbours, and increase in size according to how many similar-coloured neighbours they come across. The background serves as a visual representation of the current state of the agents as a species. Some agents remove colour and some add colour to the background, and its colour is determined by averaging the colours of all agents in the system.


It's interesting to watch how long it takes for one colour to take over the entire system, and it's interesting to watch groups of agents explode in pockets and then return to their tiny sizes. It's also fun to try and figure out which colour will "win" as it's often surprising how quickly a colour can take over, even if there's only one agent who has that colour.

Tehnical details

Agents in this system wander aimlessly until they find neighbours with whom they can wander. Agents travel in packs, and stay a certain distance from one another, but their size is also determined by how many neighbours they have. The combination of these two rules creates a push-and-pull behaviour where groups of agents rapidly increase in size, and then push all of their new neighbours away because they now need more personal space.

The scene is also driven largely by colour, with each agent being born a random colour, and taking on the colour of neighbours it encounters. This colour-assimilation behaviour in conjunction with the neighbour-count-dependent size of agents creates an interesting "game" that unfolds. Usually, one colour will eventually take over the entire population and every agent adopts that colour.

The background tracks the progress of this interplay between agents. An average of all agents' colours is calculated and applied to the background on every update. Half of the agents are "removers" who remove colour from the background as they pass through it, and the other half are "adders" who add colour to the background as they pass through it. The hardest technical part of the project was balancing the growth of agents when they had several neighbours. The thresholds are very finicky and it can quickly devolve into a system of oversized agents all pressed against the glass and struggling for air.

It was also difficult to find a balance that allowed for the background to grow and diminish in such a way that it almost never became completely full of colour.

Future work

I would like to add more interesting behaviour for the agents than just an aimless wander. I could add some sort of behaviour based on the background, and also multiple backgrounds representing different elements of the system.