Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Are ML-Agents a suitable solution for my game's AI?

Discussion in 'ML-Agents' started by Ary_Ary, Jan 30, 2021.

  1. Ary_Ary


    Apr 16, 2020
    Hello and good day.
    Recently I found out about ML-Agents and that it's possible to make AI for games with them and I thought maybe I could use them for my game's AI but I'm not sure if they fit my needs.
    What I need is some sort of a typical AI for a FPS game, a state based system with some behaviors like wandering, attacking, covering, etc for each enemy and probably a manager to prevent enemies from attacking all at once.

    Is it possible to create such system using ML-Agents and does it worth the effort? or should I just write a state machine?
    Thanks for you help!
  2. ervteng_unity


    Unity Technologies

    Dec 6, 2018
    It's definitely possible with ML-Agents. You could do it in one of two ways - fully end-to-end with ML-Agents (agents just learn how to beat the enemy, but with little control as to what they're doing) or in combination with a state machine. You could for instance train different policies for wandering, attacking, etc, and pick between them using a state machine. We're working on a feature to enable multiple behaviors using one policy, so stay tuned for that.

    Where ML-Agents is really good is for learning reactive behaviors (e.g. how to kick a physics-based ball to get it into a goal, how to aim and shoot at enemies, how to fly a plane). It's less good at "planning" behaviors (e.g. playing chess). Hard to say whether the traditional approach or the ML approach would be easier, but it's definitely possible.
    Ary_Ary likes this.
  3. M0Gareeb


    Mar 30, 2021
    can you Expand in this Topic Can i Find a Doc or a Video or any type of tutorial that can help me on that