SlideShare a Scribd company logo
1 of 28
Teaching AI
through
retro gaming
HOW TO MOTIVATE 21ST
CENTURY STUDENTS
THROUGH 20TH CENTURY
GAMES
Computer Science
General shortage of CS Engineers
worldwide
Artificial Intelligence has gained an
important momentum
Yet very few students finish CS
degrees
What problems students tackle in
introductory AI?
TRAVELLING SALESMAN PROBLEM GOAL STACK PLANNING
Problem:
Keeping
students
motivated
Realising what
they are
atually doing
in class.
Why did you enroll in CS ?
0
50
100
150
200
250
Knowledge General Exp Use in another
field
Money Sit at computer Programming Computer Games Hardware Exp Friend in field
Influences for CS
Male Female
Lori Carter. 2006. Why students with an apparent aptitude for computer science don't choose to major in computer science
Games & AI
• Games have traditionally been one the main research topics in
AI
• IBM Deepblue was a major landmark in AI research
• So was Alpha Go – Google/Deepmind
• Do students relate to Chess & Go ?
• Not very popular when you are 20-21
Computer
Games
WHEN STUDENTS THINK
OF GAME AI THEY THINK
OF:
FIFA, CSGO, LOL,
FORTNITE, PUBG
Matching expectations
AI is an introductory course for 3rd year students
Students programming skills are average, but mostly centred in JAVA and Python
Existing Game Engines place a large overhead and are not core to the course
Frameworks such as OpenSpiel focus in advanced AI techniques (e.g. deeplearning)
Simple games can be easily programmed and repurposed for learning
objectives (card games, arcade games, Atari, NES)
Running a live experiment
After years using a robot simulator (CiberRato) in 2015/16 a first experiment:
◦ Development of Blackjack (cards) playing agents
◦ Students grade proportional to their agent performance (with minimum set of
requirements to classify 10/20)
◦ Students could still do the CiberRato assignment from previous years
◦ Results:
◦ Almost all students opted for the Blackjack agent (despite existing code from
previous years)
◦ Students were eager to improve their agents
AI skills involved
Minimax algorithm
Monte-Carlo Simulation
Bayesian Networks
Some students actually went over the objectives and studied advanced AI algorithms to improve their agents
Improving
Grading was very complicated...
◦ ~70 agents that were required to play ~1000 games (to avoid impact of random events and luck)
◦ Agent/Game agent code tightly bound
◦ Agent was a simple Python Class object (students could temper with game engine, extra code review required)
Retro fitting
a retro game
“Normal” games are not usually
accessible to computer AI’s students
They are monolithical
The UI is bound to the execution
environment
They are not ready for automated
evaluation.
Snakes
In 2016/17 we introduced “Snakes” (originally blockade) – made popular by Nokia
Graphic Engine based on PyGame
Decoupled Agent/UI code from Game Engine (Client-Server Architecture)
One-on-One games
Scoring based on ranking (used ATP rules)
Snakes
• Students could see “live action”
• Deathmatch Snakes in 2016/17
• Collaborative Snakes in 2017/18
Snake
Some students improved the GUI
Difficulties in training (lack of opponents)
Synchronous engine meant game could stall due
to bad AI algorithms.
AI topics:
Search algoritms
A*, Greedy, Depth-First
Jump-point-search
Minimax
Pac-Man
• New asynchronous engine
• Introduced in 2018/19
Pac-Man
Viewer is yet another client (can run the
game headless)
Students get creative, developing
strategies to maximize scores (no longer
simple path finding algorithms)
AI Topics:
Search algoritms
A*, Greedy, Deapth-First
Jump-point-search
Minimax
Bomberman
• Based on previous year engine
• Current edition (2019/20)
Bomberman
Server publicly shares high scores
Students still contributing UI and
develop new strategies
AI Topics
Planning
Search algoritms
A*, Greedy, Deapth-First
Jump-point-search
Going into
detail
HOW-TO MAKE A RETRO GAME
ACCESSIBLE TO AI STUDENTS
Architecture
Games are implemented using a client-server architecture
◦ Server – runs the game logic
◦ Client – runs the AI agent
◦ Viewer – runs the GUI
Server provides a websocket interface to both client’s and
viewer’s pushing game state update asynchronously.
◦ Client updates the AI agent state and provides actions (key press)
◦ Viewers updates the screen
Upon game over the server issues an HTTP POST to a
score server containing information relevant for student
grading (e.g. score, lives, time, steps, etc)
Representation Model
Students get access to the game state through JSON documents
◦ Easily parsable in Python
◦ Human readable (eases debugging)
◦ Well known technology
Actions are those of humans
◦ Agents can press a key at any time through a JSON message containing a single key
The role of
Gamification
A public high score table with KPI’s
keeps student progress
- Has everyone score minimum to
pass?
- How many have reached the end
of the game
- How intelligent is each agent
based on KPI’s
Open Source + GitHub
The base Project is Open Source (MIT)
◦ https://github.com/dgomes/iia-ia-snakes
◦ https://github.com/dgomes/iia-ia-pacman
◦ https://github.com/dgomes/iia-ia-bomberman
Students are encouraged to contribute (extra credits for new features)
Evaluation is carried out through GitHub Classroom
◦ Each group has its own Project (private)
◦ On the deadline the GitHub Classroom collects all the code
◦ Server runs the games headless 10x
Conclusion
◦ We didn’t invent any thing new:
◦ http://modelai.gettysburg.edu
◦ We did get students involved with games they never played before 
◦ Attention to class and time spent in the Project increased
◦ Our colleagues from other courses complained 
◦ Some students actually did the next year Project for fun.
◦ Motivation has clearly increased in class 
Future
◦ This class opened a door for many of them
◦ Participation in hackatons such as Global Game Jam increased
◦ Student interest in developing games is high
◦ We need to attend to this interest (Lic, MSc, Phd?)
◦ Students already search for dissertation topics related to AI/Games
◦ Students planning in running their own hackatons.
Questions?
dgomes@ua.pt
@dgomes

More Related Content

Similar to Teaching AI through retro gaming

Claussen Windows and Game Programming 2 Syllabus
Claussen Windows and Game Programming 2 SyllabusClaussen Windows and Game Programming 2 Syllabus
Claussen Windows and Game Programming 2 Syllabus
tlc kalamazoo
 
Niko Sévoz – Game designer
Niko Sévoz – Game designerNiko Sévoz – Game designer
Niko Sévoz – Game designer
Niko S
 

Similar to Teaching AI through retro gaming (20)

Game Design as an Intro to Computer Science (Meaningful Play 2014)
Game Design as an Intro to Computer Science (Meaningful Play 2014)Game Design as an Intro to Computer Science (Meaningful Play 2014)
Game Design as an Intro to Computer Science (Meaningful Play 2014)
 
Fetc 2016 creating a game design sequence
Fetc 2016 creating a game design sequenceFetc 2016 creating a game design sequence
Fetc 2016 creating a game design sequence
 
CTE Video Game Programming Map 7th 12th
CTE Video Game Programming Map 7th 12thCTE Video Game Programming Map 7th 12th
CTE Video Game Programming Map 7th 12th
 
Claussen Windows and Game Programming 2 Syllabus
Claussen Windows and Game Programming 2 SyllabusClaussen Windows and Game Programming 2 Syllabus
Claussen Windows and Game Programming 2 Syllabus
 
Ahmed Hani Ibrahim
Ahmed Hani IbrahimAhmed Hani Ibrahim
Ahmed Hani Ibrahim
 
eMadrid Gaming4Coding - Possibilities of game learning analytics for coding l...
eMadrid Gaming4Coding - Possibilities of game learning analytics for coding l...eMadrid Gaming4Coding - Possibilities of game learning analytics for coding l...
eMadrid Gaming4Coding - Possibilities of game learning analytics for coding l...
 
AI Based Game Design - Teaching how to expand designers' artistic palette wit...
AI Based Game Design - Teaching how to expand designers' artistic palette wit...AI Based Game Design - Teaching how to expand designers' artistic palette wit...
AI Based Game Design - Teaching how to expand designers' artistic palette wit...
 
TCEA 2016 creating a game design sequence
TCEA 2016 creating a game design sequenceTCEA 2016 creating a game design sequence
TCEA 2016 creating a game design sequence
 
A primer on game-based learning
A primer on game-based learningA primer on game-based learning
A primer on game-based learning
 
Niko Sévoz – Game designer
Niko Sévoz – Game designerNiko Sévoz – Game designer
Niko Sévoz – Game designer
 
CV_NguyenHoaiNam_201510
CV_NguyenHoaiNam_201510CV_NguyenHoaiNam_201510
CV_NguyenHoaiNam_201510
 
Educon2016 12 04-2016
Educon2016  12 04-2016Educon2016  12 04-2016
Educon2016 12 04-2016
 
Game Over? New Approaches to Teaching Engineering Courses
Game Over? New Approaches to Teaching Engineering CoursesGame Over? New Approaches to Teaching Engineering Courses
Game Over? New Approaches to Teaching Engineering Courses
 
Learning Analytics Serious Games Cognitive Disabilities
Learning Analytics Serious Games Cognitive DisabilitiesLearning Analytics Serious Games Cognitive Disabilities
Learning Analytics Serious Games Cognitive Disabilities
 
Fernandez manjon
Fernandez manjonFernandez manjon
Fernandez manjon
 
E adventure serious games as open reusable content ocwg
E adventure   serious games as open reusable content ocwgE adventure   serious games as open reusable content ocwg
E adventure serious games as open reusable content ocwg
 
Applying AI in Games (GDC2019)
Applying AI in Games (GDC2019)Applying AI in Games (GDC2019)
Applying AI in Games (GDC2019)
 
Abdelrahman Al-Ogail Resume
Abdelrahman Al-Ogail ResumeAbdelrahman Al-Ogail Resume
Abdelrahman Al-Ogail Resume
 
Applying learning analytics in serious games
Applying learning analytics in serious games Applying learning analytics in serious games
Applying learning analytics in serious games
 
Stewart fecs2012
Stewart fecs2012Stewart fecs2012
Stewart fecs2012
 

More from Diogo Gomes

Conversas 2.0@sapo.labs - "svn+code.ua"
Conversas 2.0@sapo.labs - "svn+code.ua"Conversas 2.0@sapo.labs - "svn+code.ua"
Conversas 2.0@sapo.labs - "svn+code.ua"
Diogo Gomes
 

More from Diogo Gomes (9)

Introdução ao git
Introdução ao gitIntrodução ao git
Introdução ao git
 
The Things Network
The Things Network The Things Network
The Things Network
 
IEEEweek 2017 @ DETI Univ. Aveiro - Workshop Python
IEEEweek 2017 @ DETI Univ. Aveiro - Workshop PythonIEEEweek 2017 @ DETI Univ. Aveiro - Workshop Python
IEEEweek 2017 @ DETI Univ. Aveiro - Workshop Python
 
Rest workshop
Rest workshopRest workshop
Rest workshop
 
Hack'Aveiro - 1º workshop - Introdução ao Arduino
Hack'Aveiro - 1º workshop - Introdução ao ArduinoHack'Aveiro - 1º workshop - Introdução ao Arduino
Hack'Aveiro - 1º workshop - Introdução ao Arduino
 
IoT - Apps & Services
IoT - Apps & ServicesIoT - Apps & Services
IoT - Apps & Services
 
Conversas 2.0@sapo.labs - "svn+code.ua"
Conversas 2.0@sapo.labs - "svn+code.ua"Conversas 2.0@sapo.labs - "svn+code.ua"
Conversas 2.0@sapo.labs - "svn+code.ua"
 
Open Source & Research
Open Source & ResearchOpen Source & Research
Open Source & Research
 
Resource Optimizations for Broadcast enabled networks
Resource Optimizations for Broadcast enabled networksResource Optimizations for Broadcast enabled networks
Resource Optimizations for Broadcast enabled networks
 

Recently uploaded

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 

Teaching AI through retro gaming

  • 1. Teaching AI through retro gaming HOW TO MOTIVATE 21ST CENTURY STUDENTS THROUGH 20TH CENTURY GAMES
  • 2. Computer Science General shortage of CS Engineers worldwide Artificial Intelligence has gained an important momentum Yet very few students finish CS degrees
  • 3. What problems students tackle in introductory AI? TRAVELLING SALESMAN PROBLEM GOAL STACK PLANNING
  • 6. Why did you enroll in CS ? 0 50 100 150 200 250 Knowledge General Exp Use in another field Money Sit at computer Programming Computer Games Hardware Exp Friend in field Influences for CS Male Female Lori Carter. 2006. Why students with an apparent aptitude for computer science don't choose to major in computer science
  • 7. Games & AI • Games have traditionally been one the main research topics in AI • IBM Deepblue was a major landmark in AI research • So was Alpha Go – Google/Deepmind • Do students relate to Chess & Go ? • Not very popular when you are 20-21
  • 8. Computer Games WHEN STUDENTS THINK OF GAME AI THEY THINK OF: FIFA, CSGO, LOL, FORTNITE, PUBG
  • 9. Matching expectations AI is an introductory course for 3rd year students Students programming skills are average, but mostly centred in JAVA and Python Existing Game Engines place a large overhead and are not core to the course Frameworks such as OpenSpiel focus in advanced AI techniques (e.g. deeplearning) Simple games can be easily programmed and repurposed for learning objectives (card games, arcade games, Atari, NES)
  • 10. Running a live experiment After years using a robot simulator (CiberRato) in 2015/16 a first experiment: ◦ Development of Blackjack (cards) playing agents ◦ Students grade proportional to their agent performance (with minimum set of requirements to classify 10/20) ◦ Students could still do the CiberRato assignment from previous years ◦ Results: ◦ Almost all students opted for the Blackjack agent (despite existing code from previous years) ◦ Students were eager to improve their agents
  • 11. AI skills involved Minimax algorithm Monte-Carlo Simulation Bayesian Networks Some students actually went over the objectives and studied advanced AI algorithms to improve their agents
  • 12. Improving Grading was very complicated... ◦ ~70 agents that were required to play ~1000 games (to avoid impact of random events and luck) ◦ Agent/Game agent code tightly bound ◦ Agent was a simple Python Class object (students could temper with game engine, extra code review required)
  • 13. Retro fitting a retro game “Normal” games are not usually accessible to computer AI’s students They are monolithical The UI is bound to the execution environment They are not ready for automated evaluation.
  • 14. Snakes In 2016/17 we introduced “Snakes” (originally blockade) – made popular by Nokia Graphic Engine based on PyGame Decoupled Agent/UI code from Game Engine (Client-Server Architecture) One-on-One games Scoring based on ranking (used ATP rules)
  • 15. Snakes • Students could see “live action” • Deathmatch Snakes in 2016/17 • Collaborative Snakes in 2017/18
  • 16. Snake Some students improved the GUI Difficulties in training (lack of opponents) Synchronous engine meant game could stall due to bad AI algorithms. AI topics: Search algoritms A*, Greedy, Depth-First Jump-point-search Minimax
  • 17. Pac-Man • New asynchronous engine • Introduced in 2018/19
  • 18. Pac-Man Viewer is yet another client (can run the game headless) Students get creative, developing strategies to maximize scores (no longer simple path finding algorithms) AI Topics: Search algoritms A*, Greedy, Deapth-First Jump-point-search Minimax
  • 19. Bomberman • Based on previous year engine • Current edition (2019/20)
  • 20. Bomberman Server publicly shares high scores Students still contributing UI and develop new strategies AI Topics Planning Search algoritms A*, Greedy, Deapth-First Jump-point-search
  • 21. Going into detail HOW-TO MAKE A RETRO GAME ACCESSIBLE TO AI STUDENTS
  • 22. Architecture Games are implemented using a client-server architecture ◦ Server – runs the game logic ◦ Client – runs the AI agent ◦ Viewer – runs the GUI Server provides a websocket interface to both client’s and viewer’s pushing game state update asynchronously. ◦ Client updates the AI agent state and provides actions (key press) ◦ Viewers updates the screen Upon game over the server issues an HTTP POST to a score server containing information relevant for student grading (e.g. score, lives, time, steps, etc)
  • 23. Representation Model Students get access to the game state through JSON documents ◦ Easily parsable in Python ◦ Human readable (eases debugging) ◦ Well known technology Actions are those of humans ◦ Agents can press a key at any time through a JSON message containing a single key
  • 24. The role of Gamification A public high score table with KPI’s keeps student progress - Has everyone score minimum to pass? - How many have reached the end of the game - How intelligent is each agent based on KPI’s
  • 25. Open Source + GitHub The base Project is Open Source (MIT) ◦ https://github.com/dgomes/iia-ia-snakes ◦ https://github.com/dgomes/iia-ia-pacman ◦ https://github.com/dgomes/iia-ia-bomberman Students are encouraged to contribute (extra credits for new features) Evaluation is carried out through GitHub Classroom ◦ Each group has its own Project (private) ◦ On the deadline the GitHub Classroom collects all the code ◦ Server runs the games headless 10x
  • 26. Conclusion ◦ We didn’t invent any thing new: ◦ http://modelai.gettysburg.edu ◦ We did get students involved with games they never played before  ◦ Attention to class and time spent in the Project increased ◦ Our colleagues from other courses complained  ◦ Some students actually did the next year Project for fun. ◦ Motivation has clearly increased in class 
  • 27. Future ◦ This class opened a door for many of them ◦ Participation in hackatons such as Global Game Jam increased ◦ Student interest in developing games is high ◦ We need to attend to this interest (Lic, MSc, Phd?) ◦ Students already search for dissertation topics related to AI/Games ◦ Students planning in running their own hackatons.