artificial intelligence based automatic generation of entertaining gaming engines
DESCRIPTION
Artificial Intelligence Based Automatic Generation of Entertaining Gaming Engines. Dr. Zahid Halim Faculty of Computer Science and Engineering Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi [email protected] 19 th June 2012 . Layout. AI. - PowerPoint PPT PresentationTRANSCRIPT
Artificial Intelligence Based Automatic Generation of Entertaining Gaming Engines
Dr. Zahid HalimFaculty of Computer Science and EngineeringGhulam Ishaq Khan Institute of Engineering Sciences and Technology, [email protected] 19th June 2012
2
Layout
Artificial Intelligence
Results of the experiment
Questions
AI
What is not AI and application of AI~ AI
Q/A
Case Study
Results
Nuts and bolts of a predator/prey gaming engine
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
3
• Intelligence is the computational part of the ability to achieve goals in the world
• One of the most dumbest thing in world is computer
• Recall the two numbers addition program using int data type
• Artificial intelligence allows computers to• Think like humans• Learn from experience• Recognize patterns in large amounts of complex data • Make complex decisions based on knowledge and
reasoning skills
Artificial Intelligence (AI)
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
4
NOT AI• A meter reading algorithm
at petrol pumps• Encyclopedia • SQL query
• TOPIO, humanoid robot can play ping-pong with human
• Speech and Voice Recognition
• Face recognition
AI
AI is notEverything fast is not AI
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines5
• Artificial Neural Networks• Swarm Intelligence• Evolutionary Computation• Pruning Algorithms
:::
(and the list goes on)
AI tools
Automated Game GenerationA Case Study
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines7
Search Space Predator/prey Games
• 14 X 14 grid excluding the
boundary walls.
• Couple of walls at fixed positions
and of size 7 cells
• There is one player controlled by
the human player.
• There are N (0-20)other pieces of
M (1,2 and 3) types
• Maximum duration 100 game
steps
• Finish game
• Agent dies
• Maximum score is achieved
• Maximum game steps
utilized
• Movement logic
• No movement
• Clockwise
• Counter clockwise
• Random
• Random direction
• Collision logic
• no effect
• random relocation to a new
location on the grid
• death.
• Scoring logic
• +1, -1, 0
8
Chromosome Encoding for Genetic Algorithm
Number of predators
Red 0-20
Collision logic
Blue-Green 0-2Green 0-20 Blue-Blue 0-2
Blue 0-20 Blue-Agent 0-2
Movement logicRed 0-4 Agent-Red 0-2Green 0-4 Agent-Green 0-2
Blue 0-4 Agent-Blue 0-2
Collision logic
Red- Red 0-2
Score logic
Red- Red -1,0,+1Red- Green 0-2 Green-Green -1,0,+1Red-Blue 0-2 Blue-Blue -1,0,+1Red- Agent 0-2 Agent-Red -1,0,+1Green-Red 0-2 Agent Green -1,0,+1Green-Green 0-2 Agent-Blue -1,0,+1Green-Blue 0-2 Green-Red -1,0,+1Green-Agent 0-2 Blue-Red -1,0,+1Blue-Red 0-2 Blue-Green -1,0,+1
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
9
Entertainment Metrics• Duration of the Game
• Appropriate Level of Challenge
• Diversity
• Usability
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
)/nL(=D k0K n
)||
(=C m
am
SSS
e
)/n))(d((=Divn
1i
m
0kk
))/n||/))(C(((=Un
1i
m
0kk
Cu
10
Rule Based Controller• The controller looks up, down, left and right. It notes the nearest piece (if
any) in each of the four directions, and then it simply moves one step towards the nearest score increasing piece
• If there are no score increasing piece present it determines its step according to the following priority list
• Move in the direction which is completely empty • If more than one directions are empty move towards the farthest
wall• Move in the direction which contains a score neutral piece• Move in the direction which contains a score decreasing piece• Move in the direction which contains a death causing piece
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
11
Neural Network Based Controller• Multi-layer fully feed forward • 6 neurons in the input layer• 5 neurons in the hidden layer • 4 output layer neurons• Sigmoid activation function• Edges weights -5 to +5. ∆xr
∆xg
∆xb
∆yg
∆yb
∆yr NuNd
Nl
Nr
Connection Edges
Connection Edges
Connection Edges
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
12
Experimentation Setup• 10 chromosomes are randomly initialized by the GA
• One offspring is created for each chromosome • Duplicating it• Mutating any one of its gene
• Results in 20 chromosomes from which 10 best chosen
• 100 generations
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
13
Appropriate level of challenge
Duration of game
Diversity
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
Predators Movement logic Collision logic
(a)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R3 17 13 3 0 3 2 1 1 0 0 1 0 2 1
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
2 2 2 0 0 2 -1 -1 0 -1 0 0 -1 -1 0
Predators Movement logic Collision logic
(b)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R0 18 10 0 1 3 2 2 1 1 2 0 0 1 1
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
1 1 1 1 0 2 0 1 0 1 -1 -1 1 -1 -1
Predators Movement logic Collision logic
(a)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R10 0 11 0 0 3 1 2 1 1 0 0 2 0 2
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
2 2 2 2 0 2 1 1 -1 0 1 -1 -1 1 0
Predators Movement logic Collision logic
(b)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R7 7 8 2 4 3 2 0 2 2 0 0 2 1 2
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
0 0 0 2 0 2 -1 0 0 0 1 1 1 1 0
Predators Movement logic Collision logic
(a)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R0 10 0 2 4 2 0 1 2 1 2 0 2 0 1
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
1 0 2 1 0 2 -1 0 -1 1 0 -1 0 -1 -1
Predators Movement logic Collision logic
(b)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R0 17 0 4 4 4 1 2 0 0 0 1 2 2 1
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
1 1 2 1 0 2 -1 -1 0 0 -1 -1 -1 1 0
14
Usability
Combined Fitness
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
Predators Movement logic Collision logic
(a)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R20 18 19 1 2 2 2 0 0 2 2 1 2 0 2
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
2 2 0 2 0 2 1 -1 0 1 0 0 -1 0 0
Predators Movement logic Collision logic
(b)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R19 20 20 4 4 2 2 0 2 2 2 2 0 2 2
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
2 0 2 2 0 2 -1 -1 1 -1 1 1 0 -1 -1
Predators Movement logic Collision logic
(a)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R15 8 3 1 1 0 1 2 0 0 1 0 1 2 0
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
2 2 0 0 0 0 1 1 -1 -1 -1 1 -1 -1 -1
Predators Movement logic Collision logic
(b)
R G B R G B R-R R-G R-B R-A G-R G-G G-B G-A B-R11 20 3 2 4 2 2 2 0 2 2 2 0 1 1
Collision logic Scoring logicB -G B-B B-A A-R A-G A-B R-R G-G B-B A-R A-G A-B G-R B-R B-G
1 1 2 0 0 2 0 1 1 -1 1 0 -1 0 1
1 3,34 54 56 66 …. !!!
15
Controller Learning Ability
Diversity-RB
Duration-RB
Challenge-RB
Usability-RB
Diversity-ANN
Duration-ANN
Challenge-ANN
Usability-ANN
Combined-RB
Combined-ANN
Random
0 200 400 600 800 1000 1200
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
•User Survey• 10 subjects• Conducted in two different sets on different days
• Rule based controller • ANN based controller• Each individual was given 6 games• Play 2 times
Rand
om
Duratio
n
Challe
nge
Diversi
ty
Usabilit
y
Combin
ed Fit
ness
048
12
Rule Based Con-trollerANN Based Con-troller
Duration4%
Challenge32%
Usability24%
Combined Fitness
40%
Human User Survey ANN Based Controller
Duration12%
Chal-lenge24%
Usability18%
Com-bined
Fitness47%
Human User Survey Rule Based Controller
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
Questions
This presentation is uploaded at http://ming.org.pk/zahid.htm
Thank you for your patience
Bibliography• Halim, Zahid, A. Rauf Baig, and Hasan Mujtaba. "Measuring entertainment and automatic generation of entertaining
games." International Journal of Information Technology, Communications and Convergence 1.1 (2010): 92-107.
• Halim, Zahid, A. Rauf Baig, and Mujtaba Hasan. "Evolutionary Search For Entertainment In Computer Games." Intelligent Automation & Soft Computing 18.1 (2012): 33-47.
• Halim, Zahid, and A. Raif Baig. "Evolutionary Algorithms towards Generating Entertaining Games." Next Generation Data Technologies for Collective Computational Intelligence. Springer Berlin Heidelberg, 2011. 383-413.
• J.Schmidhuber, ”Developmental robotics, optimal artificial curiosity, creativity, music, and the fine arts”, Connection Science, vol. 18, pp.173–187, 2006
• N. Esposito, “A Short and Simple Definition of What a Videogame Is”, in proceedings of Digital Games Research Association (DiGRA), Vancouver, Canada, 16-20 June, 2005
• J.Smed and H.Hakonen, "Towards a Definition of a Computer Game", Technical Report, Computer Games Research Group, Department of Information Technology, University of Turku, Finland, 2005
• http://www.glasbergen.com/computer-cartoons/
• http://www-formal.stanford.edu/jmc/whatisai/node1.html
• G. N. Yannakakis , J. Hallam, ”Towards Optimizing Entertainment In Computer Games”, Applied Artificial Intelligence”, v.21 n.10, p.933-971, November 2007
• http://www.easy-marketing-strategies.com/writing-a-case-study.html
• http://www.123rf.com/photo_9926111_confused-cartoon-guy.html
Artificial Intelligence based Automatic generation of Entertaining Gaming Engines
18