We are working on a minecraft-like block-based engine/lib. Lately I've started working a blocky-clouds as in minecraft;

So it appers that in minecraft, clouds are not procedural. I'm still looking if it is viable to procedurally generate blocky-clouds.

I tried something like but it doesn't quite fit for clouds.

float octave1 = SimplexNoise.noise(x * 0.004f, 1000, z * 0.004f) * 0.5f; 
float octave2 = SimplexNoise.noise(x * 0.003f, 1000, z * 0.003f) * 0.25f;
float octave3 = SimplexNoise.noise(x * 0.02f, 100, z * 0.02f) * 0.15f;
this.Clouds[x, z] = (octave1 + octave2 + octave3 > 0.6);

Any ideas or suggestions?

  • \$\begingroup\$ Keep tweaking the noise until you get what you want. Looks like the original could pattern was produced with noise (where each white pixel is a cloud block). You just need to produce something like that. \$\endgroup\$
    – House
    Jan 19 '13 at 18:55

Yes, it's viable. As with any artistic programming, it's something you'll have to tweak until you get the results you're after.

You can just generate 2D noise and have a static set of clouds like Minecraft, or you can use 3D noise and generate animated changing clouds.


I dunno about you, but using the heightmap of the world to calculate different densities of clouds may prove to be more 'realistic' or to appear more procedural. For example, use the getFirstUncoveredBlock(int, int); method in World (MCP unobfuscation), so that you know when for cloud entities to build up over seas and hilly terrain and to dissapear over sand and deserts. Just my two cents


It's quite viable. You just need to keep tweaking things until you get the results you like; procedural content generation is like that. This would probably be true even if you wanted to avoid doing the generation at runtime and produce a static texture map or something that defined the cloud pattern -- you'd likely just be tweaking the procedural controls for the Perlin filters in Photoshop, for example.

It looks like your current approach is based on generating noise and then thresholding it so you eventually have a Boolean value in your cloud map for "is this a cloud block or not." If that alone isn't giving you results you like, you might try applying varying degrees of thresholds in a loop instead of the simple test you've got now, with the hope of consolidating the contiguous blocks of cloud.

In fact, you could also look at it like generating organic rooms (caves for example) in a Roguelike. There's an article here on doing cellular-automata-based smoothing of an initially random data set to produce smooth cave-like rooms, which may be adaptable to your needs. The basic premise is to generate a random 2D grid of cloud and non-cloud tiles, and then for each tile in the grid, change it to a cloud or non-cloud based on how many tiles of whichever type are currently surrounding it. You can apply the algorithm any number of times to play with the smoothness. It might be worth a shot.

(It also might be neat to extend this into 3D a bit, not necessarily for the purpose of animating the clouds, as Byte suggested, which I feel may look odd in the discrete world of block-levels unless you also have varying degrees of cloud block opacity, but just for making actual 3D clouds that aren't constrained to a block plane as Minecraft's appear to be).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.