Teaching Artificial Intelligence Using a Web-Based Game Server

8 downloads 499 Views 592KB Size Report
Nov 17, 2013 - the university level and a web-based game server that was implemented to support this concept. Our results show an improved engagement of ...
Teaching Artificial Intelligence Using a Web-Based Game Server Stefan Friese

Kristian Rother

University of Duisburg-Essen Universitätsstr. 9 45141 Essen, Germany

University of Duisburg-Essen Universitätsstr. 9 45141 Essen, Germany

[email protected]

[email protected]

ABSTRACT

on equal footing. The following table lists our criteria based on classification schemes in [7, 5, 9] (completeness of information, randomness), [1] (alea, agˆ on, mimicry, ilinx) and [3] (pace, player structure, teleology, time representation, savability, determinism):

Games are a classical field of application for concepts of artificial intelligence (AI). We outline a didactic concept for teaching AI to Business Information Systems students at the university level and a web-based game server that was implemented to support this concept. Our results show an improved engagement of students as well as a flexible technical basis for AI education and AI research which can be applied in various learning and research contexts.

• Completeness of Information Perfect information games were excluded (perfect information is less common in economical decision problems). • Randomness/Alea Purely random games are unsuitable (no player influence), but a certain amount of randomness, e.g. a random initial state, may fit.

Categories and Subject Descriptors K.3.1 [Computers and Education]: [Computer Uses in Education]; K.3.2 [Computers and Education]: [Computer and Information Science Education]

• Competitiveness/Agˆ on A competitive game should be chosen to fit economical environments. This matches our course setting of competing teams.

General Terms Game Server, AI Education

• Mimicry A player being an imaginary character or not had no influence on the game choice.

Keywords

• Psychomotor skills/Ilinx We exclude games requiring physical skills as robotics is beyond our scope.

Artificial Intelligence, Games, Teaching, Server

1.

• Pace Real-time games imply a higher level of complexity regarding protocols and communication. As many real-world problems in our scope can be represented in a turn-based way, we favor these games.

INTRODUCTION

The concepts for the course described in this paper are aimed at teaching AI based on games to graduate students in Business Information Systems at a German university. Using games to teach CS and AI is a common concept [8, 6, 2, 10]. An increased engagement of students is expected, and games provide an environment of a certain level of complexity and a well-known set of rules.

2.

• Player structure Two adversarial players seem to be a good choice, because testing and evaluation of the implemented agents is easier for smaller sets of players. • Teleology To be able to simulate tournaments in a reasonable amount of time, the game should be finite.

GAME CHOICE CRITERIA

• Time Representation As we set a focus on turnbased games already, the representation of time defaults to discrete steps.

The game choice is important. It depends on the AI techniques to be taught and the properties of relevant real-world problems. In our case, these are economic planning and decision problems. A suitable level of complexity is required and the game should not be well known to start students

• Savability It should be possible to interrupt and resume matches as this simplifies testing agents. • Determinism For evaluation, deterministic effects of actions are desirable. Matches should be repeatable.

Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for thirdparty components of this work must be honored. For all other uses, contact the Owner/Author. Copyright is held by the owner/author(s). Koli Calling ’13, Nov 14-17 2013, Koli, Finland ACM 978-1-4503-2482-3/13/11. http://dx.doi.org/10.1145/2526968.2526992

3.

THE GAMES OF ROK AND TENCARDS

Our choice was the trick-based two-player card game Rok, a classical but rather unknown game matching our criteria. A match starts with a bidding phase, followed by a playing phase. Both players have a hand that is only known to them and a board where the top cards are visible. Points

193

are awarded for won tricks and certain cards in a trick1 . Rok has similarities to Bridge, Skat and Doppelkopf. Learning a new game and applying AI concepts to a complex scenario is a hurdle for students from a conceptual and technical perspective. Hence we developed tencards, a custom-tailored, simple but non-trivial introductory game which prepares students for the more complex Rok task. The rules of this two-player game are extremely simple: There are ten cards numbered one to ten. Each player has three cards, while the remaining ones form a hidden stack. Each player plays a card from his hand or a stack card. The player who played the higher card wins the trick and continues. The game is won by the first player who wins two tricks. Despite the simplicity, non-trivial situations can occur.

4.

time to focus on the more complex card game Rok. The availability of a web-based system enables a quick evaluation of the performance of an agent and debugging during the development process thus shortening the feedback loop and enabling easy remote collaboration. These benefits lead to a working hypothesis that the performance of the developed agents (measured in wins) should be higher after the introduction of the game server, ceteris paribus. The agents were evaluated in large tournaments where all agents (including those from earlier semesters) played against each other in sets of 4000 matches to rule out random effects. The results are promising: All match sets between old and new agents were won by the new agents with the exception of one extraordinary good old agent. However we need more empirical evidence to claim an effect of the game server because the number of participants was low (41 in six semesters) and isolating the effect is difficult. Qualitative, oral student feedback corroborates the working hypothesis. The game server has also proven to be a useful tool in research because it allowed us to quickly prototype new games and to prototype and test agents for different games (especially Rok, Bridge and Poker).

IMPLEMENTING A GAME SERVER

The technical part of our concept consists of the development of an online game server. Existing game servers serve special needs (e.g. ggp server for general game playing, ruling out incomplete information games) or their architecture does not fit the requirements (e.g. Cubeia Firebase). The server should support arbitrary games with a clean abstraction between game logic, visualization and general operations and have little dependency on the client system. Matches should be possible between human players and/or AI agents. Human games are relevant to test AI agents and to gain data of human behavior for techniques like CBR. As we focus on a solution usable beyond the borders of our own university, there should be a language-independent interface for external AI players. Individual matches and tournaments should be possible and the server should be easy to integrate with our Prolog learning environment EPPU [4].

4.1

6.

Technical Overview

The server has been implemented using declarative concepts of Prolog where possible, alongside with Java-based server functionality (using Apache Tomcat), a web-based GUI (HTML, CSS, JavaScript) and a PostgreSQL database. The core of the game engine is a set of game rule descriptions implemented in Prolog. This language is well-suited to describe the state transitions caused by the players’ actions. On top of the rule description of a game, there is a declarative description of its visualization (called a view). Views determine how a match state should be presented to the players, independent of any actual GUI technology. The Java server transforms them into actual JavaScript code.

4.2

Communication and Integration

The engine is able to communicate directly with Prolog agents developed by local students in EPPU. A second interface has been implemented to call remote AI players implemented in arbitrary languages using a network connection. This way it is possible to implement an agent e.g. in Java and run it on a remote host. An AI agent is stateless and has to be able to answer to requests containing a formal description of the match state and a private information store.

5.

RESULTS

The two-step concept with two games in our AI project eased students into agent development first but left enough 1

REFERENCES

[1] R. Caillois. The definition of play and the classification of games. In K. Salen and E. Zimmerman, editors, The Game Design Reader: A Rules of Play Anthology, pages 122–155. MIT Press, 2006. [2] P. Drake and K. Sung. Teaching introductory programming with popular board games. In Proceedings of the 42nd ACM Technical Symposium on Computer Science Education, pages 619–624. ACM, 2011. [3] A. Espen, S. S. Marie, and S. Lise. A multidimensional typology of games. In Level Up Conference Proceedings. University of Utrecht, November 2003. [4] S. Friese. Measuring of and reacting to learners’ progress in logic programming courses. In Proceedings of ITiCSE’10, pages 152–154, 2010. [5] O. M. Halck and F. A. Dahl. On classification of games and evaluation of players–with some sweeping generalizations about the literature. In Proceedings of the ICML-99 Workshop on Machine Learning in Game Playing, 1999. [6] P. Hingston, B. Combes, and M. Masek. Teaching an undergraduate ai course with games and simulation. Technologies for E-Learning and Digital Entertainment, pages 494–506, 2006. [7] D. Koller and A. Pfeffer. Representations and solutions for game-theoretic problems. Artificial Intelligence, 94:167–215, 1997. [8] S. Kurkovsky. Engaging students through mobile game development. In ACM SIGCSE Bulletin, volume 41, pages 44–48. ACM, 2009. [9] A. Macleod. Selecting games for artificial intelligence research. In The Second Annual International Workshop in Computer Game Design and Technology, 2004. [10] A. McGovern, Z. Tidwell, and D. Rushing. Teaching introductory artificial intelligence through java-based games. In AAAI Symposium on Educational Advances in Artificial Intelligence, North America, 2011.

Complete rules on http://udue.de/gameserver

194