School of Science and Technology 科技學院
Electronic and Computer Engineering 電子工程學系

Deceptive Angry Birds

Student Tang Pak Hei
Programme Bachelor of Science with Honours in Electronic and Computer Engineering
Supervisor Mr. Bruce Tong
Year 2021/22

Abstract

To improve the performance of Artificial Intelligence (AI) in predicting the result of physical actions, many AI researchers use Angry Birds as a platform to improve their algorithm. The latest Angry Birds agent is still not good enough compared to human players since they still have design flaws in their algorithm. Some AI researchers use the method of machine learning on their Angry Birds agent but there are not enough challenging game levels for the agent to play.

The aim of this project is to design deceptive Angry Birds levels for agents to improve using machine learning. In this project, I discovered three deceptive elements and designed three deceptive levels for each of them. Five Agents are used to test the game level to make sure the elements are valid and the experiment result are discussed. Human players are invited to test the difficulty of playing these deceptive levels. There is an experiment on checking the validity of deceptive elements in related work done by other researchers. I also propose future works that can help on improving the agents' performance.

Demonstration Video

Objectives

Aim

This project aims to design deceptive Angry Birds game levels that are easy for human players but can trick agents. Nowadays, machine learning provides agents the ability to improve from previous experience. For Angry Birds agents, some of them can learn from the failure and improve the calculation of shooting action. Deceptive game levels are needed for them to try and improve. By making deceptive game levels, more challenging levels for agents can be provided. The agents can try different ways to solve the game levels and improve themselves in the process. Therefore, agents can do better in predicting the result of physical actions in the future.

Objectives

The objectives of this project are as follows:

  • Build the communication between the agents and Science Birds to test the game levels
  • Identify the weakness of the agents on playing Angry Birds
  • Compare the performance of agents to the performance of human players in playing Angry Birds game levels
  • Design deceptive Angry Birds game levels that cannot be solved by current agents

Methodologies and Technologies used

In this project, two different systems are used for running different agents. They are for installing different Java versions. The Windows system has the most updated java version and can run the new agents using Science Birds. On the other hand, some agents have developed a few years ago and are incompatible with Science Birds and the new Java version. For these agents, a Linux system created by VirtualBox is used to run them. Java version 8 had been installed in this Linux system. The game playing interface of Science Birds requires Java 15 or high versions so it cannot interact with outdated agents. The game-playing software provided by AIbirds.org is chosen as the platform for testing game levels. When a deceptive game level is completed, the level is tested first by the new agents. After that, the XML file is transferred to the Linux system using Google Drive. At last, the result of the agents in the Linux system is transferred back to the Windows system. Figure 1. shows the data flow diagram.

Figure 1. Data Flow Diagram

Science Birds and the basic game playing software load game level by reading XML files. The game level XML files contain the data of game objects. By modifying the content of the XML file, a new game level is created.

Figure 2 shows an example of a game level XML file. All birds in the game levels are listed in the “Birds” section.  Also, information of all objects in the game level can be found in the “GameObjects” section. There are a few parameters for each object. The “type” parameter shows the type of the object. There are different type of blocks and pigs. The “material” parameter shows the material of the block (wood, stone or ice). The “x” and “y” parameter show the location of the object in x and y axis. The “rotation” shows the angle of how the block is placed. The object is placed horizontally when the “rotation” parameter is 0 and placed vertically when the “rotation” parameter is 90. Figure 3.3 shows the in-game screenshot of the game level.

For testing the difficulty of the game levels, some participants will be invited to play the latest game level when new deceptive game levels are completed. There will be inexperienced players, experienced players and well-experienced players to play the game levels. A game level that cannot be solved by most of the experienced players will be too hard and need to be simplified.

Figure 2. A part of a game level XML file

Figure 3. The in-game screenshot of the game level in Figure 2

Experiment

To verify the deceptive elements, the three levels are played by agents and their performance are recorded.

For competition recording reviewing, the recording of the 2021 Angry Birds AI competition was reviewed. There are total of 16 levels in the recording. Two deceptive elements which are not mentioned in related work were discovered. They are rebounding birds, separated TNT, and destroying building. Game levels that have similar designs were created to verify the observation. This task is completed on time on 8th December.

For building the communication between the agents and Science Birds, the task is expected to be done at the end of November. It was completed on time but the number of useable agents is unsatisfying.

Rebounding birds

In some Angry Birds game levels, there is no direct path to hit the pigs. The player needs to shoot the birds at other object and let the birds rebound back to hit the pigs. This type of deceptive level requires agents to simulate the shooting path of rebounding birds.

Level 1 of rebounding birds

Figure 4. Level 1 of rebounding birds

In this game level, there is a pig surrounded by platform blocks. There is a gap in the front wall of the surrounding blocks. The birds will be blocked by the front wall if the player try to shoot the pig directly.

Figure 5. Expected solution of Figure 4.

The expected solution of this game level is to shoot birds at the wall behind the pig. The birds will rebound back and hit the pig.

Seperated TNT

TNT is a powerful object in Angry Birds that can damage nearby objects when being hit. From literature review, some agents are designed to have high priority on triggering TNT. This type of deceptive level tries to attract agent's attention by place a separated TNT that no pigs nearby.

Figure 6. Level 1 of seperated TNT

In this game level, there are only two objects, a separated TNT and an unprotected pig placed on the ground.

Figure 7. Expected solution of Figure 6.

The excepted solution of this game level is to ignore the TNT and shoot the pig directly. 

Destroying Building

In Angry Birds, some level requires the player to destroy buildings in order to solve the level. This type of deceptive level requires agents to kill the pig by destroying its supporting platform or destroy building by selecting the weak part of building.

Figure 8. Level 1 of destroying building

In this game level, the pig is on the top of the supporting building.

Figure 9. Expected solution of Figure 8.

The expected solution of this game level is to kill the pig by shooting the bird at the supporting building.

Results and Discussion

The following parts show the result of the experiment on testing designed game levels. Since naïve agent and IHSEV agent have randomness in their algorithm, they will play the game level for ten times for fairness.

Rebounding birds

Table 1. experiment result of rebounding birds levels

For agents, all of them failed to solve this type of game levels. None of them is able to do shots similar to the expected solution. Most of them try to shoot the pig using a direct trajectory and are blocked by platform blocks. It shows that agents are unable to handle levels that contain this deceptive element.

For human players, they perform good in level 1 and 2. It shows that these two levels are not difficult. Three unexperienced player and one experienced player failed to solve level 3. It means this level is too hard and the difficulty need to be lowered.

Figure 10. shows the shooting angle of agents in level 1. The purple broken line is the shooting angle of IHSEV agent and the red broken line is the shooting angle of other 4 agents.

Figure 10. Shooting angle of agents in level 1

Seperated TNT

Table 2. experiment result of Seperated TNT levels

Most agents solved this level. They are able to ignore the TNT and attack the pig. Interestingly, IHSEV agent seems to randomly select the target between the TNT and the pig in these levels. This is not happened on naïve agent which also have randomness in its algorithm. The result shows that this deceptive level is not challenging enough for agents.

All human players are able to ignore the TNT even though two of the inexperienced players missed the target in level 3. It is still an easy level for human players.

In figure 11., the purple solid line is the shooting angle of solved case of IHSEV agent and the purple broken line is the shooting angle of failed case.

Figure 11. Shooting angle of agents in level 1

Destroying building

Table 3. experiment result of destroying building levels

For agents, almost all of them failed to solve this type of deceptive game level. Similar to the levels of rebounding birds, agents try to shoot the pig using a direct trajectory and are blocked by platform blocks. It shows that this deceptive element is difficult for agents.

For human players, all players can solve the game levels. It shows the deceptive levels is very easy for human players.

Conclusion

By designing deceptive Angry Birds game levels, two deceptive elements are discovered. The three levels are simple for human players but some agents cannot solve them. It highlights the design flaws of agents. These are the weaknesses of agents. To improve the performance of agents, the latest agents should challenge these game levels. Through machine learning, agents can learn to handle game levels that contain these deceptive elements. If more deceptive levels are designed, the more challenging levels can be provided for agents to learn. Therefore, future agents can perform better in predicting the result of physical actions. Also, this project explores some methods to run different agents on a computer. It would be useful for students in doing future research.

Although this project has some achievements, there are still many limitations. The first limitation is the lack of useable agents.  Open-source agent is hard to find on the Internet. Some of the resources of agents are already invalid. Many agents do not update for a long time and do not compatible with the new game-playing software. As a result, only five agents can be used to test the game level in the project and three of them are already outdated. In the part of checking the validity of deceptive elements in previous work, there is only one usable agent that has updated after 2018. It affected the credibility of the experiment result.

The second limitation is the amount of game level. Since the content of game levels are manually input, only a small amount of game levels can be provided. It makes the influence of this project become limited.

Future Work

For future work, researchers can modify the existing level generator or develop a new level generator to generate game levels that contain the new deceptive elements. When high-quality deceptive levels can be generated, a large number of challenging levels can be provided to the latest agents. The capability of future agents can be improved.

Jonathan Chiu
Marketing Director
3DP Technology Limited

Jonathan handles all external affairs include business development, patents write up and public relations. He is frequently interviewed by media and is considered a pioneer in 3D printing products.

Krutz Cheuk
Biomedical Engineer
Hong Kong Sanatorium & Hospital

After graduating from OUHK, Krutz obtained an M.Sc. in Engineering Management from CityU. He is now completing his second master degree, M.Sc. in Biomedical Engineering, at CUHK. Krutz has a wide range of working experience. He has been with Siemens, VTech, and PCCW.

Hugo Leung
Software and Hardware Engineer
Innovation Team Company Limited

Hugo Leung Wai-yin, who graduated from his four-year programme in 2015, won the Best Paper Award for his ‘intelligent pill-dispenser’ design at the Institute of Electrical and Electronics Engineering’s International Conference on Consumer Electronics – China 2015.

The pill-dispenser alerts patients via sound and LED flashes to pre-set dosage and time intervals. Unlike units currently on the market, Hugo’s design connects to any mobile phone globally. In explaining how it works, he said: ‘There are three layers in the portable pillbox. The lowest level is a controller with various devices which can be connected to mobile phones in remote locations. Patients are alerted by a sound alarm and flashes. Should they fail to follow their prescribed regime, data can be sent via SMS to relatives and friends for follow up.’ The pill-dispenser has four medicine slots, plus a back-up with a LED alert, topped by a 500ml water bottle. It took Hugo three months of research and coding to complete his design, but he feels it was worth all his time and effort.

Hugo’s public examination results were disappointing and he was at a loss about his future before enrolling at the OUHK, which he now realizes was a major turning point in his life. He is grateful for the OUHK’s learning environment, its industry links and the positive guidance and encouragement from his teachers. The University is now exploring the commercial potential of his design with a pharmaceutical company. He hopes that this will benefit the elderly and chronically ill, as well as the society at large.

Soon after completing his studies, Hugo joined an automation technology company as an assistant engineer. He is responsible for the design and development of automation devices. The target is to minimize human labor and increase the quality of products. He is developing products which are used in various sections, including healthcare, manufacturing and consumer electronics.

Course Code Title Credits
  COMP S321F Advanced Database and Data Warehousing 5
  COMP S333F Advanced Programming and AI Algorithms 5
  COMP S351F Software Project Management 5
  COMP S362F Concurrent and Network Programming 5
  COMP S363F Distributed Systems and Parallel Computing 5
  COMP S382F Data Mining and Analytics 5
  COMP S390F Creative Programming for Games 5
  COMP S492F Machine Learning 5
  ELEC S305F Computer Networking 5
  ELEC S348F IOT Security 5
  ELEC S371F Digital Forensics 5
  ELEC S431F Blockchain Technologies 5
  ELEC S425F Computer and Network Security 5
 Course CodeTitleCredits
 ELEC S201FBasic Electronics5
 IT S290FHuman Computer Interaction & User Experience Design5
 STAT S251FStatistical Data Analysis5
 Course CodeTitleCredits
 COMPS333FAdvanced Programming and AI Algorithms5
 COMPS362FConcurrent and Network Programming5
 COMPS363FDistributed Systems and Parallel Computing5
 COMPS380FWeb Applications: Design and Development5
 COMPS381FServer-side Technologies and Cloud Computing5
 COMPS382FData Mining and Analytics5
 COMPS390FCreative Programming for Games5
 COMPS413FApplication Design and Development for Mobile Devices5
 COMPS492FMachine Learning5
 ELECS305FComputer Networking5
 ELECS363FAdvanced Computer Design5
 ELECS425FComputer and Network Security5