Skip to content

notwithering/multilife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multilife

a program to place multiple conway's-game-of-life-like cellular automata in a single ecosystem that can all interact with eachother

run the program and it outputs output.mp4 file with the video replay of the simulation

https://www.youtube.com/watch?v=zpPAf_UoUCc

Image Image

license

the programs code is licensed under the MIT license

all videos created using this software are licensed under CC BY 4.0

credits

technical overview of engine

specie = singular for species species = plural for species

  • each cell can belong to a specie each with its own B/S rule
  • the world is a wrapped torodial grid
  • at every step, the engine computes the next state in parallel with multiple workers

neighbor counting

for each cell:

  • count total neighbors in totalNeighbors
  • count per-species neighbors in specieNeighbors

survival

if the current cell is alive:

  • check its own specie survival condition using totalNeighbors
  • if it fails, the cell dies and can later be replaced by a birth of a different specie

birth / takeover

each specie independently checks if it can birth at the current cells location using its own neighbor count from specieNeighbors[specie.Id]

a specie is added as a candidate for birth if the current cell meets its birth condition AND:

  • the cell is alive but the specie is different from the current cells specie OR
  • the cell is dead
canCompete := shouldBirth &&
	((cellIsAlive && differentSpecie) ||
		(!cellIsAlive))

since species can replace other species cells, survival doesnt make a cell invincible

handling conflicts

  • each candidates weight = number of neighbors of its own specie (specieNeighbors[candidateId])
  • the candidate with the highest weight wins
  • if multiple candidates tie for the highest weight, there is no change to the cell

summary

  • each cell counts neighbors per specie and total neighbors
  • a cell can survive according to its species survival rule
  • species can attempt to birth into empty cells or replace other species
  • multiple candidates resolve with neighbor-weight; ties keep the cell unchanged
  • the simulation supports multi-threading for faster computation

About

put multiple life-like cellular automata in the same ecosystem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages