Partially Observable Zen Puzzle
Single-Player/GVGAI/zenpuzzle_partially_observable.yaml
Description
Set all the tiles in the level to the same color, but you cannot move over a tile more than once! (Not even sure why this is zen its super frustrating)
Levels
Block2D |
Sprite2D |
Vector |
|||||
---|---|---|---|---|---|---|---|
|
|||||||
|
|||||||
|
|||||||
|
|||||||
|
Code Example
The most basic way to create a Griddly Gym Environment. Defaults to level 0 and SPRITE_2D rendering.
import gym
import griddly
if __name__ == '__main__':
env = gym.make('GDY-Partially-Observable-Zen-Puzzle-v0')
env.reset()
# Replace with your own control algorithm!
for s in range(1000):
obs, reward, done, info = env.step(env.action_space.sample())
env.render() # Renders the environment from the perspective of a single player
env.render(observer='global') # Renders the entire environment
if done:
env.reset()
Objects
Name -> |
avatar |
ground |
rock |
---|---|---|---|
Map Char -> |
A |
g |
r |
Block2D |
|||
Sprite2D |
|||
Vector |
Actions
move
- Relative
The actions are calculated relative to the object being controlled.
Action Id |
Mapping |
---|---|
1 |
Rotate left |
2 |
Move forwards |
3 |
Rotate right |
YAML
Version: "0.1"
Environment:
Name: Partially Observable Zen Puzzle
Description: Set all the tiles in the level to the same color, but you cannot move over a tile more than once! (Not even sure why this is zen its super frustrating)
Observers:
Sprite2D:
TileSize: 24
BackgroundTile: gvgai/oryx/backBiege.png
Player:
Observer:
RotateWithAvatar: true
TrackAvatar: true
Height: 5
Width: 5
OffsetX: 0
OffsetY: 2
AvatarObject: avatar
Termination:
Win:
- eq: [ground:count, 0]
Lose:
- eq: [_steps, 1000]
Levels:
- |
............
............
............
...gggggg...
...gggggg...
...gggggg...
.A.ggrrgg...
...gggggg...
...gggggg...
............
............
............
- |
............
............
............
...gggggg...
...ggggrg...
...gggggg...
.A.ggrggg...
...gggggg...
...gggggg...
............
............
............
- |
............
............
............
...gggggg...
...gggrgg...
...gggggg...
.A.grgggg...
...ggggrg...
...gggggg...
............
............
............
- |
............
............
............
...ggrrgg...
...rggggr...
.A.ggrrgg...
...rggggr...
...ggrrgg...
............
............
............
- |
............
............
............
...rggggg...
...ggrgrg...
...rgggrg...
.A.ggrggg...
...rgggrg...
...ggrggg...
............
............
............
Actions:
# Define the move action
- Name: move
InputMapping:
Inputs:
1:
Description: Rotate left
OrientationVector: [-1, 0]
2:
Description: Move forwards
OrientationVector: [0, -1]
VectorToDest: [0, -1]
3:
Description: Rotate right
OrientationVector: [1, 0]
Relative: true
Behaviours:
# Avatar rotates
- Src:
Object: avatar
Commands:
- rot: _dir
Dst:
Object: avatar
# The agent can move around freely in empty space and over holes
- Src:
Object: avatar
Commands:
- mov: _dest
Dst:
Object: _empty
- Src:
Object: avatar
Commands:
- mov: _dest
Dst:
Object: ground
Commands:
- change_to: walked
- reward: 1
Objects:
- Name: avatar
MapCharacter: A
Z: 1
Observers:
Sprite2D:
- Image: gvgai/oryx/angel1.png
Block2D:
- Shape: square
Color: [0.8, 0.2, 0.2]
Scale: 0.6
- Name: ground
MapCharacter: g
Observers:
Sprite2D:
- Image: gvgai/oryx/floorTileOrange.png
Block2D:
- Shape: square
Color: [0.2, 0.2, 0.4]
Scale: 0.7
- Name: walked
Z: 0
Observers:
Sprite2D:
- Image: gvgai/oryx/floorTileGreen.png
Block2D:
- Shape: square
Color: [0.2, 0.6, 0.2]
Scale: 0.8
- Name: rock
MapCharacter: r
Observers:
Sprite2D:
- Image: gvgai/oryx/wall5.png
Block2D:
- Shape: triangle
Color: [0.2, 0.2, 0.2]
Scale: 0.8