SlideShare a Scribd company logo
1 of 2
Download to read offline
UFAngryBirdsC Agent
Jonathan Ohara de Araujo Fabrício Olivetti de França
Federal University of ABC
jonathan.ohara.araujo@gmail.com
Abstract— The UFAngryBirdsC agent is an agent to solve the
21st first levels of Angry Birds for Google Chrome. The agent can
be divided in two parts: training and execution. In training mode,
the agent calculate all possible shots and test the greater part of
them, the agent tests first the most promising shots defined by a
heuristic, and then store the results in a file. The results are
stored in a graph structure where nodes in odd heights are
possible shots and nodes in even heights are possible results of a
shot. In execution mode, the agent reads the graph and evaluated
the best shot based in ExpectMiniMax algorithm.
I. AGENT
The agent was built assuming that the same shot can
generate more than one result (because of communication
issues). These results are called states. Each state keeps a lot of
information, like the shot that generates him, points, one flag
indicating if the game ends, and a number that counts the
number of times that the state was reached.
The shots and states are organized in a graph (tree)
structure. In graph the nodes in odd heights are shots (or
Possible Shots, if they was not tested) and in even heights are
states.
The figure 1 shows a simple graph of the fifth level of
Angry Birds.
Fig. 1. Level 5 resolution graph.
The agent has two modes: training and execution. The
training mode builds the graph, calculating possible shots,
testing them and writes the results in some files. The execution
mode chooses the best shot according of the level.
II. TRAINING MODE
The training mode can be separated in three parts: calculate
the possible targets for shots, test the shot and store the result.
To calculate the possible targets, the agent gets all objects
of the level (pigs, woods, stone etc), each object can have more
than one target point if exists points with euclidean distance
greater than 10 pixels (10 pixels is half width of a bird) in
object. Then the agent discards unreachable shots by the
method “isReachable” from ABUtil.
After get all possible shots, the agent calculates the
“fitness” of the shots by the equation (the lowest fitness is
chosen first):
V = d * m * x
Where:
V is the fitness;
D is the euclidean distance of the target point from the closest
pig;
M is a factor that depends of object (TNT = 0.5, Pig = 1, Ice =
1.5, Wood = 2, Stone = 3)
X is a factor that if the target.x is less than the closestPig.x the
value is 1 otherwise the value is 2.
The test generates a state new state. If the shot was already
tested, the new state is compared with the old states, if one of
these states has similar points, the number of times reached of
"old state" is added in one.
The final operation is store the graph. The graph is stored in
two JSON files, one for shots and one for states. Each state has
an identification of the parent shot, and each shot has an
identification of parent state (The root state is indicated by the
state without parent shot).
III. EXECUTION MODE
In execution mode the graph with shots and states is loaded
then the best shot is chosen.
To find the best shot the agent uses a modification of
expectMiniMax algorithm.
Simplified code of expectMiniMax used in the agent:
function expectiminimax(node)
if node is a terminal state
return points;
else if node is a state
let α := -∞
foreach shot of state
α := max(α, expectiminimax(shot))
else if node is a shot
let α := 0
foreach state of shot
α := α + (Probability[state] *
expectiminimax(state)
return α
After execute each shot, the agent compares if the state was
previously tested. If is true, the agent recalculates the
expectminimax based on the actual state. If is a new state, the
agent calculates the possible shots and chooses the shot with
best fitness (like the training mode).
The follow picture shows more detailed graph of level 9.
Fig. 2. Level 9 resolution graph.
Image observations:
 Circles: nodes. Inside the circle are information like points and target;
 Blue/Red Circles: Terminating nodes (blue = win, red = loss);
 Orange line: best shot;
 Rectangle around nodes: indicates that the nodes inside the rectangle are brothers;
The images of graph were generated by a tool developed to debug the graphs and results of the agent.

More Related Content

Similar to UFAngryBirdsC Agent

Similar to UFAngryBirdsC Agent (8)

Stratego
StrategoStratego
Stratego
 
Fcm1
Fcm1Fcm1
Fcm1
 
Fcm1
Fcm1Fcm1
Fcm1
 
Reinforcement Learning for Self Driving Cars
Reinforcement Learning for Self Driving CarsReinforcement Learning for Self Driving Cars
Reinforcement Learning for Self Driving Cars
 
Computer Vision Basics
Computer Vision BasicsComputer Vision Basics
Computer Vision Basics
 
Ml study notes id3
Ml study notes   id3Ml study notes   id3
Ml study notes id3
 
0-miniproject sem 4 review 1(1)(2).pptx
0-miniproject sem 4 review 1(1)(2).pptx0-miniproject sem 4 review 1(1)(2).pptx
0-miniproject sem 4 review 1(1)(2).pptx
 
Kk3517971799
Kk3517971799Kk3517971799
Kk3517971799
 

More from jonathanblacknight

Dicas de carreira programador Java
Dicas de carreira programador JavaDicas de carreira programador Java
Dicas de carreira programador Javajonathanblacknight
 
Desenvolvimento de jogos e Ogre3D Dia 02 - Curso FATEC Santos
Desenvolvimento de jogos e Ogre3D Dia 02 - Curso FATEC SantosDesenvolvimento de jogos e Ogre3D Dia 02 - Curso FATEC Santos
Desenvolvimento de jogos e Ogre3D Dia 02 - Curso FATEC Santosjonathanblacknight
 
Desenvolvimento de jogos com ogre 3D - Mini Curso Unip
Desenvolvimento de jogos com ogre 3D - Mini Curso UnipDesenvolvimento de jogos com ogre 3D - Mini Curso Unip
Desenvolvimento de jogos com ogre 3D - Mini Curso Unipjonathanblacknight
 
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Santos
Desenvolvimento de jogos e ogre 3D - Palestra Fatec SantosDesenvolvimento de jogos e ogre 3D - Palestra Fatec Santos
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Santosjonathanblacknight
 
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Praia Grande
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Praia GrandeDesenvolvimento de jogos e ogre 3D - Palestra Fatec Praia Grande
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Praia Grandejonathanblacknight
 
Introdução ao desenvolvimento de jogos em OGRE 3D - Mackenzie
Introdução ao desenvolvimento de jogos em OGRE 3D - MackenzieIntrodução ao desenvolvimento de jogos em OGRE 3D - Mackenzie
Introdução ao desenvolvimento de jogos em OGRE 3D - Mackenziejonathanblacknight
 
Desenvolvimento de jogos e Ogre 3D - Dev In Santos
Desenvolvimento de jogos e Ogre 3D - Dev In SantosDesenvolvimento de jogos e Ogre 3D - Dev In Santos
Desenvolvimento de jogos e Ogre 3D - Dev In Santosjonathanblacknight
 
Desenvolvimento de jogos e ogre 3D - Unip Santos
Desenvolvimento de jogos e ogre 3D - Unip SantosDesenvolvimento de jogos e ogre 3D - Unip Santos
Desenvolvimento de jogos e ogre 3D - Unip Santosjonathanblacknight
 

More from jonathanblacknight (9)

Workshop Git e GitHub
Workshop Git e GitHubWorkshop Git e GitHub
Workshop Git e GitHub
 
Dicas de carreira programador Java
Dicas de carreira programador JavaDicas de carreira programador Java
Dicas de carreira programador Java
 
Desenvolvimento de jogos e Ogre3D Dia 02 - Curso FATEC Santos
Desenvolvimento de jogos e Ogre3D Dia 02 - Curso FATEC SantosDesenvolvimento de jogos e Ogre3D Dia 02 - Curso FATEC Santos
Desenvolvimento de jogos e Ogre3D Dia 02 - Curso FATEC Santos
 
Desenvolvimento de jogos com ogre 3D - Mini Curso Unip
Desenvolvimento de jogos com ogre 3D - Mini Curso UnipDesenvolvimento de jogos com ogre 3D - Mini Curso Unip
Desenvolvimento de jogos com ogre 3D - Mini Curso Unip
 
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Santos
Desenvolvimento de jogos e ogre 3D - Palestra Fatec SantosDesenvolvimento de jogos e ogre 3D - Palestra Fatec Santos
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Santos
 
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Praia Grande
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Praia GrandeDesenvolvimento de jogos e ogre 3D - Palestra Fatec Praia Grande
Desenvolvimento de jogos e ogre 3D - Palestra Fatec Praia Grande
 
Introdução ao desenvolvimento de jogos em OGRE 3D - Mackenzie
Introdução ao desenvolvimento de jogos em OGRE 3D - MackenzieIntrodução ao desenvolvimento de jogos em OGRE 3D - Mackenzie
Introdução ao desenvolvimento de jogos em OGRE 3D - Mackenzie
 
Desenvolvimento de jogos e Ogre 3D - Dev In Santos
Desenvolvimento de jogos e Ogre 3D - Dev In SantosDesenvolvimento de jogos e Ogre 3D - Dev In Santos
Desenvolvimento de jogos e Ogre 3D - Dev In Santos
 
Desenvolvimento de jogos e ogre 3D - Unip Santos
Desenvolvimento de jogos e ogre 3D - Unip SantosDesenvolvimento de jogos e ogre 3D - Unip Santos
Desenvolvimento de jogos e ogre 3D - Unip Santos
 

Recently uploaded

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

UFAngryBirdsC Agent

  • 1. UFAngryBirdsC Agent Jonathan Ohara de Araujo Fabrício Olivetti de França Federal University of ABC jonathan.ohara.araujo@gmail.com Abstract— The UFAngryBirdsC agent is an agent to solve the 21st first levels of Angry Birds for Google Chrome. The agent can be divided in two parts: training and execution. In training mode, the agent calculate all possible shots and test the greater part of them, the agent tests first the most promising shots defined by a heuristic, and then store the results in a file. The results are stored in a graph structure where nodes in odd heights are possible shots and nodes in even heights are possible results of a shot. In execution mode, the agent reads the graph and evaluated the best shot based in ExpectMiniMax algorithm. I. AGENT The agent was built assuming that the same shot can generate more than one result (because of communication issues). These results are called states. Each state keeps a lot of information, like the shot that generates him, points, one flag indicating if the game ends, and a number that counts the number of times that the state was reached. The shots and states are organized in a graph (tree) structure. In graph the nodes in odd heights are shots (or Possible Shots, if they was not tested) and in even heights are states. The figure 1 shows a simple graph of the fifth level of Angry Birds. Fig. 1. Level 5 resolution graph. The agent has two modes: training and execution. The training mode builds the graph, calculating possible shots, testing them and writes the results in some files. The execution mode chooses the best shot according of the level. II. TRAINING MODE The training mode can be separated in three parts: calculate the possible targets for shots, test the shot and store the result. To calculate the possible targets, the agent gets all objects of the level (pigs, woods, stone etc), each object can have more than one target point if exists points with euclidean distance greater than 10 pixels (10 pixels is half width of a bird) in object. Then the agent discards unreachable shots by the method “isReachable” from ABUtil. After get all possible shots, the agent calculates the “fitness” of the shots by the equation (the lowest fitness is chosen first): V = d * m * x Where: V is the fitness; D is the euclidean distance of the target point from the closest pig; M is a factor that depends of object (TNT = 0.5, Pig = 1, Ice = 1.5, Wood = 2, Stone = 3) X is a factor that if the target.x is less than the closestPig.x the value is 1 otherwise the value is 2. The test generates a state new state. If the shot was already tested, the new state is compared with the old states, if one of these states has similar points, the number of times reached of "old state" is added in one. The final operation is store the graph. The graph is stored in two JSON files, one for shots and one for states. Each state has an identification of the parent shot, and each shot has an identification of parent state (The root state is indicated by the state without parent shot). III. EXECUTION MODE In execution mode the graph with shots and states is loaded then the best shot is chosen. To find the best shot the agent uses a modification of expectMiniMax algorithm. Simplified code of expectMiniMax used in the agent: function expectiminimax(node) if node is a terminal state return points; else if node is a state let α := -∞ foreach shot of state α := max(α, expectiminimax(shot)) else if node is a shot let α := 0 foreach state of shot α := α + (Probability[state] * expectiminimax(state) return α
  • 2. After execute each shot, the agent compares if the state was previously tested. If is true, the agent recalculates the expectminimax based on the actual state. If is a new state, the agent calculates the possible shots and chooses the shot with best fitness (like the training mode). The follow picture shows more detailed graph of level 9. Fig. 2. Level 9 resolution graph. Image observations:  Circles: nodes. Inside the circle are information like points and target;  Blue/Red Circles: Terminating nodes (blue = win, red = loss);  Orange line: best shot;  Rectangle around nodes: indicates that the nodes inside the rectangle are brothers; The images of graph were generated by a tool developed to debug the graphs and results of the agent.