In the interest of giving different in-game buildings more interesting little details, I’ve started working on some code that procedurally designs wallpapers.  I don’t have in-game screenshots yet because I need some more work before it’ll fit in correctly, but I’ve got a few examples of the types of designs in can spit out.

The method is really simple:  It starts by choosing a small rectangle with a random power-of-two width and a different random power-of-two height.  This rectangle is filled with random noise and then tinted to match one of the building’s palette colors.  Then this rectangle is ping-pong repeated across a texture (so it mirrors back and forth as it goes), and then it can be applied to the wall geometry.

Anyway – pictures!


This feels like a decent start, but I’d like to add some stuff to make it produce interesting designs more often.  Tiling other shapes, like triangles, might add some nice extra variation.

I’d ultimately also like to throw in some fractal rendering that I learned about a while ago to produce some coherent solid shapes and consistent fades.  Since large parts of fractal renders end up being big blobs of nothingness, I can just replace those spots with the current pure noise.  If random sections of the fractal are rendered into the tiled shape, then you’d get some patterns with just fractal patterns, some with only noise, and some with a little of each.  It sounds like it’d work out pretty nicely to me, but we’ll have to wait and see once it’s implemented…

This entry was posted in Unity.

One comment to Wallpapers

  1. [...] current wallpaper generator uses a mix of fractal information and random noise.  The method works pretty much how I explained earlier, but with one important extra [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>