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

ezgif-2-faca030f8a.gif

ezgif-2-0f1cfb5027.gif

ezgif-2-1a79eca360.gif

ezgif-2-2a618f75d1.gif

ezgif-2-9b082dc291.gif

ezgif-2-86f7ff6b72.gif

ezgif-2-376a042e15.gif

ezgif-2-a832fa5e58.gif

ezgif-2-c0aad1b73a.gif

ezgif-2-e95e817625.gif

ezgif-2-f5e72d183d.gif

ezgif-2-f060369ac1.gif