AI Generated pixel art needs a build system, not better prompts
I rebuilt my tiny homage to Warhammer 40k this week. The original, Hive City Rampage, was a Python/Pygame (monstrocity), top-down grimdark shooter that ran but was a prototype. Now we have a sequel, Ashgate Siege, is Godot 4: gothic isometric, two missions, built for Mac and Android. I have a confession though, the 95k lines of GDScript, 8 commits, roughly five hours was written by an AI agent…
My AI-generated homages to Warhammer 40k now have a built system instead of relying solely on prompts. The sequel, Ashgate Siege, is built with Godot 4 for Mac and Android. While the code was easy to produce, the challenge lay in creating consistent 2D sprites for each character. AI-generated sprites often suffer from varying proportions, light sources, and limb positioning, making them look disjointed.
To address this issue, I implemented a strict schema for prompt generation. Every prompt now specifies exact dimensions for the sprite sheet, grid layout, and color key. By enforcing these constraints and treating the AI generation as an API call with a defined schema, I was able to maintain consistency across frames and poses. The importer crops and scales the generated sprites into runtime assets, while a native test suite performs silhouette checks to ensure quality.
This pipeline ensures that regenerated assets meet strict criteria, preventing odd-looking artifacts from appearing in the final game.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.