I dream of pixel art: AI based 8x8 pixel art character generator
After two weeks of hard work... finally, a nice result! This Ludum Dare, my ambition was to create a browser game with my own embedded AI based pixel art generation. Being a total noob in Python, Pytorch and deep learning, I did not manage to create an actual game, but I was proud of myself that I did produce a half-functional tech demo running my homemade AI in the browser.
After a lot of experimentation in Pytorch with different datasets, I managed to create a useful tool for generating animated game characters. It's based on a 5-layer denoising autoencoder with noise added to the latent space, a sort of poor man's variational encoder. I started with 376 8x8 pixel art characters, obtained from freely available internet sources. It was hard to find a large enough dataset. Some images were distorted with jpeg noise. I wrote a segmenter that cuts sprites out of sprite sheets and scale them to 1x1, reconstructing the original colours as well as possible.
Pixel art is prone to overfitting, and I could get the neural net to perfectly recall all items in the data set. However, the goal is not to literally reproduce, but to interpolate. I removed a lot of oddball characters to arrive at a dataset with 166 humanoids, all with two eyes, hands, legs, etc. I shrunk the latent space to 3 values. The resulting neural net actually interpolates meaningfully between data points.
The result: http://tmtg.nl/ludumdare/ld53-charactergen/
Check out my other experiments on my game page:
https://ldjam.com/events/ludum-dare/53/i-dream-of-pixel-art-ai-game










