Search Unity

[Solved] Question about training customization and c# docs

Discussion in 'ML-Agents' started by EternalMe, Dec 5, 2021.

  1. EternalMe

    EternalMe

    Joined:
    Sep 12, 2014
    Posts:
    183
    Hello. Currently the learning works by executing python learn script and then pressing play in unity. After that unity starts to send stuff over to python by sockets. I wonder is there anyway to hack this process? Like start sending info over sockets only after i push some button in play mode? I did not found much info about c# side Api for ml. Maybe i missed it?
     
  2. namuh

    namuh

    Joined:
    Nov 20, 2016
    Posts:
    23
    As soon as your GameObject with the agent script spawns, it will try to connect to a trainer over 5004 port.
    So, I guess you could just spawn the Agent after the Start button is pushed?
    Its not a 200IQ soln, but it should work.
     
  3. EternalMe

    EternalMe

    Joined:
    Sep 12, 2014
    Posts:
    183
    Turns out there is function for this `Academy.Instance.AutomaticSteppingEnabled = false;` and then I can do steps manually.
     
    namuh likes this.
  4. namuh

    namuh

    Joined:
    Nov 20, 2016
    Posts:
    23
    O wow, yeah that works too. :D