ignaciovellido / vgdl-pddl Goto Github PK
View Code? Open in Web Editor NEWA planning-based agent capable of playing from only VGDL game descriptions.
License: GNU General Public License v3.0
A planning-based agent capable of playing from only VGDL game descriptions.
License: GNU General Public License v3.0
There should be a way to easily tell which objects are orientable and which aren't. To do so, the orientation
field of the configuration file can be modified so it contains a list of the orientable objects and their default orientation, if any. The following example could be an expected output of this field for the Boulderdash game:
orientation:
boulder: DOWN
avatar: NONE
The orientation of objects whose default orientation is NONE
has to be deduced while parsing the game state.
The negative effect of the SWORD_DISAPPEAR
action lacks its closing parenthesis:
(:action SWORD_DISAPPEAR
:parameters (?x - sword ?c - cell)
:precondition (and
(turn-sword-disappear)
(at ?c ?x)
)
:effect (and
(not (at ?c ?x) <--- missing parenthesis here
(object-dead ?x)
(sword-disappeared ?x)
)
)
Currently, the system only supports the basic fields of the configuration file. Therefore, it has to be modified to add full support for the following fields:
addDeadObjects
additionalPredicates
orientation
As of now, the fields in the configuration file are mixed-up. Its inner structure should be modified so it becomes more easily readable. See this example of how fields are organized. Obviously, newly added fields should be inserted in reasonable positions.
When it is specified that the avatar's orientation should be NONE (no orientation), the (orientation-none avatar) predicate is not generated while parsing the observation state. This doesn't follow the guideline specified in #13.
The cell variable and its PDDL type are missing in the variablesTypes
field. They should be added so the parsing of the game state produces the expected output.
In catapults:
floor > Immovable
water > Immovable
catapult > Immovable
southfacing > orientation=DOWN
northfacing > orientation=UP
eastfacing > orientation=RIGHT
westfacing > orientation=LEFT
avatar >
moving > MovingAvatar
bullet > MissileAvatar
north > orientation=UP
south > orientation=DOWN
east > orientation=RIGHT
west > orientation=LEFT
goal > Immovable
wall > Immovable
Only one object is included in the variableTypes section
variableTypes:
?floor: floor
Since the PDDL domains are generated into the domains
directory, the path that is specified in the configuration file should be this one:
domainFile: domains/domain.pddl
When the configuration file is generated, some of the correspondences between game elements and PDDL predicates are not generated correctly. For example, the configuration file of the Boulderdash game contains the following correspondences:
gameElementsCorrespondence:
avatar:
- (at ?c ?avatar)
- (last-at ?c ?avatar)
- (can-move-up ?avatar)
- (can-move-down ?avatar)
- (can-move-left ?avatar)
- (can-move-right ?avatar)
- (can-use ?avatar)
background:
- (at ?c ?background)
- (last-at ?c ?background)
boulder:
- (at ?c ?boulder)
- (last-at ?c ?boulder)
- (boulder-moved ?x - Missile)
butterfly:
- (at ?c ?butterfly)
- (last-at ?c ?butterfly)
crab:
- (at ?c ?crab)
- (last-at ?c ?crab)
diamond:
- (at ?c ?diamond)
- (last-at ?c ?diamond)
- (got-resource-diamond ?x - diamond)
dirt:
- (at ?c ?dirt)
- (last-at ?c ?dirt)
exitdoor:
- (at ?c ?exitdoor)
- (last-at ?c ?exitdoor)
sword:
- (at ?c ?sword)
- (last-at ?c ?sword)
- (sword-disappeared ?x - Flicker)
wall:
- (at ?c ?wall)
- (last-at ?c ?wall)
The following correspondences are not generated properly since they don't contain any of the previously defined variables and specify the type of the variable inside the template predicate itself:
gameElementsCorrespondence:
boulder:
- (boulder-moved ?x - Missile)
diamond:
- (got-resource-diamond ?x - diamond)
sword:
- (sword-disappeared ?x - Flicker)
An example of a correct output might be this one:
gameElementsCorrespondence:
boulder:
- (boulder-moved ?boulder)
diamond:
- (got-resource-diamond ?diamond)
sword:
- (sword-disappeared ?sword)
This is more of a suggestion rather than an issue. Maybe if we are able to use the VGDL description we could automatically generate goal predicates. This way, the generation of the configuration file can be fully automated and it wouldn't require any kind of user modification.
Some avatars are incorrectly represented with orientations when it shouldn't.
At the same time, ACTION_MOVE...
like actions include orientation preconditions even though other avatars don't have those kind of predicates.
Also, (can- ...)
predicates have no use in PDDL (they derive from the HPDL counterpart, where a strategy was needed).
The connections between cells is specified using the connections
field, which has the following structure:
connections:
DOWN: (connected-down ?c1 ?c2)
LEFT: (connected-left ?c1 ?c2)
RIGHT: (connected-right ?c1 ?c2)
UP: (connected-up ?c1 ?c2)
Instead of using ?c1
and ?c2
to name the cells, it would be a better approach to use the following naming convention:
?c
for the central cell.?u
for the upper cell.?d
for the down cell.?l
for the left cell.?r
for the right cell.This is the naming that the agent uses to generate the cell connection predicates. Below you can see an example which illustrates the correspondence between the names specified above and their positions regarding each other.
--------
| ?u |
----------------------
| ?l | ?c | ?r |
----------------------
| ?d |
--------
When a variable defined in the configuration file (or generally, in the game) contains a number the following error is returned:
Exception in thread "main" java.lang.NullPointerException
at controller.PlanningAgent.translateGameStateToPDDL(PlanningAgent.java:634)
at controller.PlanningAgent.act(PlanningAgent.java:207
at ontology.avatar.MovingAvatar.requestPlayerInput(MovingAvatar.java:135)
at ontology.avatar.MovingAvatar.updateAvatar(MovingAvatar.java:103)
at ontology.avatar.oriented.OrientedAvatar.updateAvatar(OrientedAvatar.java:53)
at core.game.Game.tick(Game.java:1363)
at core.game.Game.gameCycle(Game.java:1101)
at core.game.Game.runGame(Game.java:873)
at tracks.ArcadeMachine.runOneGame(ArcadeMachine.java:168)
at tracks.singlePlayer.Test.main(Test.java:83)
For example, when giving the configuration file:
gameElementsCorrespondences:
...
inc1:
- (at ?x ?y ?inc1)
inc2:
- (at ?x ?y ?inc2)
inc3:
- (at ?x ?y ?inc3)
inc4:
- (at ?x ?y ?inc4)
inc5:
- (at ?x ?y ?inc5)
inc6:
- (at ?x ?y ?inc6)
variablesTypes:
?inc1: inc1
?inc2: inc2
?inc3: inc3
?inc4: inc4
?inc5: inc5
?inc6: inc6
Renaming the variables (in the VGDL file and in the config) misses the error:
gameElementsCorrespondences:
...
inca:
- (at ?x ?y ?inca)
incb:
- (at ?x ?y ?incb)
incc:
- (at ?x ?y ?incc)
incd:
- (at ?x ?y ?incd)
ince:
- (at ?x ?y ?ince)
incf:
- (at ?x ?y ?incf)
variablesTypes:
?inca: inca
?incb: incb
?incc: incc
?incd: incd
?ince: ince
?incf: incf
This predicate tells the position of an object in the previous turn.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.