Oatmeal Spice: Interesting Procedurally Generated Output

lispybanana1 pts0 comments

Oatmeal Spice – BorisTheBrave.Com

Skip to content

Say you’ve written a little procedural generation program. Say it’s some art, music or level generator. It looks kinda cool, but after a few generations, you are already bored with it. Somehow, for all your careful design, all your generated results look samey, boring. This is Kate Compton’s ten-thousand bowl of oatmeal problem : every bowl of oatmeal is unique, but that does not make them interesting or valuable.

What can you do about it? In this article, I want to talk about how we can improve the interestingness of the results, not by adding more content, but by taking things away .

Let’s start with a little image generator I’ve made. It’s inspired by Frank Force’s Auto Park, and it’s simply a random scattering of shapes with different sizes and colors.

You can click the image to generate a fresh example. Try it a few times .

I think you’ll agree the images are very similar. If I showed you one of these, and later asked you to pick it out of five other generations, it would be very difficult. At best, sometimes an unusual configuration, such as one crescent nesting in another will randomly appear.

What’s happening is that the human mind is very good at patterns and abstractions. The individual colors and shapes may vary, but the overall description never changes – it’s the same range of colors every time. The same range of shapes, the same sizes. Once the pattern is established in your mind, the varying details no longer hold interest to you. There are simply too many shapes for any single one to be that relevant.

Make fewer, bigger decisions

With so many shapes on the screen, it’s natural for the brain summarise by averaging. Just using larger shape lets us focus more on the specific shapes picked:

(again, click the image to regenerate another example )

But in a sense, this is cheating, perhaps there were other aesthetic reasons that the shapes were the size they are.

Instead, here’s a variant of the generator, that before each run, makes a few random choices: what should the mix of shapes be, and what range of colors and sizes to use. These few choices are then used to generate all the shapes in the image. i.e. The full range of variation is the same as the original generator, we just pick a subset to use each time.

Now the individual images stick out a lot more. This one is mostly moons, this one has a reddish tint, and so on. These big decisions stand out, forcing the viewer to understand that something is different this time. Some of the big decisions are more subtle – sometimes the ranges picked are wide, instead of narrow – this still registers as a different textural feel, but is a bit more subtle.

Discrete Distributions

Another way to make your decisions more distinct is to avoid continuous distributions (like picking a point from a random interval) and prefer discrete ones (like picking a value from a list of known values). A continuous distribution can produce a lot of different values, but that just forces the brain to generalise and understand the overall pattern. In other words, picking a truly random color is just one thing, "a random color", while picking one of "red", "green" or "blue" specifically is three things. Once again, less feels like more, perceptually.

Instead of color ranges, pick a palette and stick to it. Instead of a range, restrict to 2-4 values inside that.

Feature Flags and Rare Variants

What can be more discrete than a yes/no choice? Feature flags are a special sort of randomness in the sense that they don’t just change some parameter, but they enable / disable specific logic that’s part of the generation. This can help them stand out – the brain is constantly searching for the rules and generalization of a generated piece, and will immediately notice the break.

Standing out so much is helpful for another idea, which is you make some features only occur infrequently, and others extremely rarely. This gives a work extra longevity – you may start to become familiar with the basic structure of the generator, but it’ll still hold out a few surprises to keep up entertainment. In fact, these behaviours are more suprising because they are so rare. We want to hold back some of the big guns, particularly.

In the following generator, I have designated quite a few special case, none of them occuring with frequency more than 10%. Some of them are special features (such as "no-collision", which allows shapes to overlap), and others are just parameter choices that are distinct enough to stand apart. I’ve been careful that the really strange ones pretty rare – you must establish a rule before you break it.

NB: As a rule of thumb, if you sum up the chance of appearance of each of your features flags, you get an indication of how often something will happen. When they sum to 50%, you have a 40% chance of seeing at least one. If they sum to 100%, you have a 65% chance, and if they sum to 200% you have an 85%...

shapes generator random range oatmeal make

Related Articles