Recent site activity

[Untitled]‎ > ‎

Zoom Levels (ZLevels)

Here goes the detailed documentation on what are ZLevels, how do they work and how you might want to use them.

Either you would like to use the exhaustive observation for your self-learning incredibly accurate and precise controller, or just some easy and simple observation for the hand-coded one, . The usual ladder of the controller developing is (like everything is this world) from simple and working to more complicated and... again (hopefully) working (hopefully better).
And it is good idea, if all these possibilities are available through a common and simple interface, just "by request". So, you don't have to hack the system, which is nonetheless almost always extremely exciting;

Structured and detailed information about what is the output of the functions below.

getLevelSceneObservation(), getEnemiesObservation(), getMergedObservation()

more implementation details in ch/idsia/mario/engine/LevelScene.java

Zoom Level 2, ZLevel2, Z2, 2

The most rough (but adequate to reality) observation you can imagine. Either there is an obstacle, or not, 1 or 0. That's it. Each element in the map is generalized and sorted into 2 categories: this element is passable through or it is not. Very simple, but lets you create nonetheless reasonable controllers! ForwardAgent (okay, not the best one though) relies on this information only and it can complete the level on difficulty 5 (without creatures, alone). The same is with enemies: in each cell, either we have an enemy, or not, 1 or 0.
Information about fire flowers and powerup mushrooms is not available at Z0. So the agent is surprised and feels blessed by The God when he suddenly gets a mushroom or (he-he) a flower. Since this type of information is not that relevant we do not even care about this.

LevelScene

1 - any kind of obstacle, cannot pass through
0 - no obstacle, can pass through

Enemies

1 - some enemy
0 - no any enemy, Sprite.KIND_NONE

personal fireballs are neglected.

Zoom Level 1, ZLevel1, Z1, 1

Right! This zoom level is more detailed and stores more useful information from the observation.

LevelScene

0 - no obstacle
-10 -- hard obstacle, cannot pass through
-11 -- soft obstacle, can overjump (// half-border, can jump through from bottom and can stand on)
20 -- angry enemy flower pot or parts of a cannon
16 - brick (simple or with a hidden coin or with a hidden mushroom/flower)
21 - question brick (with a coin or mushroom/flower)

Enemies

0 - no enemy in a cell
2 - Enemy that you can kill by shooting or jumping on it ( KIND_BULLET_BILL, KIND_GOOMBA, KIND_GOOMBA_WINGED, KIND_GREEN_KOOPA, KIND_GREEN_KOOPA_WINGED, KIND_RED_KOOPA, KIND_RED_KOOPA_WINGED, KIND_SHELL)
9 - KIND_SPIKY or KIND_ENEMY_FLOWER (cannot kill by jumping, but can kill one of them by shooting; hint: FLOWER is only above the flower spot and always above ground)
25 - KIND_FIREBALL, mario weapon projectile.

Zoom Level 0, ZLevel0, Z0, 0

And this is almost how the engine sees the mario world ( terrifying view, actually ). So, only in some weird cases; and mad agents would to see this. The variety of the world may scare even a very experienced one, but you can use it, if you want to. Each creature is personalized and his it's one id, each break in the wall -- has its own id (so, it's not famous "just another break in the wall", it's a Break in the wall).

All that options are available through the Environment interface and Command Line and automatically therefore TCP interface. So, before starting the simulation you can set the system at a particular Zoom Level for the elements of the levelScene and Enemies separately.

LevelScene

Everything is as in engine, except for:
16:  // brick, simple, without any surprise.
 17:  // brick with a hidden coin
18:  // brick with a hidden flower
are mapped to 16; // prevents cheating
21:       // question brick, contains coin
and 22:       // question brick, contains flower/mushroom
are mapped to 21; // question brick, contains something

Enemies

neglected:
Sprite.KIND_COIN_ANIM, Sprite.KIND_PARTICLE, Sprite.KIND_SPARCLE


     public static final int KIND_NONE = 0;
    public static final int KIND_MARIO = 1;
    public static final int KIND_GOOMBA = 2;
    public static final int KIND_GOOMBA_WINGED = 3;
    public static final int KIND_RED_KOOPA = 4;
    public static final int KIND_RED_KOOPA_WINGED = 5;
    public static final int KIND_GREEN_KOOPA = 6;
    public static final int KIND_GREEN_KOOPA_WINGED = 7;
    public static final int KIND_BULLET_BILL = 8;
    public static final int KIND_SPIKY = 9;
    public static final int KIND_SPIKY_WINGED = 10;
    public static final int KIND_ENEMY_FLOWER = 12;
    public static final int KIND_SHELL = 13;
    public static final int KIND_MUSHROOM = 14;
    public static final int KIND_FIRE_FLOWER = 15;   
    public static final int KIND_PARTICLE = 21;
    public static final int KIND_SPARCLE = 22;
    public static final int KIND_COIN_ANIM = 20;
    public static final int KIND_FIREBALL = 25;

    public static final int KIND_UNDEF = -42;

I wish you
Good game,
Good Luck and
Have fun!

Sergey
mailto: sergey.karakovskiy@g...