Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GFootball: unable to load steps on environment #107

Open
csaftoiu opened this issue Oct 20, 2020 · 0 comments
Open

GFootball: unable to load steps on environment #107

csaftoiu opened this issue Oct 20, 2020 · 0 comments

Comments

@csaftoiu
Copy link

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?

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

No branches or pull requests

1 participant