This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
/
game_config.lua
executable file
·231 lines (170 loc) · 6.58 KB
/
game_config.lua
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
if not g_opts then g_opts = {} end
g_opts.multigames = {}
-------------------
--some shared RangeOpts
--current min, current max, min max, max max, increment
local mapH = torch.Tensor{5,10,5,10,1}
local mapW = torch.Tensor{5,10,5,10,1}
local blockspct = torch.Tensor{0,.2,0,.2,.01}
local waterpct = torch.Tensor{0,.2,0,.2,.01}
-------------------
--some shared StaticOpts
local sso = {}
-------------- costs:
sso.costs = {}
sso.costs.goal = 0
sso.costs.empty = 0.1
sso.costs.block = 1000
sso.costs.water = 0.2
sso.costs.corner = 0
sso.costs.step = 0.1
sso.costs.pushableblock = 1000
---------------------
sso.crumb_action = 0
sso.push_action = 1
sso.flag_visited = 1
sso.enable_boundary = 0
sso.enable_corners = 1
sso.max_attributes = g_opts.max_attributes or 6
-------------------------------------------------------
-- MultiGoals:
local MultiGoalsRangeOpts = {}
MultiGoalsRangeOpts.mapH = mapH:clone()
MultiGoalsRangeOpts.mapW = mapW:clone()
MultiGoalsRangeOpts.blockspct = blockspct:clone()
MultiGoalsRangeOpts.waterpct = waterpct:clone()
MultiGoalsRangeOpts.ngoals = torch.Tensor{2,6,3,6,1}
MultiGoalsRangeOpts.ngoals_active = torch.Tensor{1,3,1,3,1}
local MultiGoalsStaticOpts = {}
for i,j in pairs(sso) do MultiGoalsStaticOpts[i] = j end
MultiGoalsOpts ={}
MultiGoalsOpts.RangeOpts = MultiGoalsRangeOpts
MultiGoalsOpts.StaticOpts = MultiGoalsStaticOpts
g_opts.multigames.MultiGoals = MultiGoalsOpts
-------------------------------------------------------
-- CondGoals:
local CondGoalsRangeOpts = {}
CondGoalsRangeOpts.mapH = mapH:clone()
CondGoalsRangeOpts.mapW = mapW:clone()
CondGoalsRangeOpts.blockspct = blockspct:clone()
CondGoalsRangeOpts.waterpct = waterpct:clone()
CondGoalsRangeOpts.ngoals = torch.Tensor{2,6,3,6,1}
CondGoalsRangeOpts.ncolors = torch.Tensor{2,6,3,6,1}
local CondGoalsStaticOpts = {}
for i,j in pairs(sso) do CondGoalsStaticOpts[i] = j end
CondGoalsOpts ={}
CondGoalsOpts.RangeOpts = CondGoalsRangeOpts
CondGoalsOpts.StaticOpts = CondGoalsStaticOpts
g_opts.multigames.CondGoals = CondGoalsOpts
-------------------------------------------------------
-- Exclusion:
local ExclusionRangeOpts = {}
ExclusionRangeOpts.mapH = mapH:clone()
ExclusionRangeOpts.mapW = mapW:clone()
ExclusionRangeOpts.blockspct = blockspct:clone()
ExclusionRangeOpts.waterpct = waterpct:clone()
ExclusionRangeOpts.ngoals = torch.Tensor{2,6,3,6,1}
ExclusionRangeOpts.ngoals_active = torch.Tensor{1,3,1,3,0}
local ExclusionStaticOpts = {}
for i,j in pairs(sso) do ExclusionStaticOpts[i] = j end
ExclusionOpts ={}
ExclusionOpts.RangeOpts = ExclusionRangeOpts
ExclusionOpts.StaticOpts = ExclusionStaticOpts
g_opts.multigames.Exclusion = ExclusionOpts
-------------------------------------------------------
-- Switches:
local SwitchesRangeOpts = {}
SwitchesRangeOpts.mapH = mapH:clone()
SwitchesRangeOpts.mapW = mapW:clone()
SwitchesRangeOpts.blockspct = blockspct:clone()
SwitchesRangeOpts.waterpct = waterpct:clone()
SwitchesRangeOpts.nswitches = torch.Tensor{1,5,1,5,0}
SwitchesRangeOpts.ncolors = torch.Tensor{1,6,1,6,1}
local SwitchesStaticOpts = {}
for i,j in pairs(sso) do SwitchesStaticOpts[i] = j end
SwitchesOpts ={}
SwitchesOpts.RangeOpts = SwitchesRangeOpts
SwitchesOpts.StaticOpts = SwitchesStaticOpts
g_opts.multigames.Switches = SwitchesOpts
-------------------------------------------------------
-- LightKey:
local LightKeyRangeOpts = {}
LightKeyRangeOpts.mapH = mapH:clone()
LightKeyRangeOpts.mapW = mapW:clone()
LightKeyRangeOpts.blockspct = blockspct:clone()
LightKeyRangeOpts.waterpct = waterpct:clone()
local LightKeyStaticOpts = {}
for i,j in pairs(sso) do LightKeyStaticOpts[i] = j end
LightKeyOpts ={}
LightKeyOpts.RangeOpts = LightKeyRangeOpts
LightKeyOpts.StaticOpts = LightKeyStaticOpts
g_opts.multigames.LightKey = LightKeyOpts
-------------------------------------------------------
-- Goto:
local GotoRangeOpts = {}
GotoRangeOpts.mapH = mapH:clone()
GotoRangeOpts.mapW = mapW:clone()
GotoRangeOpts.blockspct = blockspct:clone()
GotoRangeOpts.waterpct = waterpct:clone()
local GotoStaticOpts = {}
for i,j in pairs(sso) do GotoStaticOpts[i] = j end
GotoOpts ={}
GotoOpts.RangeOpts = GotoRangeOpts
GotoOpts.StaticOpts = GotoStaticOpts
g_opts.multigames.Goto = GotoOpts
-------------------------------------------------------
-- GotoHidden:
local GotoHiddenRangeOpts = {}
GotoHiddenRangeOpts.mapH = mapH:clone()
GotoHiddenRangeOpts.mapW = mapW:clone()
GotoHiddenRangeOpts.blockspct = blockspct:clone()
GotoHiddenRangeOpts.waterpct = waterpct:clone()
GotoHiddenRangeOpts.ngoals = torch.Tensor{1,6,3,6,1}
local GotoHiddenStaticOpts = {}
for i,j in pairs(sso) do GotoHiddenStaticOpts[i] = j end
GotoHiddenOpts ={}
GotoHiddenOpts.RangeOpts = GotoHiddenRangeOpts
GotoHiddenOpts.StaticOpts = GotoHiddenStaticOpts
g_opts.multigames.GotoHidden = GotoHiddenOpts
-------------------------------------------------------
-- PushBlock:
--note: these are not the shared range opts!!!
local PushBlockRangeOpts = {}
PushBlockRangeOpts.mapH = torch.Tensor{3,7,3,7,1}
PushBlockRangeOpts.mapW = torch.Tensor{3,7,3,7,1}
PushBlockRangeOpts.blockspct = torch.Tensor{0,0.1,0,.1,.01}
PushBlockRangeOpts.waterpct = torch.Tensor{0,0.1,0,.1,.01}
local PushBlockStaticOpts = {}
for i,j in pairs(sso) do PushBlockStaticOpts[i] = j end
PushBlockOpts ={}
PushBlockOpts.RangeOpts = PushBlockRangeOpts
PushBlockOpts.StaticOpts = PushBlockStaticOpts
g_opts.multigames.PushBlock = PushBlockOpts
-------------------------------------------------------
-- PushBlockCardinal:
--note: these are not the shared range opts!!!
local PushBlockCardinalRangeOpts = {}
PushBlockCardinalRangeOpts.mapH = torch.Tensor{3,7,3,7,1}
PushBlockCardinalRangeOpts.mapW = torch.Tensor{3,7,3,7,1}
PushBlockCardinalRangeOpts.blockspct = torch.Tensor{0,0.1,0,.1,.01}
PushBlockCardinalRangeOpts.waterpct = torch.Tensor{0,0.1,0,.1,.01}
local PushBlockCardinalStaticOpts = {}
for i,j in pairs(sso) do PushBlockCardinalStaticOpts[i] = j end
PushBlockCardinalOpts ={}
PushBlockCardinalOpts.RangeOpts = PushBlockCardinalRangeOpts
PushBlockCardinalOpts.StaticOpts = PushBlockCardinalStaticOpts
g_opts.multigames.PushBlockCardinal = PushBlockCardinalOpts
-------------------------------------------------------
-- BlockedDoor:
local BlockedDoorRangeOpts = {}
BlockedDoorRangeOpts.mapH = mapH:clone()
BlockedDoorRangeOpts.mapW = mapW:clone()
BlockedDoorRangeOpts.blockspct = blockspct:clone()
BlockedDoorRangeOpts.waterpct = waterpct:clone()
local BlockedDoorStaticOpts = {}
for i,j in pairs(sso) do BlockedDoorStaticOpts[i] = j end
BlockedDoorOpts ={}
BlockedDoorOpts.RangeOpts = BlockedDoorRangeOpts
BlockedDoorOpts.StaticOpts = BlockedDoorStaticOpts
g_opts.multigames.BlockedDoor = BlockedDoorOpts
return g_opts