General Game Playing
Javascript Code Base
General
Artificial
Intelligence


This module is a Javascript implementation of a simple but fully functional general game player. It is intended as a basis for building more interesting players.

In its current form, it plays only legal moves. More interesting behavior can be obtained by redefining the handlers for the five basic communication actions (info, start, play, abort, stop). See descriptions in Chapter 3 of the notes.

The module includes methods that can be used in defining these handlers. Toplevel methods include findroles, findbases, findinputs, findinits, findnexts, findlegalp, findlegalx, findlegals, findnexts, findterminalp, and findreward, as well as the utility methods doesify, undoesify, truify, and untruify (which simply add does and true to expressions). See descriptions in Chapter 4 of the notes.

These methods are, in turn, defined in terms of lower level subroutines, which may be ignored at first but which may be of use in optimizing the player in more advanced players. No documentation on lower level methods; see the code.

To run the player, you need to have nodeJS installed on your machine. To install, see the documentation and installer links at the following site.

https://nodejs.org/en/download/

To download the player, copy the following files to your machine. Be sure that both files are in the same folder/directory on your machine.

http://ggp.stanford.edu/players/javascript/epilog.js http://ggp.stanford.edu/players/javascript/player.js

Once you have installed nodeJS (in nodejsdirectory) and the player code (in playerdirectory), you can start the player by calling the node application with player.js and an optional port number as arguments. In Unix, you would execute the following.

cd playerdirectory
nodejsdirectory/node player.js port

Once you have done this, the server will start on the specified port (or 9147 if no port specified).

To build a better player, modify the definitions in the player.js file. Better yet, create copies of player.js with different strategies and try them all.


Comments and complaints to genesereth@stanford.edu.