can be used as a feature in search heuristics of GGP
agents. In contrast to previous approaches, our ap-
proach does not depend on syntactic patterns and in-
volves no internal simulation or detection of any pre-
defined game elements. Moreover, it is not limited to
board-like structures but can be used for every fluent
of a game.
The remainder of this paper is structured as fol-
lows: In the next section we give an introduction
to the Game Description Language (GDL), which is
used to describe general games. Furthermore, we
briefly present the methods currently applied for dis-
tance feature detection and distance estimation in the
field of General Game Playing. In Section 3 we in-
troduce the theoretical basis for this work, so called
fluent graphs, and show how to use them to derive dis-
tances from states to fluents. We proceed in Section 4
by showing how fluent graphs can be constructed
from a game description and demonstrate their appli-
cation in Section 5. Finally, we conduct experiments
in Section 6 to show the benefit and generality of our
approach and discuss and summarize the results in
Section 9.
2 PRELIMINARIES
The language used for describing the rules of gen-
eral games is the Game Description Language (Love
et al., 2008) (GDL). GDL is an extension of Datalog
with functions, equality, some syntactical restrictions
to preserve finiteness, and some predefined keywords.
The following is a partial encoding of a Tic-Tac-
Toe game in GDL. In this paper we use Prolog syntax
where words starting with upper-case letters stand for
variables and the remaining words are constants.
1 role( xp l a yer ). role( o play e r ).
2
3 init( cell (1 ,1, b ) ) . init( cell (1 ,2 , b )).
4 init( cell (1 ,3, b ) ) . ...
5 init( cell (3 ,3, b ) ) .
6 init( co n t rol ( xp l a yer ) ) .
7
8 legal(P , mark (X , Y ) ) : -
9 true( c ontr o l ( P )) , true( c e l l ( X , Y , b )).
10 legal(P , noop ) : -
11 role(P ) , not true( c o n trol ( P ) ) .
12
13 next( cell (X ,Y , x )) : -
14 does( x p l a y e r , m a r k ( X , Y ) ) .
15 next( cell (X ,Y , o )) : -
16 does( o p l a y e r , m a r k ( X , Y ) ) .
17 next( cell (X ,Y , C )) : -
18 true( c e l l ( X , Y , C )) , distinct(C , b ) .
19 next( cell (X ,Y , b )) : - true( c e l l ( X , Y , b )) ,
20 does(P , m a r k ( M , N )) ,
21 (distinct( X , M ) ; distinct(Y, N ) ) .
22
23 goal( xplayer , 100 ) : - line (x ).
24 ...
25 terminal : -
26 l i n e ( x) ; line (o ) ; not open .
27
28 line ( P ) :-
29 true( c e l l ( X ,1 , P )) ,
30 true( c e l l ( X ,2 , P )) ,
31 true( c e l l ( X ,3 , P )).
32 ...
33 open : - true( c e l l ( X ,Y ,b )).
The first line declares the roles of the game. The
unary predicate init defines the properties that are
true in the initial state. Lines 8-11 define the legal
moves of the game with the help of the keyword legal.
For example, mark(X,Y) is a legal move for role P if
control(P) is true in the current state (i.e., it’s P’s turn)
and the cell X,Y is blank (cell(X,Y,b)). The rules for
predicate next define the properties that hold in the
successor state, e.g., cell(M,N,x) holds if xplayer marked
the cell M,N and cell(M,N,b) does not change if some cell
different from M,N was marked
1
. Lines 23 to 26 define
the rewards of the players and the condition for termi-
nal states. The rules for both contain auxiliary pred-
icates line(P) and open which encode the concept of a
line-of-three and the existence of a blank cell, respec-
tively.
We will refer to the arguments of the GDL key-
words init, true and next as fluents. In the above
example, there are two different types of fluents,
control(X) with X ∈ {xplayer, oplayer} and cell(X, Y, Z)
with X, Y ∈ {1, 2, 3} and Z ∈ {b, x, o}.
In (Schiffel and Thielscher, 2009b), we defined a
formal semantics of a game described in GDL as a
state transition system:
Definition 1. (Game). Let Σ be a set of ground terms
and 2
Σ
denote the set of finite subsets of Σ. A game
over this set of ground terms Σ is a state transition
system Γ = (R,s
0
,T,l, u,g) over sets of states S ⊆ 2
Σ
and actions A ⊆ Σ with
• R ⊆ Σ, a finite set of roles;
• s
0
∈ S , the initial state of the game;
• T ⊆ S , the set of terminal states;
• l : R × A × S , the legality relation;
• u : (R 7→ A ) × S → S , the transition or update
function; and
• g : R × S 7→ N, the reward or goal function.
This formal semantics is based on a set of ground
terms Σ. This set is the set of all ground terms over
1
The special predicate distinct(X,Y) holds if the terms
X and Y are syntactically different.
ICAART 2012 - International Conference on Agents and Artificial Intelligence
128