Magical gene / magical coat genes

Squiggle

Broad squiggling lanes wander the length of the horse, forking and pinching out, each one white down its middle and running out through yellow to a pink rim, with small holes of bare coat punched through them.

What it can come out as

OutcomeCarrying
SquiggleSq/Sq · Sq/Sc · Sq/n
Coloured squiggleSc/Sc
Wild typeSc/n · n/n

How each one is actually drawn - region by region, and the layers it is built from - is on the coding tab.

Crossing two of them

Finding one

About 1 in 1,786 wild horses is born showing this. That is the whole of the supply: catch one, or make one with the carrot below. Breeds set their own pools and a breed built around this gene will carry it far more often than the wild population does.

Wild pairShows asHow often
Sq/SqSquiggle0.002% — 1 in 50,000
Sq/ScSquiggle0.008% — 1 in 12,500
Sq/nSquiggle0.038% — 1 in 2,632
Sc/ScColoured squiggle0.008% — 1 in 12,500
n/nWild type99.944%

Its gene carrot

The file

common/src/main/resources/horsegenetics/genes/squiggle.json — a data-driven gene, not a Java class. It is listed in the index.json beside it and registered by Genes' class initialiser at startup.

Keyhorsegenetics.squiggle
Phasemagical — it adds signed colour in phase 3, after the pigment has resolved
Priority111 — where it sits in the one (priority, key) paint order
AllelesSq · Sc · n
Varies per horse5 values drawn once off the expressing allele copy, so a foal that inherits the copy inherits the look
Built fromSPOTS, STROKES, TOWARD

Why it is built this way

The source was an SVG: four flat colours traced off a photograph of a beetle - a dark brown ground with pale squiggling lanes across the elytra, each lane cream at its middle, edged olive-yellow, and rimmed pink. About 85 KB of path data. The beetle is not taken from it; the lanes and their three colours are.

STROKES is the mask for the squiggle. It is the level set of a noise field sampled in a frame stretched along an axis, which is why its lines end in points and wander rather than sitting parallel like a comb - and wandering, forking and pinching out is exactly what the source's lanes do. FRACTAL shape: ridged is the other candidate and was not used: it draws the outlines of blobs, which comes out as lace at a consistent hairline width, and these lanes are broad and vary along their run.

The gradient is three STROKES draws, not a RAMP. RAMP varies colour along an axis and would sweep the whole horse from white at one end to pink at the other; what the source has is a gradient ACROSS each lane, from its own middle outward, which is a different thing and is three concentric widths on one field. seed, spacing, length, axis and curl are identical on all three so they share centrelines; only width differs.

Ring width is the number that constrains everything else. A texel is half a body unit, so each colour band needs about half a unit per side to survive - which means the widths have to step by a whole unit at a time. 3.2, 2.1 and 1.0 gives a 0.55-unit pink rim, a 0.55-unit yellow band and a 1.0-unit white core. Step them any closer and the middle colour vanishes and the lane reads as pink around white.

That forces the spacing, and this is the trap the file is closest to. width must stay well under spacing or neighbouring strokes touch and the whole field resolves as a wash - Zebra's Coat shipped at a width of ten against a spacing of three and came out as a solid white neck. The widest draw here is 3.2 and laneSpacing bottoms out at 6.2, so there are at least three body units of bare coat between lanes. Do not lower that floor to fit more lanes on the horse; widen the horse's share by raising length instead.

The holes are one inverted SPOTS mask repeated verbatim on all three layers. They have to be byte-identical or the hole punched through the white will not line up with the hole punched through the pink, and the lanes come out ringed rather than perforated. Because all three layers carry it, a hole goes all the way down to whatever coat the horse already had, which is what the source's dark spots are.

What it paints

Each outcome, described the way the gene file describes it, and then the layers that draw it in the order they are painted. The prose is the part a reader checks a bake against; the list underneath is what the engine actually did.

Squiggle

Wandering lanes run the length of the coat, white through their middles and fading out through yellow to a pink edge, perforated with small holes of bare coat.

Layer order is outside-in: pink at 3.2 units, yellow painted over its middle 2.1, white over the middle 1.0 of that. Each colour survives only as the part of itself the next one does not cover, so reversing the order gives a white lane with nothing else visible.

  1. the pink rim — STROKES × SPOTS inverted, painted with TOWARD
  2. the yellow band — STROKES × SPOTS inverted, painted with TOWARD
  3. the white core — STROKES × SPOTS inverted, painted with TOWARD

Coloured squiggle

The same lanes running out from a pale middle through a colour this line of horses carries.

The recessive coloured half of the usual pair, on one hue. The source's three colours are one warm sweep with a lightness ramp under it rather than three separate decisions, so a single hue at 0.96, 0.78 and 0.62 lightness reproduces the structure and three independent hues would not. The saturation climbs outward as the lightness falls, which is what keeps a near-white core from reading as a blown-out hole.

  1. the rim — STROKES × SPOTS inverted, painted with TOWARD
  2. the mid band — STROKES × SPOTS inverted, painted with TOWARD
  3. the pale core — STROKES × SPOTS inverted, painted with TOWARD

Wild type

Unmarked.

Paints nothing.