Search Unity

Utility AI (Discussion)

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

  1. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    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.
     
    giraffe1, nirvanajie and Antypodish like this.
  2. SteveLalancetteUbisoft

    SteveLalancetteUbisoft

    Joined:
    Sep 13, 2019
    Posts:
    2
    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

    laurentlavigne

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