General Game Playing
General
Artificial
Intelligence

Lessons Readings Resources Gamemaster Forum

Week 10

This week, we will run the final competition of the course. Be sure to have your players uploaded by Tuesday at 6:00 pm. No exceptions for any reason.

(1) We will start the competition with a qualifying round that will be run before class begins. There will be at least one 1-player game and one 2-player game and some number of additional games.

(2) We will then run a preliminary round to winnow the field down to eight teams. This will also take place before class. We will review some of the matches in this round at the start of class. At this point, we will have a leaderboard of players ordered by total score for all games played.

(3) We will then run a ladder round (semifinal round and final round) in which we pit the top four players against each other. The semifinalists will compete with each other in a best of three competition to produce two finalists. The two finalists will then compete with each other in a best of three final round to determine an overall winner (gold) and a runner-up (silver). We will also play a one-game consolation match between the losers of the semifinal round to determine which player is in third place (bronze) and which is in fourth (lead).

(4) We will finish things up with a challenge round, in which a few players challenge the champion. (If there are too many challengers, we will select two or three at random.) The team members responsible for any player that beats the champion will receive extra credit. (Condition: Only those team members who are present will receive the credit.)

Be sure to get to class on time, and expect to stay a little longer than usual. Things should be done by 7:00. There will be pizza around 5:30 for those of you in need of sustenance, but you must bring your own beverages (other than water).


Week 9

We are finally done with the material of the course. This week, you should spend your time finalizing your player. Decide which techniques you want your player to use. Check the implementation and then check it again to make sure that it plays correctly.

On Wednesday of this week, I will talk a bit about advanced techniques and the future of General Game Playing, and I will offer some advice for the final competition. We will also have a "dress rehearsal" for the final competition, so make sure your players are ready for testing.


Week 8

This week, we look at some techniques to restructure game trees, e.g. by pruning needless actions or splitting compound games into independent subgames. These techniques are relatively simple, but they are very powerful when they apply. If you use them, your player will play better, and you will get a sense of the sorts of things that human programmers consider in producing highly efficient game-playing programs.

One downside to the techniques we will discuss is that they rely on grounding of games; and, as some of you have discovered, not all games can be grounded in the amount of time available. Next week, we will talk about symbolic reasoning techniques, which can be used on games where grounding is impossible or impractical.


Week 7

This week, we look at some techniques for "grounding" game descriptions during the start clock and playing games with the resulting rule sets once the game begins. In many cases, with grounded game rules, players are able to process game trees much more efficiently. As in the past, we will provide you starter code, but it is your job to use and/or improve the code.


Week 6

All of the general game playing methods we have seen thus far are designed to operate at runtime, i.e. while the play clock is running. This week, we begin our look at metagaming, i.e. general game playing activity that takes place offline, usually during the start clock period.

We begin our discussion of metagaming with a look at simple transformations of game descriptions. Examples include reordering subgoals within rules, eliminating redundant subgoals, and eliminating redundant rules. We also talk about materializing and reformulating the relations used in game descriptions.

The essence of metagaming is to spend time before games begin to save time once games are underway. In general, metagaming can take a lot of time. However, as we shall see, there are techniques that more than pay for themselves. Most of the techniques we shall see operate in time that is polynomial in the size of game descriptions and yet yield benefits that are proportional to the size of the corresponding exponential game trees.


Week 5

Hopefully, by this time, you have experimented with various heuristics for evaluating intermediate game states, and hopefully you have used them together with various depth-limited search techniques.

General heuristics, such mobility and focus, are sometimes good; but they are not good enough for an effective general game player. The intermediate state value heuristic is better. It works particularly well in monotonic / accumulation games, where the player's utility increases as the game proceeds; but it is not effective in games where intermediate state values are not correlated with final success. Statistical methods often work when these simpler heuristics fail, though again there are no guarantees.

Incomplete search techniques are essential for large games. However, searching game trees to a uniform depth is not always the best way to proceed. This week, we look at a class of techniques capable of variable depth search. In these techniques, the player explores different branches of game trees to different depths. Moreover, it preserves work from one move to the next move and thereby avoids much redundant work. This week, we will look at two variable depth techniques. In Greedy search, once a player selects a node to "expand", it then applies simple heuristics to evaluate states, e.g. intermediate values. In Monte Carlo Tree Search (MCTS), the player proceeds as with Greedy but then uses Monte Carlo-like depth charges to estimate intermediate state values. Greedy and MCTS have proven highly successful in General Game Playing, and virtually every high performance General Game Playing program today uses a variant of one or the other.


Week 4

This past week, we saw how to build players capable of playing games perfectly - *assuming* there is enough time. Unfortunately, this assumption holds only for small games, like Tic Tac Toe.

This week, we begin our look at techniques for playing large games. The main challenge of the week is to restructure your player so that it can select moves without searching the entire game tree. We will look at both depth-limited and time-limited search with a variety of techniques for evaluating intermediate game states (e.g. mobility, focus, and intermediate goal values).

A key lesson of the week is time management - allocating time among different tasks and making sure that players get their moves in before the play clock runs out. Time management is one of the main themes of the course. Devote enough effort to this now, and you won't stumble over it later when you have other things to worry about.


Week 3

Two weeks down, eight to go. By now, you should have a sense of what General Game Playing is all about; you should be able to read and write game descriptions in GDL. You should also be comfortable using some of the resources we have provided, e.g. Rulechecker, Stylechecker, Standalone, and Manager.

This week, we focus on game management and the rudiments of game playing. Your job this week is to create your first automated game player and put it to work playing small games effectively. Things are still simple in that you do not need to worry about time limits. Although all of our matches have start clocks and play clocks, the games are small enough that your players should be able to search the corresponding game trees in the time available. This is an unrealistic assumption in general, but the methods for dealing with large games are variations on the methods used for small games. So, it is a good idea to master those methods before moving on. In the weeks to follow, you will extend your player to larger and more realistic games.


Week 2

One week down, nine to go. By now, you should have teams. You should have a sense of what General Game Playing is about. And you should have played a few games from the Gamemaster library.

Your goals this week are (1) to learn to read and write game descriptions in GDL and (2) to get comfortable with some of the resources we have provided, e.g. the rule checker, the style checker, and the standalone tool for running standalone games. We realize that you are probably eager to get started building your game players. However, if you spend a little time on these basics now, it will help you later in the quarter.

A reminder that we would like you to take advantage of the Forum. If you are confused about something, you might be able to get insight from others. If you have mastered the material, you might be able to help others; and explaining things might help you to understand the material more deeply.


Week 1

Okay. We are on our way! First week of class begins now.

To get started, click the Lessons tab at the top of this page. The Lessons page provides links to lecture slides, readings, and other resources. And it contains links to the weekly assignments, including details of how to submit your work. The Lessons page is your friend. Use it.

The Readings tab at the top of this page provides links to relevant articles on General Game Playing. You are not required to read these articles, but you may find the subject matter helpful as you design and build your game players.

The Resources tab provides links to useful tools and related websites.

The Gamemaster tab leads to the Gamemaster competition management system. Gamemaster includes descriptions of games and links to tools to play those games yourselves or to manage matches between automated players. Also, by signing in on this website, you can register your player to compete against other players.

The Forum is a great way to communicate with your fellow students - to ask questions, to offer answers, and to discuss the course material. It is also the best way to communicate with the course staff. You should use the Forum rather than emailing us individually, as this will allow us all to see your questions and/or comments and you will get quicker responses that way.

The lesson this week is mostly introduction, and the assignment is not onerous. We would like you form teams, invent a name for your team / player and create an account for your player in the Gamemaster system. We would also like you to use the Gamemaster site to play a few games amongst yourselves - to become familiar with the practice of learning and playing new games. See Assignment 1 for details (link on the Lessons page).


Course Overview

General game players are computer systems able to play strategy games based solely on formal game descriptions supplied at "runtime". (In other words, they don't know the rules until the games start.) General Game Playing (GGP) is an interesting application in its own right. It is intellectually engaging and more than a little fun. But it is much more than that. It provides a theoretical framework for modeling discrete dynamic systems and for defining rationality in a way that takes into account problem representation and complexities like incompleteness of information and resource bounds. It has practical applications in areas where these features are important, e.g. in business and law. More fundamentally, it raises questions about the nature of intelligence and serves as a laboratory in which to evaluate competing approaches to artificial intelligence.

This course is a hands-on introduction to GGP. Theoretical background is provided through lectures and readings, but the main pedagogical value of the course derives from the use of this theory to create general game playing programs able to perform effectively.

All of the course materials are online here. There are links to lessons, background readings, resources, the Gamemaster competition system, and the course forum. Note that, as you proceed through the online materials, you may occasionally encounter problems. Apologies in advance for this. We are in the midst of revamping the course. You may get extra credit for reporting such problems (especially if your reports are not especially irate).

There will be ten in-person class sessions - on Wednesdays from 4:30 pm - 6:30 pm. See the table below for a summary of the topics of these sessions and their locations. Note that you are expected to attend all sessions (unless there are extreme extenuating circumstances).

DateTopicLocationTime
April 3 Introduction Gates 403 4:30 - 6:20
April 10 Game Description Gates 403 4:30 - 6:20

April 17 Complete Search Gates 403 4:30 - 6:20
April 24 Incomplete Search Gates 403 4:30 - 6:20
May 1 Statistical Methods Gates 403 4:30 - 6:20

May 8 Metagaming Gates 403 4:30 - 6:20
May 15 Logical Optimization Gates 403 4:30 - 6:20
May 22 Game Reformulation Gates 403 4:30 - 6:20

May 29 Really General Game Playing Gates 403 4:30 - 6:20
June 5 Final Competition Gates 403 4:30 - 7:30

All work in the course must be done in teams; and, except in extreme circumstances, all team members will receive the same grade. Grades for the course will be based on (1) weekly assignments, (2) performance in competitions, and (3) a final report. The majority of the assignments concern the development of a functioning general game playing program. Your program does not need to win competitions to receive a perfect grade; however, it must function correctly and illustrate the lessons of the course. That said, there will be extra credit for especially noteworthy performance in competitions. People who take CS227B tend to immerse themselves in the course and do good work; and, with occasional exceptions, most students receive high grades.

Important note: we use elementary JavaScript in all our examples and software libraries; and, in a departure from the past, we would like you to use JavaScript in building your players. JavaScript is quite easy to learn and has the merit of running natively in World Wide Web browsers. If you are unfamiliar with the language, you can learn more by clicking here or here.

Mike Genesereth
Email: genesereth@stanford.edu
Office: Gates 308
Office Hours: Wed 3:00 pm - 4:00 pm
Theodore Kanell
Email: tkanell@stanford.edu
Location: TBD
Office Hours: TBD
Butch Nasser
Email: ban@stanford.edu
Location: TBD
Office Hours: TBD
Anthony Riley
Email: anthonyriley@stanford.edu
Location: TBD
Office Hours: TBD

Feedback