ΑΙhub.org
 

Utilizing generative adversarial networks for stable structure generation in Angry Birds


by and
07 November 2023



share this:

The popular physics-based puzzle game series Angry Birds has been played and enjoyed by millions of people since its original launch in 2009. However, while the game may seem somewhat simple and straightforward to play, with even very young children being able to quickly grasp its mechanics and strategies, artificial intelligence has so far failed to obtain human-level performance. Along with a lack of knowledge about the game’s internal physics engine and imprecise object detection algorithms, one of the core challenges to training better game-playing agents is the limited number and variety of available game levels.

The levels in Angry Birds often contain individual structures that are made up of multiple rectangular 2D blocks, such as those shown in figure 1. While a handful of previous structure generators for Angry Birds exist, they often rely on hard-coded design constraints that limit the output diversity. In our paper we propose using a generative adversarial network (GAN) approach that can teach itself how to design Angry Birds structures. GANs are a recent machine learning technique that can produce highly photorealistic images, but which have also been applied to create tile-based content for games such as Super Mario Bros. and the Legend of Zelda. However, the continuous and physics-based environment presented by Angry Birds provides additional challenges when it comes to applying GANs.

angry birds sceneFigure 1: An example Angry Birds level containing five distinct structures (produced by a level generation algorithm).

As a quick overview of how a GAN works, the system centres around two neural networks called the generator network and the discriminator network. The generator network is tasked with producing a set of “fake” generated examples, in our case Angry Birds structures. These generated structures are then provided to the discriminator network, along with a set of “real” structures sourced for a training data set. The discriminator network must then try to decide whether any given structure is real or fake. Based on the results, the weights for each network are then updated to improve their performance in the future. After multiple iterations, the generator network will ideally create structures that appear visually similar to those in the real dataset, and the discriminator network will be able to better differentiate between the real and fake (generated) structures. The trained generator network can then be used independently to produce Angry Birds structures as needed. Figure 2 provides a visual representation of this process.

Figure 2: GAN training process overview

While this GAN approach provides a mechanism for training a neural network to produce Angry Birds structures, it does have some requirements in terms of the input and output format. Namely, the input and output structures must be able to be represented as a matrix (i.e., a grid) of numerical values. As the structures for Angry Birds are made up of blocks with real-valued dimensions and positions, we must first encode these structures into a suitable grid-based representation before they can be used in our GAN. Likewise, we will also need to convert any generated structure from this grid-based representation back into a valid Angry Birds structure.

The structure encoding process works by placing a fixed size grid over the entire structure and filling any grid cells which have the majority of their area covered, converting the example structure shown in figure 3(a) to figure 3(b). After this, each of the five object types available in Angry Birds were split into their own layers, converting the single-layer representation in figure 3(b) into a multi-layer representation in figure 3(c). The five object types considered were wood, ice and stone blocks (the three possible block materials), pigs and empty space. This provides us with a 3-dimensional matrix representation of any Angry Birds structure, where a highlighted cell indicates the existence of the corresponding object type at this position. This process is used to encode our dataset of “real” Angry Birds structures that will then be used to train our GAN model.

Figure 3: Structure encoding process

The GANs generator network will also be trained to output structures in the same encoded representation given in figure 3(c), but with each cell instead containing a probability between 0% and 100% that the corresponding object type is present. By flattening these layers back into a 2D image, we can produce heatmap-style representations of our generated Angry Birds structures, such as those shown in figure 4. However, we now need some way to decode these images back into valid Angry Birds structures.

Figure 4: Generated Angry Birds structures (encoded)

Our process for decoding these images works by calculating how well each possible block shape would match the encoded image at each possible position, with a higher weighting given to larger blocks and ignoring any cases where blocks would overlap. The block type and position with the highest value is then placed. This process then repeats until our encoded image has been fully covered with real Angry Birds blocks, resulting in the corresponding structures shown in figure 5.

Figure 5: Generated Angry Birds structures (decoded)

While far from perfect, we believe that this approach opens a whole new avenue for GAN approaches to be applied across many types of games. This not only helps fill any content gaps that restrict agent development, but also provides a fun and novel way for players to create their own level designs. As part of this research, we have also published an interactive structure design tool that allows users to experiment with training different GAN architectures and refining the produced results. This application, along with all code and data used for this research, is available at the GitHub link below.


Note: This work won the award for Best Artifact at the Nineteenth AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment (AIIDE2023).



tags: ,


Matthew Stephenson is a lecturer at Flinders University
Matthew Stephenson is a lecturer at Flinders University

Frederic Abraham recently completed his Master of Science at Maastricht University
Frederic Abraham recently completed his Master of Science at Maastricht University

            AUAI is supported by:



Subscribe to AIhub newsletter on substack



Related posts :

coffee corner

AIhub coffee corner: Are humanoids the future of embodied AI?

  04 Nov 2026
The AIhub coffee corner captures the musings of AI experts over a short conversation.

“With AI, we need to reconsider what it means to learn”

  03 Nov 2026
Artificial intelligence is forcing universities to reinvent how they teach and assess students’ knowledge.

Forthcoming machine learning and AI seminars: November 2026 edition

  02 Nov 2026
A list of free-to-attend AI-related seminars that are scheduled to take place in the next couple of months.
monthly digest

AIhub monthly digest: October 2026 – neurosymbolic planning, time-series forecasting, and robots for the home

  30 Oct 2026
Welcome to our monthly digest, where you can catch up with AI research, events and news from the month past.
AI pioneers

From teaching machines to teaching people: an interview with Michael Littman

  29 Oct 2026
AI Pioneer Michael Littman reflects on the evolution of reinforcement learning, the power of science communication, and how generative AI is changing the way we teach and learn.

From lab to life: Why translating AI advances to the real world is a major challenge

  28 Oct 2026
Systems that perform well in controlled lab settings often fall short when deployed in homes, in hospitals or on city streets.

Researchers get AI ‘drunk’ to expose new cyber security risks in chatbots

Fine-tuning large language models using drunken text makes them more likely to leak secrets and answer harmful questions.

AI is creating jobs as well as erasing them – but how rewarding are they?

  26 Oct 2026
One area of increased employment is in people “cleaning up” after LLMs, or quality controlling them.


↑


AUAI is supported by:







Subscribe to AIhub newsletter on substack




 















©2026.05 - Association for the Understanding of Artificial Intelligence