Skip to content

Commit afc9d4c

Browse files
committed
Finish adding OOD support for all games *
* Besides chaser and plunder, that don't support any of the current holdout types
1 parent 0bd3336 commit afc9d4c

5 files changed

Lines changed: 15 additions & 6 deletions

File tree

procgen/env.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,19 @@
5656
"bigfish",
5757
"bossfight",
5858
"caveflyer",
59-
# "chaser",
59+
# "chaser", # not currently supported
6060
"climber",
6161
"coinrun",
6262
"dodgeball",
63+
"fruitbot",
64+
"heist",
65+
"jumper",
66+
"leaper",
67+
"maze",
68+
"miner",
69+
"ninja",
70+
# "plunder", # not currently supported
71+
"starpilot",
6372
# Add more as they are finished
6473
]
6574

procgen/src/games/heist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class HeistGame : public BasicAbstractGame {
117117

118118
int min_maze_dim = 5;
119119
int max_diff = (world_dim - min_maze_dim) / 2;
120-
int difficulty = rand_gen.randn(max_diff + 1);
120+
int difficulty = randn_type_switch(max_diff + 1, "platform");
121121

122122
options.center_agent = options.distribution_mode == MemoryMode;
123123

procgen/src/games/leaper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class LeaperGame : public BasicAbstractGame {
147147
bottom_road_y = choose_extra_space() + 1;
148148

149149
int max_diff = options.distribution_mode == EasyMode ? 3 : 4;
150-
int difficulty = rand_gen.randn(max_diff + 1);
150+
int difficulty = randn_type_switch(max_diff + 1, "platform");
151151

152152
// half the time we add an extra lane to either roads or water
153153
int extra_lane_option = options.distribution_mode == EasyMode ? 0 : rand_gen.randn(4);

procgen/src/games/ninja.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class Ninja : public BasicAbstractGame {
330330
}
331331

332332
int max_difficulty = 3;
333-
int difficulty = rand_gen.randn(max_difficulty) + 1;
333+
int difficulty = randn_type_switch(max_difficulty, "platform") + 1; // 1 to 2 for training; 3 for eval
334334

335335
last_fire_time = 0;
336336

procgen/src/games/starpilot.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ class StarPilotGame : public BasicAbstractGame {
250250
int flyer_theme = 0;
251251

252252
if (type == FLYER || type == FAST_FLYER) {
253-
group_size = rand_gen.randint(0, hp_max_group_size) + 1;
254-
flyer_theme = rand_gen.randn(NUM_SHIP_THEMES);
253+
group_size = rand_gen.randint(0, hp_max_group_size) + 1; // TODO: switch on "platform" ("difficulty") type ?
254+
flyer_theme = randn_type_switch(NUM_SHIP_THEMES, "enemy");
255255
}
256256

257257
float y_pos = rand_pos(r, main_height);

0 commit comments

Comments
 (0)