438

Continuous Life

Generalization of Conway's Game of Life to continuous floating-point state space, exhibiting fluid-like organic self-replicating solitons.

Playground
60 FPS • Canvas 2D
Click + Drag to interact with field
</>

Full Executable Algorithm Code


import type { ArtRenderer, ParameterState, RenderContext, TimeState } from '../../types/engine';
import { hsla } from '../common/color';

// Continuous SmoothLife-inspired multi-ring cellular automata kernel
export function createContinuousCellularAutomata(): ArtRenderer {
  const SIZE = 40;
  const state = new Float32Array(SIZE * SIZE);
  const nextState = new Float32Array(SIZE * SIZE);

  return {
    setup() {
      for (let i = 0; i < SIZE * SIZE; i++) {
        state[i] = Math.random() > 0.6 ? Math.random() : 0;
      }
    },

    render(context: RenderContext, timeState: TimeState, _params: ParameterState) {
      const { ctx, width, height } = context;
      const cellW = width / SIZE;
      const cellH = height / SIZE;
      const t = timeState.time;

      ctx.fillStyle = '#08090d';
      ctx.fillRect(0, 0, width, height);

      // Transition step
      for (let y = 0; y < SIZE; y++) {
        for (let x = 0; x < SIZE; x++) {
          const idx = y * SIZE + x;
          let sum = 0;
          let count = 0;

          for (let dy = -1; dy <= 1; dy++) {
            for (let dx = -1; dx <= 1; dx++) {
              if (dx === 0 && dy === 0) continue;
              const nx = (x + dx + SIZE) % SIZE;
              const ny = (y + dy + SIZE) % SIZE;
              sum += state[ny * SIZE + nx];
              count++;
            }
          }

          const avg = sum / count;
          const current = state[idx];

          // Continuous smooth transition function
          if (avg >= 0.25 && avg <= 0.45) {
            nextState[idx] = Math.min(1, current + 0.08);
          } else {
            nextState[idx] = Math.max(0, current - 0.05);
          }

          // Spontaneous quantum perturbation
          if (Math.random() < 0.001) {
            nextState[idx] = 1;
          }
        }
      }

      // Render & swap
      for (let y = 0; y < SIZE; y++) {
        for (let x = 0; x < SIZE; x++) {
          const idx = y * SIZE + x;
          state[idx] = nextState[idx];

          if (state[idx] > 0.05) {
            const px = x * cellW;
            const py = y * cellH;
            const val = state[idx];
            const hue = (160 + val * 120 + t * 15) % 360;

            ctx.fillStyle = hsla(hue, 90, 60, val * 0.9);
            ctx.beginPath();
            ctx.arc(px + cellW * 0.5, py + cellH * 0.5, (cellW * 0.45) * val, 0, Math.PI * 2);
            ctx.fill();
          }
        }
      }
    },
  };
}
Edit in Interactive Playground Zero Dependencies • Standalone Canvas 2D
ƒ

Mathematical Formulation

high
Analytical Equation
st+Δt(x,y)=σ(st(x,y),∬Kouter(r)st(x+r)dr,∬Kinner(r)st(x+r)dr)s^{t+\Delta t}(x,y) = \sigma\left( s^t(x,y), \iint K_{\text{outer}}(r) s^t(\mathbf{x}+\mathbf{r}) d\mathbf{r}, \iint K_{\text{inner}}(r) s^t(\mathbf{x}+\mathbf{r}) d\mathbf{r} \right)
Click to expand
Compact Formula
avg = (1/8) * Σ neighbors, s_{t+1} = (0.25 <= avg <= 0.45) ? s + 0.08 : s - 0.05

Mathematical Tags

#cellular-automata #smoothlife #continuous #artificial-life #experimental #solitons
Author: Math Art Core Target: 60 FPS

Export & Embed: Continuous Life

4K PNG Snapshot

High-resolution single frame render

WebM Video (5s Loop)

60 FPS browser-captured stream

Standalone JS Script

Complete executable Canvas 2D algorithm

HTML Iframe Embed

<iframe src="https://art.fazleyrabbi.xyz/embed/continuous-cellular-automata" width="500" height="500" frameborder="0" loading="lazy"></iframe>
ESC
↑↓ Navigate ↵ Select
113 Mathematical Artworks
Made by Fazley Rabbi
☕

Support the Project

Keep mathematical creative coding alive & open source

Or via Direct Payoneer ($0 Fee)
Payoneer Customer ID: $0 Fee Direct
24076084

💡 Payoneer app: Go to Pay → Pay to recipient → Enter ID 24076084.

Thank you for supporting generative mathematical animations! ✨