-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconstants.py
78 lines (65 loc) · 2.45 KB
/
constants.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""
Name: constants.py
Authors: Oliver Giles & Max Potter
Date: July 2017
Description:
- Stores the various parameters of the game
"""
from numpy import float32
#Meta properties
MAX_EPOCH = 100
#Flags
RUN_DIAGNOSTICS = True
#Starting framerate
START_FPS = 10
#Sprite upscaler
SPRITESCALE = 2.5
#Game & tilemap dimensions
TILESIZE = 30 # dimensions of each square tile in terms of displacement
HEIGHT = 20 # number of tiles in y
WIDTH = 30 # number of tiles in x
MINSEEDS = 50 # Voronoi map generation seeds
MAXSEEDS = 50
#Genetic algorithm constants
GENE_POOL_SIZE = 15
#Neural network constants
INPUT_COUNT = 11
NEURONS_PER_LAYER = 4
NUM_HIDDEN_LAYERS = 1
OUTPUT_NEURONS = 3
#Creature constants
TIGER_EAT_ENERGY = 50
DEER_EAT_ENERGY = 3
TIGERPOP = 5
DEERPOP = 10
#Constants for colours
ORANGE = (242, 68, 56)
YELLOW = (255,193,8)
BROWN = (120, 84, 72)
GREEN = (76, 173, 80)
WHITE = (255, 255, 255)
#Constants for tiles
WALL = float32(10.25)
DIRT = float32(0.1)
GRASS = float32(2.5)
WOOD = float32(0.2)
TIGERCOLOUR = float32(-20.25)
DEERCOLOUR = float32(-10.25)
#Colour to tile conversion
colours = {
DIRT : WHITE,
GRASS : GREEN,
WOOD : BROWN,
DEERCOLOUR : YELLOW,
TIGERCOLOUR : ORANGE
}
tileNames = {
WALL : '#',
DIRT : 'd',
GRASS : 'g',
WOOD : 'w',
TIGERCOLOUR : 'T',
DEERCOLOUR : 'D'
}
# Tiger DNA to spawn on '/'
beastDNA = "111111010110011010101000100101001000001100011101001001101100101001000001000110100000101011001101100001010010001111101101110110110000100100010000001000100001101010000100110100100100111111001101101000000010110111011000011100010100100101100011110111111100010001101001110000001011001100100010101011010101010100111001100011111010000011111100011101001001101010000011011001001000000001011010101001110011101010100111000100100110011111100010111011101101100101010011110010110100111010000111010001110001111100011000110100010010100001010001001011001111100101010100101100110001010011010001111111101100110001010001010110111001110011010101110110011100001010110100101111000111110100010001110100000111001010101000011101110010001000000101011101010101010000101000111110000101111101000110010111111111010010001111010111010110110110100100110000010011110101111011000110110000111011111101111011001010010110100110011000101110111101101111010110111010010110011001001001011110011100111001110100010110011111010001001111101011"