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 traditionally focused on discrete, tile-based games such as Super Mario Bros or DOOM. In these environments, the placement of a block is binary and largely independent of physical forces. Angry Birds, however, operates in a continuous 2D space where structural integrity is paramount. Structures are composed of various rectangular blocks made of wood, ice, or stone. If a generator fails to account for gravity and support, the resulting structure will collapse immediately upon the start of the physics simulation. This paper addresses the challenge of bridging the gap between the probabilistic, "fuzzy" outputs of a GAN and the precise, discrete requirements of a stable physical structure.
Methodology
The authors treated the problem as an image-to-physics translation task, employing a Deep Convolutional GAN (DCGAN) architecture. To improve training stability and mitigate common issues like mode collapse, they utilized the Wasserstein objective function with a Gradient Penalty (WGAN-GP).
Multilayer Encoding
A core contribution of this work is the multilayer encoding scheme. Instead of a single grid, levels are represented as a 128x128x5 tensor. Each of the five channels corresponds to a specific object type: Wood, Ice, Stone, Pigs, and Air. This "one-hot" style encoding enables the GAN to learn the spatial relationships and typical placement patterns of different materials independently—for instance, learning that stone blocks are frequently used as foundational elements.
The Selection-Ranking Decoder
Because GANs naturally produce continuous values rather than discrete block coordinates, a specialized decoding process was required. The "Selection-Ranking" decoder uses a Gaussian kernel matching process to evaluate and rank potential block placements based on the GAN's output intensity. The system also implements a "clipping" threshold to filter out low-confidence noise that would otherwise result in unstable, fragmented structures. By iteratively selecting the highest-ranked placements and updating the occupancy map, the decoder "heals" the GAN's output into a valid XML-based level description.
Dataset and Training
To overcome the scarcity of human-authored levels, the researchers utilized the Iratus Aves open-source generator to synthesize an initial dataset of 5,000 structures. This dataset underwent rigorous filtering to remove near-duplicate patterns and ensure all training examples were physically stable. The final training set consisted of 3,566 unique structures, providing a robust foundation for the GAN to learn the underlying principles of structural stability in the Angry Birds universe.
Experimental Results
The performance of the generator was evaluated by producing 8,000 new structures and testing them within the Science Birds physics engine.
Stability was assessed using two distinct metrics:
- Block Velocity (Strict): Measures whether any block moves upon initialization. Under this strict criterion, 11.8% of structures were perfectly stable.
- Block Destruction (Lenient): Measures whether the structure remains standing despite minor initial movements. Using this metric, 43.6% of the generated structures were found to be stable and playable.
The GAN-generated structures demonstrated significant diversity, with an average of 24 blocks per structure and wide variations in height and width. Qualitatively, the generated designs were more "organic" and less rigidly symmetrical than the training data, suggesting that the GAN successfully learned to generalize structural principles rather than simply memorizing templates.
Conclusion and Future Work
This research demonstrates the viability of GANs for generating complex, physics-compliant content. The combination of multilayer encoding and a selection-ranking decoder effectively manages the transition from continuous probability maps to discrete physical objects. Future iterations of this work could incorporate non-rectangular blocks (triangles and circles), utilize Conditional GANs (CGANs) for user-specified generation parameters, or explore more recent architectures like Stable Diffusion to further enhance the quality and stability of the generated content.
Summary updated