Most "breeding" mechanics in games are a coin flip. You give a plant or a monster a couple of alleles, mark one dominant, and crossing two parents is a Punnett square: red × white gives you red, red, red, white. It's faithful to a middle-school biology lesson and it makes for a dull game. The outcomes are discrete and there are only a handful of them, so after ten crosses the player has seen the whole space and stops caring.
I went the other way when I built the breeding system for a small farming sim. Every trait is a continuous number, mutation is biased so selection actually pays off, and the whole genome packs into a shareable string with no server behind it. Here's how each piece works, and why the choices matter for how the mechanic feels.
Traits are floats, not alleles
A strain carries five genes, each a plain number in a bounded range:
export const GENE_KEYS = ['hue', 'yield', 'speed', 'value', 'hardiness'];







