Magical gene / no coat effect

Magic speed

The magical version of the three natural speed loci — MSTN, PDK4 and CKM. One of the four magical body-stat genessize, speed, health and jump — and like the other three, most wild horses carry a copy, worth about a tenth either way. Two copies of the same kind add, and no wild horse is ever born with two.

Crossing two of them

Only heterozygotes are born wild

FounderTable.builder()
        .weight(Swift,   n, 40.0)
        .weight(Sluggish, n, 40.0)
        .weight(n,      n, 20.0)
        .build();

Written out rather than derived from Hardy-Weinberg, because random mating is exactly what this table is not: about 80% of wild horses carry one copy, and no wild horse carries two of anything. Every doubled horse in the world, in either direction, is something somebody bred — the health loci’s rule, pointed at something worth having.

Its gene carrot

Gene key
horsegenetics.magic_speed
Priority
141 (magical band)
Alleles
Swift Sluggish n
Combinations
6, all carryable — 6 outcomes, one each
Inheritance
codominant — both copies contribute and the percentages add
Default allele
n
In the wild
heterozygotes only — 40% Swift/n, 40% Sluggish/n, 20% n/n
Founder draws
1 × nextFloat()
Epigenetic draws
12 × nextFloat() per copy (one nextGaussian())
Per copy
normal, mean 10%, σ 7%, floor 1%
Coat effect
none, ever
Built 2026-09-05, not yet play-tested

Nothing about a speed-shifted horse has been seen in game. Checklist on To be verified.

One of a family of four

This gene is a thin subclass of AbstractMagicStatGene, which is the magic body size pattern generalised to the three additive stats. Everything on this page is true of magic speed, magic health and magic jump alike; only the stat it moves and the allele names change. Magic body size is the odd one out — it multiplies scale, which carries its own two-stage natural clamp, so it kept its own class.

Because most wild horses carry a copy of all four, a wild-caught horse has a quiet, independent wobble on every axis at once, and a horse that is remarkable on any one of them is a breeding result rather than a catch.

The combination table

CombinationOutcomeSpeedTypical
n/nwildunchanged×1.00
Swift/nmoreone copy’s percentage×~1.10
Swift/Swiftdouble-moreboth percentages, added×~1.20
Sluggish/nlessone copy’s percentage off×~0.90
Sluggish/Sluggishdouble-lessboth percentages off×~0.80
Swift/Sluggishbalancedthe two nearly cancel×~1.00

Six combinations, six outcomes. A codominant locus is the case where every combination genuinely differs, so collapsing any two rows would be a lie about the gene. The contribution is signed — Swift positive, Sluggish negative — so the whole table falls out of one line and Swift/Sluggish cancels because a positive and a negative are added, not because anything checks for it.

It multiplies, it does not add

The natural speed loci add a weight per copy. This gene takes the sum of its two copies’ percentages and multiplies whatever those loci settled on, through TraitBuilder.multiplySpeedUnclamped, applied after every addition and bounded only by HorseTraits.MAGICAL_MIN_FACTOR / MAGICAL_MAX_FACTOR (ten times either way).

common/genetics/genes/AbstractMagicStatGene.java
@Override
public void contribute(AllelePair pair, Genotype genotype, GeneEpigenetics epigenetics,
                       TraitBuilder out) {
    double sum = signedDelta(pair.first(),  epigenetics.copy(0))
               + signedDelta(pair.second(), epigenetics.copy(1));
    if (sum != 0.0) {
        applyMagic(out, 1.0 + sum);   // multiplySpeedUnclamped(1.0 + sum)
    }
}

Multiplying is what makes it compose the way you would want: a magically fast pony is still slower than a magically fast draught horse, because the natural loci settle the horse’s own speed first and the magic scales whatever that turned out to be.

It needs both copies’ epigenetics

Every non-codominant epigenetic gene asks for “the copy that expresses”, because one locus produces one result. A codominant one cannot: asking for the expressed copy would count one allele twice and the other not at all. So this gene takes an GeneEpigenetics and asks it for copy(0) and copy(1) — the same accessor magic body size and mane colour need, for the same reason.

Each copy’s percentage is a bounded normal draw (mean 10%, σ 7%) off that copy’s stored epigenetic seed, floored at 1% so a Swift allele can never come out subtracting. The seed is rolled once for a founder and inherited verbatim with the allele, so a foal that inherits the copy inherits the exact percentage — which is what makes breeding two good copies together a real project.

DrawOne copyTwo copies
−6σ (the floor)×1.01×1.02
mean×1.10×1.20
+1σ×1.17×1.34
+6σ (the bound)×1.52×2.04

The bounded Gaussian keeps the real reach near ×2 even at two maximal copies, so the ten-times MAGICAL_*_FACTOR clamp is a guard that never actually fires — the same story as magic body size. Asked about a genotype with no epigenome to read (a wiki table, a punnett display), the gene reports the midpoint: exactly ×1.10 for one copy, ×1.20 for two.

Deliberately speed only

It moves no other number. Not health, not jump, not size — a fast horse is just a fast horse. The natural loci already own the trade-offs between the stats; this gene is a clean multiplier on one axis so that the four can be bred independently.

Source: common/genetics/genes/MagicSpeedGene.java, common/genetics/genes/AbstractMagicStatGene.java