openai / coinrun

Code for the paper "Quantifying Transfer in Reinforcement Learning"
https://blog.openai.com/quantifying-generalization-in-reinforcement-learning/
MIT License
395 stars 88 forks source link

Test level generation #43

Open anishthite opened 4 years ago

anishthite commented 4 years ago

Hello! I am trying to modify the environment where I can pass in a string similar to char test and have it build a level. However, I can't seem to get the environment to render char test as a level. I've modified state_reset to call generate_test_level after initial_floor_and_walls, but it seems to result in the agent suspended in a wall with no ability to move. Furthermore, editing char test doesn't seem to have an effect. Do you have any suggestions for generating a specific layout based on a char?

Thank you!

christopherhesse commented 3 years ago

It looks like you need to have a function like generate_test_level: https://github.com/openai/coinrun/blob/master/coinrun/coinrun.cpp#L675 You should start with passing in exactly the existing test level: https://github.com/openai/coinrun/blob/master/coinrun/coinrun.cpp#L100 and making sure it works, then trying other test levels of your own design. It might be something simple like your position is being set to inside a wall or the expected level size is incorrect.