Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
A jam submission

Random Sprite GeneratorView project page

Generate and save randomly generated small images and animations
Submitted by Ian Burnette (@itreallyisamre) — 3 hours, 13 minutes before the deadline
Add to collection

Play Tool

Random Sprite Generator's itch.io page

Leave a comment

Log in with itch.io to leave a comment.

Comments

Lovely sprites! I included it in my ProcJam compilation video series, if you’d like to take a look. :)

Submitted

They look so cool! I can picture games some of them would fit it just by looking at them. I'll look at the source code later and see if I can do something with it too!

Developer

Glad you think they look cool! I keep thinking of new game ideas the more I look at them ... :)

Submitted

Nice, that is pretty amazing :) btw just curious about the generation process if possible to explain :) thanks a lot :)

Developer(+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.

Submitted

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

Developer(+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.

Submitted

Those are awesome. It reminds me of the sprites from the old C64 game "Adventure Creator."

Developer

Thanks! And yeah, looking at screenshots from Adventure Creator, some of these look straight out of it. Thanks for bringing it to my attention! :)