Retro games like Snakes, Pac-Man and Bomberman were implemented in a client-server architecture and used to teach introductory AI concepts in a more engaging way for students. The games were made accessible by representing the state in JSON and allowing agents to submit actions. A public leaderboard and open source code on GitHub gamified the experience and motivated students to improve their agents' performance. This approach increased attention in class and more students have pursued further study in AI and game development as a result.
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
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
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
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
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.