Procedural koi: where it starts

Planning a koi fishing game we've just started. Before any fishing, we needed the koi, and we wanted every one of them to be different without drawing any by hand. So every koi in the game comes from a single number, its seed.

Twenty koi from twenty seeds 1123 to 1142

How one number becomes a koi

The seed becomes genes. A small random number generator turns the seed into a list of genes: variety, colours, how many patches and spots, body length and width, traits such as Ginrin or Doitsu scales, and a finish that decides how clean the pattern's edges are. The same seed gives the same koi on every device.

The genes become a pattern. The pattern is painted in seven layers (base colour, patches, ragged edges, scales, shading, shine, eyes) into a small 128 × 32 image covering the koi's back from nose to tail.

A spine makes it swim. Eight joints follow the head like a chain, and a wave runs down to the tail.

A mesh wraps the spine. A strip of triangles follows the spine with a koi-shaped outline, plus two fins,r ebuilt every frame. The pattern is stretched along it.

Previous
Previous

Ginrin: from polka dots to a glint

Next
Next

IQUBE | 500 + Downloads