Magical gene / magical coat genes

Wing Margin

The flank carries a butterfly's wing - a pale field crossed by fine veins running back toward the stifle, edged along the underline with a row of scallops and dark lunules.

What it can come out as

OutcomeCarrying
Chalk marginW/W · W/B · W/C · W/n
Mourning marginB/B · B/C · B/n
Coloured marginC/C
Wild typeC/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 7,142 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
W/WChalk margin0.0005% — 1 in 200,000
W/BChalk margin0.0007% — 1 in 149,925
W/CChalk margin0.0007% — 1 in 149,925
W/nChalk margin0.0095% — 1 in 10,526
B/BMourning margin0.0007% — 1 in 149,925
B/CMourning margin0.0007% — 1 in 149,925
B/nMourning margin0.0007% — 1 in 149,925
C/CColoured margin0.0007% — 1 in 149,925
n/nWild type99.986%

Its gene carrot

The file

common/src/main/resources/horsegenetics/genes/wingmargin.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.wingmargin
Phasemagical — it adds signed colour in phase 3, after the pigment has resolved
Priority153 — where it sits in the one (priority, key) paint order
AllelesW · B · C · n
Varies per horse2 values drawn once off the expressing allele copy, so a foal that inherits the copy inherits the look
Built fromAXIS, FAN, PARTS, TOWARD, WAVES

Why it is built this way

The veins are a FAN and could not be anything else. Every vein on a wing leaves one point and they fan apart as they travel; STROKES draws lines that wander independently and never share an origin, and WAVES takes its phase from a straight line so its bars stay parallel forever.

The FAN's pivot is at (6, 7) - off the marking, down by the stifle - and inner is 8.0, so only the far part of the fan crosses the flank. That is what makes the veins read as converging on somewhere rather than as radiating from a point you can see. spacing is an ANGLE: 0.17 is about thirty-seven veins round a full turn, and the wedge that reaches the barrel holds maybe eight of them. A number that reads like a body-unit spacing would have put three veins on the whole horse.

Vein width at ten units out is 0.17 x 10 x 0.42 = 0.71 units. It grows with distance, so the veins are thinnest at the belly and widest at the shoulder, which is the right way round.

The scallops and the lunules are two WAVES bands on ONE wavelength (5.6) and ONE phase, differing only in amplitude - 1.7 against 2.9. The deeper band's crests push up through the shallower one, and the dark lobes fall inside the olive scallops instead of beside them. This is why the lunules are not SPOTS: a SPOTS lattice lays down its own centres and has never had anything to do with where a wave crested.

Both bands are 4.0 and 3.1 units deep, so the olive that survives around each lunule is over a unit wide. Tightening either band toward the reference's thinner rim takes it under a texel.

Sourced from a traced SVG, but not drawn with the SVG mask. The trace runs to thousands of path commands over hundreds of subpaths, most of it trace noise - well past the point ceiling, which exists to keep a traced photograph out of a gene file, and it would have made the marking identical on every horse. The reference was read for what KIND of shape each element is and rebuilt from field masks. A hand-drawn, low-node version of the source would be worth the SVG mask with its d string verbatim.

Arrived keyed 'ixora.wingmargin'. Renamed to the horsegenetics namespace every other gene in the mod uses - the format allows a modder their own, but a gene shipping INSIDE this mod under a second namespace breaks the tooling that builds a key from a slug.

The heavy veins were on FAN spacing 1.4 with duty 0.1, and painted NOTHING - spacing is an ANGLE, so at 1.4 radians the veins are eighty degrees apart and the barrel does not subtend enough of the fan for one to land on it. 0.51 is three times the fine veins' 0.17, which puts a heavy vein at every third fine one, and duty 0.16 gives it a little more width than they have. Caught by DeadLayerTest; the layer read as valid and drew on nothing.

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.

Chalk margin

A white wing field over the flank, veined in grey and scalloped along the underline.

  1. the wing field — PARTS × AXIS × AXIS, painted with TOWARD
  2. the fine veins — PARTS × AXIS × AXIS × FAN, painted with TOWARD
  3. the heavy veins — PARTS × AXIS × AXIS × FAN, painted with TOWARD
  4. the scalloped margin — PARTS × AXIS × WAVES, painted with TOWARD
  5. the dark lunules inside the scallops — PARTS × AXIS × WAVES, painted with TOWARD

Mourning margin

The wing in mourning colours - a slate field, black veins and near-black lunules.

  1. the wing field — PARTS × AXIS × AXIS, painted with TOWARD
  2. the fine veins — PARTS × AXIS × AXIS × FAN, painted with TOWARD
  3. the heavy veins — PARTS × AXIS × AXIS × FAN, painted with TOWARD
  4. the scalloped margin — PARTS × AXIS × WAVES, painted with TOWARD
  5. the dark lunules inside the scallops — PARTS × AXIS × WAVES, painted with TOWARD

Coloured margin

The wing takes the line's own colour, dark-veined with a banded, scalloped margin.

  1. the wing field — PARTS × AXIS × AXIS, painted with TOWARD
  2. the fine veins — PARTS × AXIS × AXIS × FAN, painted with TOWARD
  3. the heavy veins — PARTS × AXIS × AXIS × FAN, painted with TOWARD
  4. the scalloped margin — PARTS × AXIS × WAVES, painted with TOWARD
  5. the dark lunules inside the scallops — PARTS × AXIS × WAVES, painted with TOWARD

Wild type

No marking.

Paints nothing.