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.

Game speed is sped up when running ml-agents

Discussion in 'ML-Agents' started by IMGDevelopment, Aug 20, 2021.

  1. IMGDevelopment

    IMGDevelopment

    Joined:
    Nov 16, 2018
    Posts:
    1
    When I press play in unity my game speed is at the correct set speed. However, when I run ml-agents in Comand Propmt and then press play in unity, all the animations of the game are sped up - char select normally has a slow rotation animation when you flick through them but now it will just do it instantly. The game noramlly ends in around 60 secs but with ml-agents running it ends in 2 seconds and at the end there is a coin that spins at a moderate speed but will be violantly spining around with mla running.

    Any fixes for this?
     
  2. growsolutionsapp

    growsolutionsapp

    Joined:
    May 12, 2021
    Posts:
    16


    this is not an issue.
    this is feature for mlagents. with this feature you can train your modal faster

    pls read docs. https://github.com/Unity-Technologies/ml-agents/blob/release_17/docs/Training-Configuration-File.md

    upload_2021-8-20_18-30-19.png

    see the time_scale and match with editor boath are same.


    sorry for english.
     
  3. LostShepherd

    LostShepherd

    Joined:
    May 31, 2019
    Posts:
    36
  4. garytrickett

    garytrickett

    Joined:
    Sep 2, 2018
    Posts:
    62
    the config file is your .yaml or behaviour file if you have made one
    otherwise you can pass
    Code (CSharp):
    1. --time-scale=#
    in the command prompt when you run your training
    i.e.
    Code (CSharp):
    1. mlagents-learn --time-scale=1 --run-id=1 --force
    though as said, the speed up is intended to make the training quicker otherwise you will end up waiting much longer (default training speed is 20x or --time-scale=20)
     
    LostShepherd likes this.
  5. LostShepherd

    LostShepherd

    Joined:
    May 31, 2019
    Posts:
    36
    Thanks I ended up using the --time-scale=1 as I do not have a yaml file. In terms of the speed my options are limited as its a turn based game with objects being Tweened to certain positions, I find if I increase the speed too much things start breaking that won't when played a little slower. I'm hoping to scale horizontally and train ,multiple agents at once to get past that issue.