Tulip breeding - how it works

Tulips planted near each other can breed. When tulips breed their colors will be combined so that when you harvest the tulip and plant its seed it can grow up to be a different color. Here’s how that color breeding works.

Big thank you to Dave for giving me the source for tulip breeding, I’d have never figured out some of this stuff without it :slight_smile:

First off: Tulips have two sets of colors.

  1. The color they display
  2. The “mate color” that their color will be combined with on harvest.

The “mate color” is updated whenever a tulip starts flowering, it will either choose a tulip near the plant or, if there are no plants nearby, will take its own color as the “mate color”

Next: A tulip color is actually 4 colors + 2 mixes. Two colors and a mix define the top and bottom color of the tulip.

For the top and then the bottom colors the game takes the following steps:

  1. With a chance of 25% increase the mix for the recessive color
  2. With a chance of 75% increase the mix for the dominant color
  3. If the “mate color” isn’t the same as the actual color:
    1. With a chance of 50% either: [1]
      1. With a chance of 25% take the recessive color from the “mate color”
      2. Otherwise take the dominant color from the “mate color”

After this has been done for the top and bottom colors, with a chance of 1%:

  1. Randomly choose a color with the following chances:
    Color Chance
    Indian Yellow 50%
    Ultramarine Blue 25%
    Copper Blue 12.5%
    Black 6.25%
    Emerald Green 4.375%
    Tyrian Purple 1.875%
  2. Randomly, with an even chance [2] assign this to one of the four colors of the new tulip seed.

[1]: Note: This isn’t quite correct, there is an ordering for colors that I don’t fully understand yet that also has to be preserved. I suspect, with no mutations, tulips would eventually converge on a single color.
[2]: Again, not quite correct, but effectively even. rand() % 4 is used. See StackOverflow


day 8 tulip breeding
Advent Calendar Day 8

13 Likes

I always thought I knew a lot about tulips. It seems like I was wrong though! :smile:

1 Like