Abstract
This paper investigates the suitability of using Generative Adversarial Networks (GANs) to generate stable structures for the physics-based puzzle game Angry Birds. While previous applications of GANs for level generation have been mostly limited to tile-based representations, this paper explores their suitability for creating stable structures made from multiple smaller blocks. This includes a detailed encoding/decoding process for converting between Angry Birds level descriptions and a suitable grid-based representation, as well as utilizing state-of-the-art GAN architectures and training methods to produce new structure designs. Our results show that GANs can be successfully applied to generate a varied range of complex and stable Angry Birds structures.
Introduction
Procedural Content Generation via Machine Learning (PCGML) has seen significant success in tile-based games like Super Mario Bros., where objects align to a uniform grid. However, physics-based environments like Angry Birds present a unique challenge. In these domains, structures are composed of blocks with varying dimensions and real-valued positions that must adhere to gravitational constraints. A haphazard placement of blocks results in immediate structural collapse, rendering the level unplayable. This research addresses the gap in using image-generation techniques, specifically GANs, to produce content that requires both spatial precision and physical stability.
Methodology
The researchers utilized a Deep Convolutional GAN (DCGAN) architecture, enhanced with Wasserstein loss and a Gradient Penalty (WGAN-GP) to ensure training stability and prevent mode collapse.
Representation and Rasterization
To bridge the gap between continuous game coordinates and the discrete grid required by GANs, the authors developed a multi-layer representation. Levels were encoded into a 5-layer grid representing wood, ice, stone, pigs, and empty space. A raster size of 0.07 units was chosen as a common denominator for block sizes to minimize rounding errors during conversion.
Decoding and Selection-Ranking
Because GAN outputs are continuous "fuzzy" probability values, a novel Selection-Ranking Decoder was implemented. This algorithm uses Gaussian kernels to generate "Hit-Probabilities" for block centers and a Size-Ranking matrix to identify the most likely block types (e.g., specific rectangular or square shapes) that fit the generated heatmaps. A subsequent "healing" step resolves any physical overlaps between blocks.
Dataset
The training data consisted of 5,000 XML level descriptions generated by the Iratus Aves tool. After filtering for diversity and removing overly similar structures, a final set of 3,566 unique structures was used for training.
Results
The system generated 8,000 structures, which were evaluated for stability and diversity. Stability was measured in two ways:
- Block Velocity: A strict measure where no block movement is permitted. Under this metric, 11.8% of structures were perfectly stable.
- Block Destruction: A more lenient measure where blocks may shift slightly without the structure collapsing. Here, 43.6% of structures were found to be stable.
Diversity analysis showed that the GAN successfully learned to use a wide variety of block types, such as "RectFat (Vert)" (15.81%) and "SquareHole" (8.75%), rather than relying on a single "safe" design. Furthermore, the generation process is highly efficient, capable of producing and decoding 8,000 structures in approximately 15 minutes on a standard CPU.
Conclusion
This work demonstrates that GANs can effectively learn the visual patterns associated with physical stability, such as pillars supporting beams, without an explicit physics model. While the failure rate remains high (over 50% collapse), the use of a "generate-and-test" filter can mitigate this in practical applications. Future work may explore more advanced architectures like Stable Diffusion or training on more diverse, human-authored datasets to further enhance creativity and structural integrity.
Summary updated