Skip to content

Commit da247f2

Browse files
author
Joseph Suarez
committed
battle env
1 parent 853b747 commit da247f2

File tree

5 files changed

+191
-109
lines changed

5 files changed

+191
-109
lines changed

pufferlib/config/ocean/battle.ini

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ input_size = 512
1212
hidden_size = 512
1313

1414
[vec]
15-
num_envs = 16
15+
num_envs = 8
1616

1717
[env]
18-
num_envs = 2
19-
num_agents = 512
18+
num_envs = 8
19+
num_agents = 128
2020
num_armies = 2
2121
size_x = 2
2222
size_y = 2
@@ -27,7 +27,7 @@ total_timesteps = 100_000_000
2727

2828
learning_rate = 0.0015534438005054883
2929
gamma = 0.9923382806478448
30-
minibatch_size = 65536
30+
minibatch_size = 32768
3131

3232
#adam_beta1 = 0.5797997352318079
3333
#adam_beta2 = 0.9001752474216785
@@ -45,3 +45,5 @@ minibatch_size = 65536
4545
#vf_coef = 1.8024088377114245
4646
#vtrace_c_clip = 1.7578256946375268
4747
#vtrace_rho_clip = 1.0041987439042879
48+
49+

pufferlib/ocean/battle/battle.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main() {
3131
init(&env);
3232

3333
// Allocate these manually since they aren't being passed from Python
34-
int num_obs = 6*env.num_armies + 19 + 8;
34+
int num_obs = 3*env.num_armies + 4*16 + 22 + 8;
3535
env.observations = calloc(env.num_agents*num_obs, sizeof(float));
3636
env.actions = calloc(3*env.num_agents, sizeof(int));
3737
env.rewards = calloc(env.num_agents, sizeof(float));
@@ -44,6 +44,7 @@ int main() {
4444
int ctrl = 0;
4545

4646
while (!WindowShouldClose()) {
47+
/*
4748
for (int i=0; i<env.num_agents; i++) {
4849
Entity* agent = &env.agents[i];
4950
int army = agent->army;
@@ -104,6 +105,7 @@ int main() {
104105
//env.actions[3*i + 1] = 4.0f;
105106
//env.actions[3*i + 2] = 4.0f;
106107
}
108+
*/
107109

108110
if (IsKeyDown(KEY_LEFT_SHIFT)) {
109111
if (IsKeyPressed(KEY_TAB)) {

0 commit comments

Comments
 (0)