Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Thanks for saying so! The generation process I'm using looks like this (apologies if I use a lot of jargon):

  1. I begin by sampling perlin noise at a random location, with four octaves of progressively less frequency.  (the first screenshot here gives you an idea what that looks like: http://libnoise.sourceforge.net/tutorials/tutorial4.html)
  2. I sample a section equal to the full size of the sprite I want to generate, like 16x16. 
  3. Then, I apply a falloff to the noise section I grabbed. Basically, just a curve from 0-1 that I apply to every noise pixel in my 16x16 grid. I then sample the curve based on the (x,y) of the pixel, so that pixels closer to the center have a larger value on the curve, and pixels closer the edge have a smaller value. If the pixel's greyscale value (between 0-1) is less then the sampled curve value, I set that pixel to black. It's now background. 
  4. Then I have the basic shape of the sprite. I then take the number of colors I want each sprite to have and assign a range from 0-1 to each color. Then I look at the greyscale value of each pixel and assign the corresponding color. 
  5. For every animation frame for each animated sprite, I perform this same process. But, I just offset the random noise location I'm sampling a tiny amount for each subsequent frame. 

The source code is up on github if you're interested in seeing how I do in more detail. Let me know if you have more questions.

is the falloff curve like a Gaussian curve with mean of 7,7?

(+1)

Nah, though that would make sense, too. I'm just using a simple exponential curve that samples higher in the curve the closer a pixel is to the middle of the image.