Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pufferlib/ocean/breakout/breakout.h
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions pufferlib/ocean/nmmo3/nmmo3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions pufferlib/ocean/pong/pong.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down