Kaggle / Kaggle/kaggle-environments

GFootball: unable to load steps on environment

Open
#107 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
452
Forks
190
Avg merge
31m
Merged PRs (30d)
2

Description

I'm attempting to replay earlier games to see how same agent does. I keep track of list of observations that I get from step:

```
obs = env.step([action0, action1])
```

Then I set it on `steps` when I build the environment:

```
prev_steps = json.load(open('replay-score-at-1799.json'))

env = make(
'football',
configuration={
# 'save_video': True,
# 'running_in_notebook': False,
'action_set': 'default',
"scenario_name": "11_vs_11_kaggle",
# 'football_video_path': 'football.webm',
'number_of_left_players_agent_controls': 1,
'number_of_right_players_agent_controls': 1,
},
steps=prev_steps[:1750],
debug=True)
```

It looks like the state of the environment is correct:

```
obs = env.state # right after initializing
print("Steps left on load:", obs[0]['observation']['players_raw'][0]['steps_left'])
print("env steps length:", len(env.steps))

# output is:
# Steps left on load: 1252
# env steps length: 1750
```

However when I take the first 'step' from `env.step`:

```
obs = env.state # right after initializing
action0 = ...
action1 = ...
print("actions:", action0, action1, action0 + action1)
obs = env.step([action0, action1])
```

... it resets the environment:
```
actions: [5] [1] [5, 1]
Staring a new environment 773984e8-8c98-4ed9-a03b-9c21bce6aeec: with scenario: 11_vs_11_kaggle
```

What am I doing wrong?

Contributor guide

Open the contributing guide

Research direction

Start from the `make('football')` entry point and trace how `steps=prev_steps[:1750]` is consumed by `env.step([action0, action1])`. Reproduce the logged state and first-step reset, then verify that a loaded replay advances from its existing steps without starting a new environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.