forked from ukoethe/bomberman_rl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
62 lines (52 loc) · 1.24 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import logging
from pathlib import Path
from fallbacks import pygame
# Game properties
COLS = 17
ROWS = 17
SCENARIOS = {
"coin-heaven": {
"CRATE_DENSITY": 0,
"COIN_COUNT": 50
},
# This is the tournament game mode
"classic": {
"CRATE_DENSITY": 0.75,
"COIN_COUNT": 9
}
# Feel free to add more game modes and properties
# game is created in environment.py -> BombeRLeWorld -> build_arena()
}
MAX_AGENTS = 4
# Round properties
MAX_STEPS = 400
# GUI properties
GRID_SIZE = 30
WIDTH = 1000
HEIGHT = 600
GRID_OFFSET = [(HEIGHT - ROWS * GRID_SIZE) // 2] * 2
ASSET_DIR = Path(__file__).parent / "assets"
AGENT_COLORS = ['blue', 'green', 'yellow', 'pink']
# Game rules
BOMB_POWER = 3
BOMB_TIMER = 4
EXPLOSION_TIMER = 2 # = 1 of bomb explosion + N of lingering around
# Rules for agents
TIMEOUT = 0.5
TRAIN_TIMEOUT = float("inf")
REWARD_KILL = 5
REWARD_COIN = 1
# User input
INPUT_MAP = {
pygame.K_UP: 'UP',
pygame.K_DOWN: 'DOWN',
pygame.K_LEFT: 'LEFT',
pygame.K_RIGHT: 'RIGHT',
pygame.K_RETURN: 'WAIT',
pygame.K_SPACE: 'BOMB',
}
# Logging levels
LOG_GAME = logging.INFO
LOG_AGENT_WRAPPER = logging.INFO
LOG_AGENT_CODE = logging.DEBUG
LOG_MAX_FILE_SIZE = 100 * 1024 * 1024 # 100 MB