-
Notifications
You must be signed in to change notification settings - Fork 48
VGDL Language
Raluca D. Gaina edited this page Feb 12, 2018
·
2 revisions
The Video Game Definition Language (VGDL) is a language design by Tom Schaul, originally implemented by him in Python using py-game. This project is a Java port of the original py-vgdl (we call it, not surprisingly, java-vgdl). The Java port is not fully function yet compared to the original engine (only support GridPhysics).
To define a game in VGDL, you need to define two or more files:
- Game Description File: Specifies all game objects, their interactions, and the termination condtions.
- Level Description Files: Each file is a 2D matrix of symbols which specifies a single level for the described game.
Here is an example for Game Description File for Sokoban game:
BasicGame
SpriteSet
hole > Immovable color=DARKBLUE img=hole
avatar > MovingAvatar
box > Passive img=box
TerminationSet
SpriteCounter stype=box limit=0 win=True
InteractionSet
avatar wall > stepBack
box avatar > bounceForward
box wall > undoAll
box box > undoAll
box hole > killSprite scoreChange=1
LevelMapping
0 > hole
1 > box
Here is the first Level Description File:
wwwwwwwwwwwww
w w w
w 1 w
w A 1 w 0ww
www w1 wwwww
w w 0 w
w 1 ww
w ww
wwwwwwwwwwwww
Here is the two player Sokoban Game Description File:
BasicGame key_handler=Pulse square_size=50 no_players=2
SpriteSet
hole > Immovable color=DARKBLUE img=hole
ground > Immovable img=water hidden=True
avatar > MovingAvatar
avatar1 > img=avatar
avatar2 > img=alien
bbox > Passive
box > img=box
boxin > img=city
LevelMapping
0 > hole
1 > box ground
. > ground
A > avatar1 ground
B > avatar2 ground
InteractionSet
avatar wall avatar > stepBack
bbox avatar > bounceForward
bbox wall bbox > undoAll
box hole > transformTo stype=boxin scoreChange=1,1
boxin ground > transformTo stype=box scoreChange=-1,-1
TerminationSet
SpriteCounter stype=box limit=0 win=True,True
Here is its first Level Description File:
wwwww....
wA..w....
w.11w.www
w.1.w.w0w
www.www0w
.ww....0w
.w.B.w..w
.w...wwww
.wwwww...
The following sections describe each file in details.
-
GVG Framework
- Tracks Description
- Code Structure
- Creating Controllers
- Creating Multi Player Controllers
- Creating Level Generators
- Running & Testing Level Generators
- Creating Rule Generators
- Running & Testing Rule Generators
-
Forward Model and State Observation
- Advancing and copying the state
- Advancing and copying the state (2 Player)
- Querying the state of the game
- Querying the state of the game (2 Player)
- Information about the state of the Avatar
- Information about the state of the Avatar (2 Player)
- Information about events happened in the game
- Information about other sprites in the game
- Game Description Class
- Constraints
- Game Analyzer Class
- Level Analyzer Class
- Sprite Level Description Class
- Sprite, Termination, and Interaction Data Class
- Level Mapping Class
- Competition Specifications
- VGDL Language