Skip to content

ofhope/anomnomnomaly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@anomnomnomaly

A TypeScript monorepo for procedural generation primitives — initially powering a space game but designed as a general-purpose engine for generative art, tile maps, and visual tooling.

Packages

Package Description
@anomnomnomaly/prng Seeded PRNG engines: xoshiro256**, mulberry32, squirrel3
@anomnomnomaly/noise Coherent noise: simplex2D, worley2D, fBm combinator
@anomnomnomaly/sample Spatial distributions: Poisson disk, Delaunay, Voronoi, Halton
@anomnomnomaly/filters Post-processing: color interpolation, remap, smoothstep, dithering

Design principles

Injectable RNG. Every function that needs randomness accepts a () => number rather than maintaining internal state or calling Math.random directly. Seed once, pass everywhere — reproducibility is free.

const rng = xoshiro256({ seed: 12345 });
const points = poissonDisk({ width: 800, height: 600, minDistance: 30 }, rng);

Functional, data-last. Configuration objects come first, the RNG or data comes last, keeping partial application and composition clean.

Shared type vocabulary. The core types live in @anomnomnomaly/prng and flow through the whole graph:

type RandomFn  = () => number;
type HashFn    = (position: number, seed?: number) => number;
type NoiseFn2D = (x: number, y: number) => number;

Because simplex2D, worley2DAsNoise, and fbm all satisfy NoiseFn2D, they compose freely without any adapter code:

const terrain  = fbm(simplex2D(rng), { octaves: 6, persistence: 0.5 });
const cellular = fbm(worley2DAsNoise(rng), { octaves: 4 });

const v = terrain(x, y); // both call sites identical

Dependency graph

@anomnomnomaly/prng
        ↓
@anomnomnomaly/noise
@anomnomnomaly/sample
@anomnomnomaly/filters

noise, sample, and filters depend on prng for the RandomFn interface type. They don't depend on each other, keeping the graph flat and letting consumers install only what they need.

Development

npm install
npm run build      # builds prng first, then noise/sample/filters in parallel
npm run typecheck  # tsc --noEmit across all packages
npm test           # vitest run across all packages
npm run clean      # removes all dist/ output

About

TypeScript monorepo of procedural generation primitives — seeded PRNGs, simplex & Worley noise, Poisson disk sampling, Delaunay/Voronoi, and scalar/color filters. Functional API with injectable RNG for reproducible results.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors