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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Utility AI (Discussion)

Discussion in 'Game Design' started by Antypodish, Jan 4, 2019.

  1. neoshaman


    Feb 11, 2011
    Yep Frosted is right on the money, the ai coding pattern is less a problem than designing the game actually. Especially the construction of the accessible state, ie all the strategy to tag or feel the world.In fact utility is super hard because you must abstract behavior and choice to curve and score, which is not trivial.

    When I first seen this thread, I was about to make shout out to Dave Mark, but you guys covered it :D and I was about to tell about Utility tree but then it has been found (stack it up).

    IMHO teh best way to use utility is a concept tree (stack it up) that precisely map to concept, as an evaluation layer, then have the decision based on those concept in a behavior tree (world state ->perception -> evaluation -> decision -> action-> world state - ie the logic loop). In fact the concept in the evaluation pass are also managed with fsm (with state having local variable) to create slight context (so that you don't flip flop moods in a social sim for example).

    There is no silver bullet, a lot of people I met from the game industry now joke about the ai sandwich paradigm. It help that once you understand the logic loop of AI architecture are actually infinitely nestable according to your need. The best advice, to me, is to think about how to implement each step of the logic loop.
    nirvanajie and Antypodish like this.
  2. SteveLalancetteUbisoft


    Sep 13, 2019
    I've used Utility AI for two commercial products that I shipped at different companies. Both used the infinite axis model and worked really well for creating AI easily with simple building blocks and resulted in AI that felt very organic. Both were a bit difficult to debug, which I consider the main downside of the system. Both used behavior trees as well, but in different ways.

    The first project had a single behavior tree to handle all AI in the game (player, allies and monsters) and a block in the behavior tree called a utility system to find out what should be our target and what ability to use on that target. The second project used a utility system to figure out what to do and then ran a specific behavior tree based on the chosen action. In both cases, the utility system handled the decision (what to do) and the behavior tree handled the execution (how to do it).

    It worked very well for me and I would definitely use a similar system for any project that requires unpredictable AI that feels organic.
  3. laurentlavigne


    Aug 16, 2012
    If seed uses infinite axis then it must scale quite well.
    Anything else you can share of your implementation? Polling needed optimization I bet.
  4. Ashkan_gc


    Aug 12, 2009
    Guys since someone asked for a tool. This tool of ours is paid and not in DOTS yet but might be useful to someone. Wise Feline Utility AI and Influence maps for unity

    We originally made a version for DOTS as you can read the story here. Currently due to low demand probably only the influence map will be data oriented and burst compatible.

    This said given enough users we can redo the DOTS version.