Written in Processing, this program aims to create a predator-prey model where the top predator gets eaten by the bottom prey. During the model a user can click and hold to draw new in new defection/mutation with their mouse.
Warning: 30 MB gif. Sorry about that.
If you have processing installed as a system package you can simply do:
make run
If you have installed processing to a custom location you can instead do:
make run processing-bin=/path/to/processing-java
The sketch looks for a config.json
file in the directory that it is run from
and will load values if they are present.
All configurable values are optional and have sensible defaults which will be
loaded unless overriden.
Colors are specified as string representation of hex codes with the first
digit being the alpha channel and the following digits the standard RGB
values.
cellHeight and cellWidth (Integers): Height/Width of each cell that can be occupied.
windowHeight and windowWidth (Integers): Height/Width of the sketch window.
bgColor (String): Background color of the sketch window.
sigils ([String]): Array of colors that corrospond to each different tribe.
initialTribeCount (String): Initial number of tribes at the start of the simulation.
tribesMutate (Boolean): Enable/Disable tribes mutating.
tribesMutateChance (Float): Chance ranging from 0.0 to 1.0 that a tribe will mutate.
saveFrames (Boolean):
Enable/Disable saving frames of every generated step to out/frames
.
clickMutate (Boolean): Enable/Disable the ability for user to hold down mouse to randomise selected cells tribe.
There are hard coded colours taken lovingly from Kelly's 22 colours of maximum contrast with the encoding taken from this post. With 22 maximum colours it means with more than 22 tribes that the colours are reused currently.
- Expand in 8 directions not just 4
- Increase values a lot
- Random colour generation
- Create user interactable sliders
- Speed of infection, momentum for travelling waves of success
- Use this pattern as vector of movement for datamosh