Glibbersim
9Aug2013
This is a weird weekend project that ended up producing some nice animations. :)
The cells in this game act independently and only see cells in the surrounding area. Cell types are encoded by color here.
- Some cell types attract each other, some repulse each other.
- The "heartbeat" is a per-cell activation value. The higher it is,
the more likely the cell will do certain actions, e.g.
- The activation is propagated to neighbor cells, if they haven't been recently activated already. That way, the heartbeat propagates nicely through its structure.
- With higher activation, the cell may contract (like a muscle). The size change is not animated, but it exists in the simulation.
- If the activation is high enough, and a cell is not surrounded with enough neighbor cells, it may create a child cell (whose type depends on the type of the current cell). To keep things deterministic, cells are always created as far away from neighbor cells as possible.
- Cells disappear if the neighbor population becomes too high (overpopulation). Again, the threshold depends on the cell type.
If the structures move, they mostly do it by creating cells from which they repulse. These are left as "garbage" cells (green in these animations). Garbage cells have a low overpopulation threshold, so they disappear quickly.
To create this, I used PyGame (based on libSDL). The animation is done by dumping images to a temporary directory and later combining them with the gifsicle tool.