diff --git a/pufferlib/ocean/breakout/breakout.h b/pufferlib/ocean/breakout/breakout.h index 895f579bee..e823627281 100644 --- a/pufferlib/ocean/breakout/breakout.h +++ b/pufferlib/ocean/breakout/breakout.h @@ -397,7 +397,7 @@ void reset_round(Breakout* env) { env->ball_vy = 0.0; } -void reset(Breakout* env) { +void c_reset(Breakout* env) { env->score = 0; env->num_balls = 5; for (int i = 0; i < env->num_bricks; i++) { @@ -449,11 +449,11 @@ void step_frame(Breakout* env, float action) { if (env->num_balls < 0 || env->score == env->max_score) { env->terminals[0] = 1; add_log(env); - reset(env); + c_reset(env); } } -void step(Breakout* env) { +void c_step(Breakout* env) { env->terminals[0] = 0; env->rewards[0] = 0.0; @@ -533,7 +533,7 @@ void close_client(Client* client) { free(client); } -void render(Breakout* env) { +void c_render(Breakout* env) { if (env->client == NULL) { env->client = make_client(env); } diff --git a/pufferlib/ocean/nmmo3/nmmo3.h b/pufferlib/ocean/nmmo3/nmmo3.h index 5d0bd2c13e..fc866b0eb6 100644 --- a/pufferlib/ocean/nmmo3/nmmo3.h +++ b/pufferlib/ocean/nmmo3/nmmo3.h @@ -1630,7 +1630,7 @@ void enemy_ai(MMO* env, int pid) { wander(env, pid); } -void reset(MMO* env) { +void c_reset(MMO* env) { env->tick = 0; env->market_sells = 0; @@ -1833,7 +1833,7 @@ void reset(MMO* env) { compute_all_obs(env); } -void step(MMO* env) { +void c_step(MMO* env) { env->tick += 1; int tick = env->tick; @@ -3109,7 +3109,7 @@ void process_command_input(Client* client, MMO* env) { DrawText(text, 10, 10, 20, BLACK); } -int render(MMO* env) { +int c_render(MMO* env) { if (env->client == NULL) { // Must reset before making client env->client = make_client(env); diff --git a/pufferlib/ocean/pong/pong.h b/pufferlib/ocean/pong/pong.h index c2ee9f4dab..59fe2b77aa 100644 --- a/pufferlib/ocean/pong/pong.h +++ b/pufferlib/ocean/pong/pong.h @@ -108,14 +108,14 @@ void reset_round(Pong* env) { env->n_bounces = 0; } -void reset(Pong* env) { +void c_reset(Pong* env) { reset_round(env); env->score_l = 0; env->score_r = 0; compute_observations(env); } -void step(Pong* env) { +void c_step(Pong* env) { env->tick += 1; env->rewards[0] = 0; env->terminals[0] = 0; @@ -172,7 +172,7 @@ void step(Pong* env) { if (env->score_r == env->max_score) { env->terminals[0] = 1; add_log(env); - reset(env); + c_reset(env); return; } else { reset_round(env); @@ -203,7 +203,7 @@ void step(Pong* env) { if (env->score_l == env->max_score) { env->terminals[0] = 1; add_log(env); - reset(env); + c_reset(env); return; } else { reset_round(env); @@ -259,7 +259,7 @@ void close_client(Client* client) { free(client); } -void render(Pong* env) { +void c_render(Pong* env) { if (env->client == NULL) { env->client = make_client(env); }