Unity-Technologies / obstacle-tower-source

Obstacle Tower Source Code
Apache License 2.0
120 stars 25 forks source link

Replaying a demonstration from python fails to take the same path as the demo #13

Closed m-rph closed 4 years ago

m-rph commented 4 years ago

I have recorded some demonstrations through the unity editor and I have tried to retrace the path, i.e. take the exact same actions as those in the demo but the agent always ends up failing to reach the same point. I have initialized the environment with the same seed as that from the demo.

def replay(path, **other_params):
    brain_params, brain_infos, _ = demo_loader.load_demonstration(str(path))
    #some initialization and setting up
    # ....
    # ....
    env.reset()
    #starting from 1 because the info contains the previous action
    for binfo in brain_infos[1:]:
        #process_info extracts the vector of the previous_action
        _,_,_, info = process_info(binfo)
        _,_,_, newinfo = env.step(info.previous_action)

My goal is to be able to take in a demonstration and take the same steps as those in the demo in order to return to the same location as the final step (of the demo).

awjuliani commented 4 years ago

Hello @Solliet

Unfortunately, It is not possible for demonstrations to perfectly be replayed due to slight differences in the physics when running at different timescales.

It is possible to have the agent start on a specific floor and seed however, which would allow for some level of "resetting to a position," though not at the intra-floor level.

m-rph commented 4 years ago

Hello @awjuliani, Thanks a lot for the help. Feel free to close the issue.