Folded Flowers

Last year, I participated in the GMTK game jam during the summer, which had the theme "roll of the dice". When exploring some less closely related ideas, I was considering game ideas around the random recombination of genes. This reminded me of an old flash game named "seed" (unfortunately no longer playable) where you would breed plants to get them to look a certain way. I recreated this in Unigine, resulting in the following:

In the end it turned out as a rather bare-bones prototype, but it was good practice nonetheless. The initial idea was to make the flowers periodically release pollen or floating seeds in the air. The player could then draw a line through the air along which "wind" would then be generated to move the pollen to other flowers or move seeds to the ground. I did write the code to generate vortices along a drawn path:

To allow breeding of the flowers, each flower has a string that holds parameters for how the plant should grow. This includes flower colours, number of petals, how much the plant bends and branches, and various other parameters. When two plants recombine, their values are randomly combined along with some noise to create a new variant of the plant. Here's an example of how the flower data is structured:

// plant string: (stalk data, flower data)
// stalk string: (segment angle, segment width, segment length, segment curve, (left branch), (right branch))
// flower string: (ring shape, center size, (ring colour), (petal shape, petal_size, petal_count, (petal colour), petal colour_var), ())

((0.0,0.2,1.0,20.0,(60.0,.1,.9,-60.0),(-60.0,.1,.9,60.0,(30.0,.05,.9,-30.0),(-30.0,.05,.9,30.0))),(1,0.2,(0.0,1.0,1.0),(1,.3,7,(0.0,0.5,1.0),0.2),(1,.4,15,(0.0,0.0,1.0),0.2)))

Plants are generated by parsing this string recursively to allow branching. The hardest part of this project was definitely generating the dynamic meshes for the flowers and flower stems from the parameters. Not exactly a good idea for a game jam with limited time, but it was definitely a fun project. :)