Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question ML Agents training change velocity and gravity, WHY?

Discussion in 'ML-Agents' started by peidencoding, Apr 4, 2023.

  1. peidencoding

    peidencoding

    Joined:
    Nov 11, 2022
    Posts:
    7
    Hey, i have a question regarding ML Agents. I programmed a 3D Flappy Bird Version and the Bird has a RigidBody. This works very well when i dont train the agent (Bird).
    As soon as i start the training ("mlagents-learn" in anaconda console) the gravity and velocity changes.
    The bird moves with transform.Translate(transform.right * moveSpeed * Time.deltaTime) and jumps with
    rig.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
    In training this is approx. 15 times faster than running the game without training.
    Has anybody an idea how this is possible?
     
  2. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    21
    By default, during training, ML-Agents runs Unity at about 10x regular speed to speed up the training process. You can disable this when running by adding --time-scale=1 to your cmd command when starting the trainer.
     
    peidencoding likes this.
  3. peidencoding

    peidencoding

    Joined:
    Nov 11, 2022
    Posts:
    7
    Nice, it works, thanks!