simoninithomas / the_mayan_adventure

The Mayan Adventure is an open-source reinforcement learning environment for Unity ML-Agents. In this environment, you train your agent (Indie) to find the golden statue in this dangerous environment full of traps.
MIT License
36 stars 8 forks source link

Support latest ML-Agents version #2

Closed mbalesni closed 3 years ago

mbalesni commented 3 years ago

The environment currently doesn't support any version of ML-Agents available in the Unity registry. This pull request changes that by adding support for the latest ML-Agents Release 10. The commits do not make any content changes (I believe).

Known bug: in non-training mode, when the episode ends, the environment crashes with an error saying that OnEpisodeBegin was called recursively. The error does not appear and everything works perfectly if I set training set to true, even if no model is being trained.

I was not able to fix the issue by:

From my analysis, the issue comes from ending the episode within a Coroutine (GameOver function), which, as far as I understood, is asynchronous by nature, and is necessary for pretty animations and win/lose screens in the end. If anyone knows how to fix this, I'll be happy to add it to the pull request!

This is my first-ever pull-request on GitHub, so any feedback and suggestions for improvement would mean the world to me!

simoninithomas commented 3 years ago

Hi, @nick-baliesnyi amazing work! Idk why I didn't saw this pull request before! My sincere apologies for the very big delay when something like that happen feel free to stalk me on twitter until I answer.

Even if there are some errors to fix as you said I merged it. The simplest way to solve GameOver situation is to remove any UI and just check when y position of the agent is below a certain value (for instance -2), stop the episode: EndEpisode().

About the feedback you ask, well you've made a very good PR, since you explain what you've done clearly, the errors that need to be fixed and you analysed what could be improved. That's perfect (much better than most of my PR ^^).

Have a nice day,

mbalesni commented 3 years ago

No worries at all @simoninithomas, glad to help, and thanks for the feedback!