-
Notifications
You must be signed in to change notification settings - Fork 28
Game Parameters
Several settings exist in utils.Types
which can be used to customize games:
public static int MAX_GAME_TICKS = 800; //Maximum duration of the game. public static int BOMB_LIFE = 10; //Ticks a bomb takes to explode. public static int FLAME_LIFE = 5; //Ticks a flame lives for. public static int DEFAULT_BOMB_BLAST = 2; //Bombs create flames with this range by default. public static int DEFAULT_BOMB_AMMO = 1; //Number of bombs an agent can still place. public static boolean DEFAULT_BOMB_KICK = false; //Can agents kick bombs by default? public static int DEFAULT_VISION_RANGE = -1; //-1 for full observability, >1 for partial observability (PO).
Further notes:
-
DEFAULT_BOMB_BLAST
- The players' bomb blast strength may be increased if players pick up range increase power-ups. Bombs explode in a cross pattern, with the number representing the size of the cross from the middle (inclusive) to the edge. -
DEFAULT_BOMB_AMMO
- The players' ammo decreases when an agent places a bomb, increases when their bomb explodes. Can increase further if players pick up ammo power-ups. -
DEFAULT_BOMB_KICK
- The players' ability to kick becomes true when players pick up can kick power-up. -
DEFAULT_VISION_RANGE
- PO is a square around the player, the numbers representing the number of tiles from the player (exclusive) to the edge of the vision area.
private static IGameConfig gameConfig = new OriginalGameConfig();
This game configuration determines victory conditions. It may be changed by adding a new game configuration class which implements the IGameConfig interface.
public static int BOARD_SIZE = 11; // Size of the board (n x n). public static int BOARD_NUM_RIGID = 20; // Number of rigid blocks to place in the level. public static int BOARD_NUM_WOOD = 20; // Number of wooden (destroyable) blocks for the level. public static int BOARD_NUM_ITEMS = 10; // Number of items to place in the level. public static int MAX_INACCESIBLE_TILES = 4; // Number of inaccessible parts of the level allowed. public static int CORNER_DISTANCE = 1; // Distance to the corner (number of tiles) from the starting agent positions. public static int BREATHING_SPACE = 2; // Breathing space, L shaped tile section free at the start around agents.
All of these variables are used to generate the initial board in LevelGeneration.java
. The number of maximum inaccessible tiles defines the validity of a board (if this check fails and more tiles are inaccessible, the board is recreated). Agents are always placed in each of the 4 corners of the board, with a certain (CORNER_DISTANCE
) distance from the corners.
public static boolean VERBOSE = false; public static boolean VERBOSE_FM_DEBUG = false; public static boolean VISUALS = true; public static boolean LOGGING_STATISTICS = false;
The VERBOSE*
variables may be used for debugging: the game would output various information as it runs. The VISUALS
variable controls whether the GUI is used or not (games run faster without visuals, if only the final result/logging information is of interest). The LOGGING_STATISTICS
variable may be used to log various statistics about the game being run (slows down execution).
public static int FRAME_DELAY = 100; public static int MAIN_SCREEN_SIZE = 550; public static int PO_SCREEN_SIZE = 165; public static int AVATAR_ICON_SIZE = 30; public static int CELL_SIZE_MAIN = MAIN_SCREEN_SIZE / BOARD_SIZE; //50 public static int CELL_SIZE_PO = PO_SCREEN_SIZE / BOARD_SIZE; //15
These variables affect dimensions of elements displayed in the GUI, it's not recommended to change them.
- Home
- Pommerman Game Rules
- Py-Pommerman
- Java-Pommerman
- Docker
- Python-Java Connection