Magical gene / magical coat genes

Teardrop

A scatter of brilliant blue teardrops hangs point-down across the coat, each one rimmed in navy with a pale cyan spark in its head, and a single pink teardrop sits on the shoulder - one on each side, the same place on every horse that carries it.

What it can come out as

OutcomeCarrying
TeardropTd/Td · Td/Tc · Td/n
Coloured teardropTc/Tc
Wild typeTc/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
Td/TdTeardrop0.002% — 1 in 50,000
Td/TcTeardrop0.008% — 1 in 12,500
Td/nTeardrop0.038% — 1 in 2,632
Tc/TcColoured teardrop0.008% — 1 in 12,500
n/nWild type99.944%

Its gene carrot

The file

common/src/main/resources/horsegenetics/genes/teardrop.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.teardrop
Phasemagical — it adds signed colour in phase 3, after the pigment has resolved
Priority114 — where it sits in the one (priority, key) paint order
AllelesTd · Tc · n
Varies per horse5 values drawn once off the expressing allele copy, so a foal that inherits the copy inherits the look
Built fromPATH, SPOTS, TOWARD

Why it is built this way

The source was an SVG: six flat colours traced off a photograph of a moth - a navy body, pale cyan streaks radiating along the wing margins, and two small pink teardrops mirrored either side of the thorax. About 115 KB of path data. The moth itself is not taken; the two marks are.

The two halves of this gene are the two halves of the vocabulary, and it is worth saying which is which. The pink dot is a PARTICULAR shape - one of them, in one place - so it is a PATH, and it is therefore the same on every horse carrying the gene. The blue teardrops are a KIND of shape, so they are a field, and every horse gets its own arrangement of them. Neither could be written as the other: a PATH cannot scatter and a field cannot be asked for exactly one.

PATH's plane: side is what makes 'one on either side' free. A shape drawn in the (x, y) plane is extruded along z, so it appears on both flanks at once - which is what a marking drawn on a side view of a horse should do, and is exactly the mirrored pair the source has. It is parts-restricted to BODY because at u 0.60 the extrusion would otherwise clip the front legs, which start at x 25.4.

In PATH's space: body the topline is 0.62 and NOT 1.0 - the box runs from the hoof to the ear tips. The dot sits at v 0.52, which is upper flank; at 0.7 it would be floating above the back and nothing would appear on the barrel at all. The flank is roughly u 0.18-0.72, v 0.33-0.62 and every point here is inside that.

Nothing in this vocabulary draws a teardrop as a field. SPOTS gives round or heart, stretch only makes those into ovals, and STROKES tapers at BOTH ends into a dart rather than at one. So a teardrop is composed: three SPOTS draws MAXed together on one lattice, at shrinking radius and growing offsetY, so a fat head has a narrowing tail hung off it. That is what the offsets are for - they move where a mask reads the cell centre from without moving the cell, so a shifted draw stays inside the set rather than replacing it.

The constraint that makes it work: seed, spacing, stretch, vary and chance are identical on every one of those draws, and only radius and offset differ. stretch divides the sample before the lattice walk, so a single mismatched value is a different lattice and the tails land beside their own heads instead of on them. That is the failure ocular had. All three colour layers - navy rim, blue body, cyan spark - are built on the same five shared numbers for the same reason, which is what makes them nest rather than scatter.

The sign of offsetY is a guess. It should hang the tails downward; if the teardrops come out pointing up, negate all six offsets and it is right. Paint them and look rather than reasoning about it.

Scale: stretch is 1.8 on a spacing of 4.0, so cells come out about 4 by 7 body units and the barrel holds roughly five columns and a row and a half. At chance 0.55 that is four or five marks a side on the barrel, each about 3.5 units long and 2.4 wide - seven texels by five. Winding spacing much below 3 packs them until the heads touch and the field reads as a wash instead of as countable marks.

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.

Teardrop

Brilliant blue teardrops hang point-down over the coat, navy-rimmed with a cyan spark in each head, and one pink teardrop sits high on either shoulder.

Layer order is outside-in: the navy rim is the same three-draw teardrop at larger radii, laid down first, so the blue body painted over it leaves the navy showing only as an outline. Swap them and the rim covers the mark.

The pink dot goes last because in the source it sits over everything, and because at this size it would be eaten by a blue head landing on the same texels.

  1. the navy rim of each teardrop — SPOTS × SPOTS × SPOTS, painted with TOWARD
  2. the brilliant blue body — SPOTS × SPOTS × SPOTS, painted with TOWARD
  3. the cyan spark in the head — SPOTS, painted with TOWARD
  4. the pink dot, one on either shoulder — PATH, painted with TOWARD

Coloured teardrop

The same scatter of teardrops and the same pair of shoulder dots, in two colours this line of horses runs to.

The recessive coloured half of the usual pair, on two hue knobs - the source's own pairing is a blue drop against a magenta dot, and one hue driving both would lose the fact that the dot is a different thing rather than a smaller drop. The navy rim keeps the drop's hue at low lightness rather than going achromatic, so the outline still reads as that mark's own shadow.

Lightness ladder 0.14, 0.4, 0.83 for rim, body and spark - the source's navy, blue and cyan read off as values. It is the ladder and not the hue that makes a teardrop look lit from inside.

  1. the rim of each teardrop — SPOTS × SPOTS × SPOTS, painted with TOWARD
  2. the body — SPOTS × SPOTS × SPOTS, painted with TOWARD
  3. the spark in the head — SPOTS, painted with TOWARD
  4. the dot, one on either shoulder — PATH, painted with TOWARD

Wild type

Unmarked.

Paints nothing.