How sprinkles are made

This week, @bigsylvain explains how sprinkles are created.

(This post is a bit raw, we’re both very busy this week-end. But remember, we said we’d concentrate on the game more than the updates now!)

@bigsylvain The polygonal structure of our layers has enabled us to create the concept of sprinkles: using a magical spray we “sprinkle” grass or rocks on the floor. In order to do so, my buddy programmer @fasterthanlime has made a template containing each direction of the polygonal faces:

@bigsylvain Then I simply had to create a texture for each direction. The first sprinkles were made by hand with GIMP and they added a spark of diversity in our layers.

@bigsylvain But since we wanted diversity and not the same grass sprite repeated all over the place, I began creating different variations of the same texture (4 seems to be a minimum to avoid the “copy-paste” feel).

Since I now use Blender to create the animation of our hero, it was natural to try to generate the sprinkles in 3D. My last Ludum Dare entry was made with Blender and it gave me enough experience with particles, so that creating these sprinkle particles was very easy.

First step: design the particle:

@bigsylvainSecond step, create a plane according to the template and add a particle system with the right settings:

@bigsylvain Repeat the operation for each plane and you get the sprinkles for each direction. It is also quite easy to just change the particle and all the sprinkles are different, which means it’s very easy to have different size/density of grass, or other textures!

@bigsylvain Here’s the result for all 16 directions:

Creating rocks is even more easy since the duplication of mesh doesn’t look as bad as for the grass sprinkles. Here it is only generated with cubes:

which produces this sprinkle set:

@bigsylvain I forgot to mention that the particle system in Blender does contain a “seed” parameter… soooo this just means that I can generate as many variants of a sprinkle set as I need by just changing one parameter somewhere!

And last step, sprinkle those polygons!

@bigsylvain Let’s see how these two sprinklesets looks like in-game:

Here’s one last screenshot for the road: