Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. The 2022.2 beta is now available for testing. To find out what's new, have a look at our 2022.2 feature highlights.
    Dismiss Notice
  3. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
Dismiss Notice
Submit bug reports tagged with #Beta2022Win_Unity when you encounter unknown issues while testing the 2022.2 betas for a chance to win a year of Unity Pro. For more information, have a look at our Beta Sweepstakes Announcement.

How to reset ML Agents environment when MaxStep is reached?

Discussion in 'AI & Navigation Previews' started by SaroVati, May 28, 2020.

  1. SaroVati

    SaroVati

    Joined:
    Jun 7, 2015
    Posts:
    5
    Hello,

    Haven't found an answer to this, but I have a few functions that subscribe to the OnEnvironmentReset, but OnEnvironmentReset is only called at the start of my training, and never when MaxStep is reached. It feels like I'm missing something extremely simple, but I can't find the issue.

    EDIT: On further research, I understand the use cast of OnEnvironmentReset. My question now is: Is there a built in event for when MaxSteps is reached, or should I design that myself? All of my agents currently would be acting with a MaxStep of 5000, and I'd like an "OnEpisodeEnd" event to subscribe and reset my environment with.

    Any help would be great!
     
    Last edited: May 28, 2020
  2. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    400
unityunity