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.

Some questions about best practices on Raycast Sensor for a specific environment

Discussion in 'ML-Agents' started by simonini_thomas, Mar 10, 2020.

  1. simonini_thomas


    Apr 30, 2015
    Hey there ,

    I'm currently working on an open-source curriculum learning project where an agent needs to cross a 3d level to catch the goal. The level is more and more complex as he's becoming good. Screenshot 2020-03-10 at 09.08.14.png

    The curriculum goes as follows:

    - 1st level of difficulty: Move toward the goal (the goal is on the same platform).
    - 2nd level of difficulty: Transform your physics to wood (using the green button) in order to cross the wood bridge
    - 3rd level of difficulty: Cross the fire by crossing with rock physics or waiting the fire off.
    - 4rth level of difficulty cross the rotating wood bridge.

    I do not want to use vision (first because it implies GPU) and second because I want then for the replay to use assets that I'm currently making that are nicer than the training environment.

    Screenshot 2020-03-10 at 09.09.48.png
    Work in progress

    However, because this agent does not have any vision, I use 3d ray perception sensors and that the placement of the wood bridge is random it fails miserably to learn to cross the bridge.
    Screenshot 2020-03-09 at 22.35.23.png

    My current game observations:
    - transform.InverseTransformDirection(rigidbody.velocity).
    - isRock: bool (if false it means the agent is made of wood).

    My current raycast:
    Screenshot 2020-03-10 at 09.17.28.png

    I have four questions:
    - Do you have some ideas on how I can handle that? I was thinking about creating a game object below called and tagged as void and allow the sensors to detect it. It's a good strategy?

    - Does Raycast 3d sensor get the position of the detected object?

    - Do you think it's a good idea to add goal position as an observation?

    - Do you think it's a good idea to stack the raycast obs?

    Again thanks for your help, UnityML is a really amazing tool to do RL .

    Attached Files:

    Last edited: Mar 11, 2020