Search Unity

Switching between brains

Discussion in 'ML-Agents' started by TnTonly, Jul 27, 2020.

  1. TnTonly

    TnTonly

    Joined:
    Oct 12, 2018
    Posts:
    7
    Back then, I had a setup of an agent consisting of 2 different brains, using a script to "toggle" between appropriate behaviours.

    Recently, I updated the ml-agents library to r3 and realised that Brain is no longer a scriptable objects. I am not sure I understand how to implement my model in the new setup. I have added 2 separate Behaviour Parameters components but that doesn't seem right. Should I "toggle" the Behaviour Parameters components as well, and how? Or should I implement the model differently?

    Any suggestion is welcome. Thanks!
     
  2. elieceralejandromv

    elieceralejandromv

    Joined:
    Jul 13, 2020
    Posts:
    8
    There is an example with what you described.

    In: ML-Agents/Examples/WallJump/Scripts/WallJumpAgent.cs
    Look for the function Configure agent

    That example contains all the logic for that.


    SetModel("SmallWallJump", noWallBrain);
     
    TnTonly likes this.
  3. TnTonly

    TnTonly

    Joined:
    Oct 12, 2018
    Posts:
    7
    Thank you! I will look into it.