Code Monkey home page Code Monkey logo

domains-general-game-playing's Introduction

GDL Translator Readme
---------------------
This directory contains a Python program that translates game definitions
from Game Description Language (GDL; usually stored in files with .kif
extension) into self-contained Soar agents that simulate the mechanics
of the game in working memory and productions. See

http://games.stanford.edu/language/language.html

for more information on GDL.

Run the translator as follows:

python translate.py < input.kif > output.soar

where "<" redirects the input file to the program's standard input and
">" redirects the program's standard output to the output file. For
Windows users not familiar with this convention please see

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx

The generated agent contains productions that initialize the game
state, proposal rules that propose legal moves, and application rules
that update the game state when legal moves are executed. It does not
contain any other knowledge, such as which moves to choose or what kinds
of heuristics to use.


Content Descriptions
--------------------
translate.py    - The main Python script to run.
common.soar     - Productions that need to be included by all generated agents.
kifs/           - Directory containing example games.
trans/          - Directory containing Python code that does the actual work.


Notes
-----
The generated agent will reference the file "common.soar", so please make
sure it's in the same directory or edit the first line of the generated
agent file.

Generated agents will create two WMEs on the state - (<S1> ^facts <F1>)
and (<S1> ^gs <G1>). All static relations in the game are stored under
the facts WME, while dynamic relations are stored under the gs (game
state) WME.

A GDL relation (on A B) will take the following form in working memory:

(<G1> ^on <O1>)
(<O1> ^p1 A ^p2 B)

Most of the kif files on games.stanford.edu were written for
backward-chaining systems. This means that when deducing the truths of
relations based on the game rules, many unnecessary intermediate relations
are automatically ignored. On the other hand, the generated Soar agents
calculate truth values in a forward-chaining style, preventing them from
pruning unnecessary intermediate relations. Many of the agents generated
from these kif files will experience explosions in working memory
and partial production match sizes, and will slow to a crawl or crash
completely after running out of system memory. If you experience these
symptoms, you need to do two things:

1. Modify the GDL rules so that each inference is as constrained as
   possible.

2. Use the multi-attributes command to tell Soar about relations that
   still have a large number of instances so that the RETE delays matching
   on them until other constraints are in place.

We've included an example of how to modify the mummy maze game to run
tractably in the kifs/ directory.

domains-general-game-playing's People

Contributors

mazina avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

domains-general-game-playing's Issues

A GGP game

Hi,I have a question about a GGP game.Can you help me?
Thanks!

Here is a very ancient game originated from China: Tiger vs Dogs.
In the above 4X4 board(5 rows,5columns), there are one tiger (represented by a white stone in the center) and 16 dogs
(represented by black stones in the perimeter).
The tiger is controlled by the tiger player and the dogs are controlled by the dog player. The tiger player
goes rst and then they take turns. Each player can go one step along the line to an adjacent position that
is not occupied.
When the tiger enters a position such that the following condition hold \two dogs are adjacent to this
position such that they three are in the same line, and also these two dogs have no adjacent dogs in the same
line", then these two dogs are killed by the tiger. If 6 dogs are killed, then the tiger player wins and the dog
player loses.
When the dogs surrounded the tiger such that there is no unoccupied adjacent position for the tiger to
move, then the tiger player loses and the dog player wins.

Write a game description in GDL (KIF form) for this game.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.