Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HexLife

C++ Platform License

Small on purpose: this repo is the Game-of-Life-specific layer (LifeMap, the ImGui panel, GIF capture — about 580 lines total) on top of Tessera, which does the actual chunking/threading/CUDA work. Pulled in via CMake FetchContent, not vendored.

Conway's Game of Life on a chunked, effectively unbounded field — only live chunks are simulated, and gliders cross chunk boundaries correctly. Built on Tessera: simulation and rendering run on separate threads, the automaton rule is a lookup table so the same code runs on CPU or CUDA unchanged.

gun + eater

random field

What it does

  • The world is split into chunks — only live chunks are simulated, and life spreads into neighbour chunks as it reaches their borders (gliders cross chunk boundaries correctly)
  • Simulation runs in parallel on a custom thread pool; rendering runs on its own thread — the picture doesn't stutter when the simulation is heavy
  • The automaton rule is a lookup table, not hardcoded — the same rule runs on CPU and CUDA without rewriting anything
  • Loads .rle pattern files (the standard format from conwaylife.com) — pick any of them from the in-app panel
  • Interactive editing: draw/erase cells, pan, zoom, pause/step, change speed, and record a region of the field straight to a GIF

Build

cmake -S . -B out/build -G Ninja
cmake --build out/build --target Demo_life_full

Same requirements as Tessera (Windows, MSVC, CMake 3.20+, Ninja) — the engine itself gets fetched automatically during configure, nothing to clone by hand.

Demos

Demo_life_full        Full interactive Game of Life: draw, pan/zoom, pause/step,
                       pick patterns, record GIFs (ImGui panel).
Demo_life_capture_ui   ImGui window for configuring and launching headless GIF exports.

Controls (full demo):

LMB        draw cells           Space      pause / resume
RMB        erase cells          Step >     one step while paused
MMB drag   pan                  WASD       pan with the keyboard
Scroll     zoom to cursor       slider     simulation speed

The left panel also has a pattern picker (any patterns/*.rle), Clear / Randomize, and a GIF recorder (select a region, hit record).

Capture GIFs from the command line

python tools\capture_gif.py --exe out\build\x64-release\Demo_life_capture_ui.exe ^
    --scene guns --stop 60 --res 600x360 --region 14 14 80 60

Key flags: --scene (guns/random/glider), --stop N (steps), --res WxH, --region X0 Y0 X1 Y1, --guns GX GY, --delay ms, --out path. Requires Pillow: pip install pillow.

capture ui

About

Conway's Game of Life on a chunked hex-ready field, built on the Tessera engine

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages