Magical gene / magical coat genes

Blackwork

One black ornament lies along the horse's back - thick rounded strokes that curl, hook and taper, all of it connected into a single mass and mirrored exactly either side of the spine.

What it can come out as

OutcomeCarrying
BlackworkBk/Bk · Bk/Bc · Bk/n
Coloured blackworkBc/Bc
Wild typeBc/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 3,571 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
Bk/BkBlackwork0.001% — 1 in 100,000
Bk/BcBlackwork0.004% — 1 in 25,000
Bk/nBlackwork0.019% — 1 in 5,263
Bc/BcColoured blackwork0.004% — 1 in 25,000
n/nWild type99.972%

Its gene carrot

The file

common/src/main/resources/horsegenetics/genes/blackwork.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.blackwork
Phasemagical — it adds signed colour in phase 3, after the pigment has resolved
Priority113 — where it sits in the one (priority, key) paint order
AllelesBk · Bc · n
Varies per horse3 values drawn once off the expressing allele copy, so a foal that inherits the copy inherits the look
Built fromNORMAL, SVG, TINT, TOWARD

Why it is built this way

The source was an SVG: two flat colours, black on white, about 55 KB of path data - a bilaterally symmetric tribal ornament of thick rounded strokes running to points at both ends. Unlike every other file in this set, this one IS an outline and it IS a particular shape, so it goes in as a drawing rather than as a rule. It is the case the SVG mask exists for.

It could not go in as-was. The traced path flattens to about seventeen thousand points on its outer boundary alone, which is the traced-photograph cost the point ceiling exists to refuse. It was rasterised, made exactly symmetric by mirroring one half onto the other, re-contoured, simplified to a tolerance of about a fifth of a body unit, and re-emitted as smooth cubics - 279 points across six subpaths, one outer boundary and five real holes. Smoothing rather than a polyline is what keeps it: at this point count a straight-segment version comes out visibly faceted and the curls, which are the whole character of the thing, read as angles.

fillRule is evenodd and that is not cosmetic. Five of the six subpaths are enclosed holes, and whether a hole is a hole is written in the artist's file and is not recoverable from the geometry. Change it to nonzero and the ornament fills in solid.

Symmetry is guaranteed at the raster - one half was mirrored onto the other before contouring - but not at the point level, because the simplifier breaks ties independently on the two sides. Those deviations are bounded by the tolerance, which is about 0.2 body units, or under half a texel. Symmetric on the horse; not symmetric to the last decimal in the file.

plane: top is what makes it straddle the spine. The shape is drawn in (x, z) seen from above and extruded down y, so the ornament's long axis runs tail to nose and its mirror line falls on the spine. The drawing is 2.17 to 1 and the viewport at spanU 0.56 is 23 by 10 body units, or 2.3 to 1 - near enough that fit could be meet, but it is none so the ornament runs the exact length of the barrel rather than leaving slack at the ends.

The NORMAL mask is not decoration, it is the fix for how extrusion works. A top-plane shape is read at (x, z), and on a flank face z is CONSTANT - so every texel down that whole flank reads the ornament's outer edge value and the sides come out in vertical bands. NORMAL axis Y keeps only the upward-facing planes, where an (x, z) projection is the honest one. round: 0.5 rather than 0 because a Minecraft horse is boxes and a flat face normal takes exactly three values on an axis, so at 0 the cut reads as three hard zones. An AXIS Y band on BODY from about 0.72 would do a rougher version of the same job if NORMAL turns out to be wrong here.

There is almost nothing to vary and that is correct. A drawn mask carries a shape rather than a rule for making one, so it is the same on every horse that carries the gene - that is the point of reaching for it. spanU moves where the ornament's forward end lands and edge sets how hard its boundary is; the ornament itself does not move.

TINT rather than TOWARD for the black. The accumulator is an uncapped int, so -200 on all three channels reads black over any coat the horse already has, including a dominant white one. TOWARD would have to know what was underneath it.

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.

Blackwork

A single connected black ornament lies along the back, its curling strokes mirrored either side of the spine and tapering to points over the croup and the withers.

  1. the ornament, black over anything — SVG × NORMAL, painted with TINT

Coloured blackwork

The same ornament in a deep colour this line of horses runs to.

The recessive coloured half of the usual pair. Lightness stays at 0.2: the ornament is a mass rather than a set of marks, and lightening it past about a third turns the negative space between its strokes into the figure and the strokes into the ground.

  1. the ornament, in the line's own ink — SVG × NORMAL, painted with TOWARD

Wild type

Unmarked.

Paints nothing.