Game Genetics Without Mendel: Continuous Traits, Skewed Mutation
This farming sim's breeding system swaps Mendelian allele tables for continuous float genes, biased mutation, and shareable backend-free genome codes.
Most in-game breeding systems reduce to a Punnett square: a couple of alleles, one dominant trait, and a handful of discrete outcomes that a player exhausts within a few crosses. For a small farming sim, one developer replaced this with a continuous model: five traits (hue, yield, speed, sell value, hardiness) are stored as plain floats within bounded ranges, with no allele pairs or dominance rules at all.
Crossing takes the midpoint of two parents and layers controlled noise on top. That noise is deliberately skewed slightly positive, so a patient breeder's population drifts upward over generations instead of random-walking. Mutation also runs on two scales: frequent small drifts keep most offspring predictable, while rare, larger jumps occasionally produce an outlier strain that rewards continued breeding. The one visibly steerable gene, hue, drives a sprite color shift, so selecting for other traits still has a readable visual payoff.
Because a fully stochastic system leaves players unable to form intentions, the game separates a deterministic preview (pure average, no noise) from the actual cross (average plus mutation) — the gap between the two is where the tension lives. The resulting genome, five floats plus a crop index, is packed into fixed-point integers, encoded in base-36, and wrapped in a versioned prefix, producing a compact string shareable in a chat message with no backend; decoding re-validates and re-clamps every value since the input can't be trusted.
The reusable lessons: continuous traits create a richer design space than discrete alleles, a slightly positive mutation bias rewards persistence, splitting mutation into small-frequent and large-rare components yields both stability and jackpots, showing the deterministic mean while applying noise on commit lets players plan, and any exported share code should be version-tagged and revalidated on decode.