Skip to content

Clickenv#600

Open
daphne-cornelisse wants to merge 15 commits into
PufferAI:4.0from
daphne-cornelisse:clickenv
Open

Clickenv#600
daphne-cornelisse wants to merge 15 commits into
PufferAI:4.0from
daphne-cornelisse:clickenv

Conversation

@daphne-cornelisse

@daphne-cornelisse daphne-cornelisse commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Click environment modeled after https://www.aimbooster.com/

Mouse movements override the agent's actions.

Agent receives 3 lives, each misclick subtracts one of them. The environment is reset if we reach the episode length or the agent is out of lives.

clickenv-demo

Comment thread ocean/click/click.h

if (!moved && !clicked) return 0;

env->actions[0] = move_x;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Human action space should match the agent action space

Comment thread ocean/click/click.h
for (int i = 0; i < NUM_START_TARGETS; i++) {
env->targets[i].x = rand_r(&env->rng) % env->width;
env->targets[i].y = rand_r(&env->rng) % env->height;
env->targets[i].radius = TARGET_RADIUS_MIN + rand_r(&env->rng) % (TARGET_RADIUS_MAX - TARGET_RADIUS_MIN + 1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why randomize radius?

Comment thread ocean/click/click.h
env->agent.y = env->actions[1];
env->agent.status = env->actions[2];
} else {
if (env->action_type == CONTINUOUS) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good env to use for a continuous vs. discrete ablation, but continuous isn't wired correctly in binding. There's not a clean way to do this afaik in 4.0 from a config param.

Comment thread ocean/click/click.h
if (env->targets[i].spawn_time == -1 && rand_r(&env->rng) % 100 < 20) { // 20% chance to spawn a new target
env->targets[i].x = rand_r(&env->rng) % env->width;
env->targets[i].y = rand_r(&env->rng) % env->height;
env->targets[i].radius = TARGET_RADIUS_MIN + rand_r(&env->rng) % (TARGET_RADIUS_MAX - TARGET_RADIUS_MIN + 1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why randomize this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the puffer in shared/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants