228

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

// 024 - Continuous Life (experimental)
// 1:1 Original algorithm engine source
function createContinuousCellularAutomata() {
  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, timeState, _params) {
      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);
      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];
          if (avg >= 0.25 && avg <= 0.45) {
            nextState[idx] = Math.min(1, current + 0.08);
          } else {
            nextState[idx] = Math.max(0, current - 0.05);
          }
          if (Math.random() < 1e-3) {
            nextState[idx] = 1;
          }
        }
      }
      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();
          }
        }
      }
    }
  };
}

// Default parameters from content metadata
const defaultParams = [
  {
    "key": "kernelDecay",
    "label": "Decay Rate",
    "type": "range",
    "min": 0.01,
    "max": 0.15,
    "step": 0.01,
    "defaultValue": 0.05,
    "description": "Entropy dissipation rate"
  }
];

if (!window.__art_instances) window.__art_instances = {};
if (!window.__art_instances['continuous-cellular-automata']) {
  const inst = typeof createContinuousCellularAutomata === 'function' ? createContinuousCellularAutomata() : null;
  if (inst && inst.setup) {
    inst.setup({ ctx, width, height, dpr: 1, aspectRatio: width / height }, defaultParams);
  }
  window.__art_instances['continuous-cellular-automata'] = inst;
}

const instance = window.__art_instances['continuous-cellular-automata'];
if (instance && instance.render) {
  instance.render(
    { ctx, width, height, dpr: 1, aspectRatio: width / height },
    { time, deltaTime: dt, frameCount: Math.floor(time * 60), fps: 60 },
    defaultParams
  );
}
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
110 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! ✨