Any of Utility AI nodes out there?

Forums πŸ’¬ NodeCanvas πŸ—¨οΈ General Discussion Any of Utility AI nodes out there?

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #13323
    anton petrov
    Participant

      Hi!

      I know that a Priority Selector goes out of the box.

      But as I can see there are no nodes to implement something like Considerations and Options for AI to produce priority weights in a structured way. Would be great to have utility curves visualization too. Maybe there exist some plugins for NodeCanvas implementing this?

      #13337
      Gavalakis
      Keymaster

        Hello,

        The Priority Selector is best utilized with Blackboard Variables (each priority linked to a variable). You can then have these variables be property bound to properties on some script on the agent gameobject and in turn have those properties return any value you want. Thus you could also have a property evaluating a curve of course and have that property feed the result in the variable automatically (due to property binding). Do you mean something similar but already implemented in NodeCanvas without the need to use property binding?

        I could probably add a curve for each “priority” and have the float value evaluate that curve (instead of directly using that float value). Is that close to your suggestion?

        Let me know. Thanks πŸ™‚

        #13336
        anton petrov
        Participant

          Thx Gavalakis,

          Yes, going with blackboard variables as utilities (weights) is okay for simple cases. And probably I am going to start with that for my AI.

          The full solution can be deduced from these two articles:
          http://www.gameaipro.com/GameAIPro/GameAIPro_Chapter10_Building_Utility_Decisions_into_Your_Existing_Behavior_Tree.pdf
          http://www.gameaipro.com/GameAIPro/GameAIPro_Chapter09_An_Introduction_to_Utility_Theory.pdf

          The ultimate idea is to make nodes which return not only Status but a floating-point result. Then we could implement different nodes: considerations, evaluators (curves) and any other type of node which generates or modifies input utility value (a float). Currently it looks like all these is a mix of initial Conditions which generate weight and Calculations which modify the weight and all of these can be implemented via FlowCanvas but passing produced weights to a NodeCanvas’s Selector will require a dozen of blackboard variables.

          Evaluating and executing utility-based logic is a two step process: first we evaluate utility values then use them to perform corresponding actions. Using two subgraphs (one which sets variables and another one which uses them) is possible but not an ideal because adds some complexity and is not user-friendly. I guess we want to see desicion weighting and the action in a single graph branch but currently I do not see an elegant way to hack it into the NodeCanvas…

          Only because I love NodeCanvas and its editor I am looking forward to hack it somehow to add this extra functionality and am asking if anything similar already exists πŸ™‚

          #13335
          Gavalakis
          Keymaster

            Hello again and sorry for the late reply.
            Also thank you for your positive feedback! Much appreciated πŸ™‚

            Indeed, nodes now only return a Status. The Priority Selector is basically the only node that kind of mimics utility theory since its connections are weighted by a float value. That float value (weight), can stem from any float variable source, which in turn can stem from a bound property/field.

            As such, the Priority Selector can be used for utility decision making, meaning that based on the weights, the Priority Selector will “decide” which of the child nodes (and thus branch) to follow/execute.

            My suggested idea in my previous post, was to incorporate a curve specifically in the Priority Selector weights (so that each weight is actually a pair of curve and float fields, where the curve is evaluated by the float for the end resulting weight).

            Let me know.
            Thanks!

            #13334
            das
            Participant

              better yet: on top of curve modulator have every node return a score and override that in score decorators, allowing chaining of scoring

              utility *= decoratednode.GetUtility()

              #13333
              Gavalakis
              Keymaster

                Thank you for your extra input. I will take a second look at Utility Selector soon and try my best to improve it on all suggestions I’ve had so far πŸ™‚
                Thanks!

                #13332
                bzwill
                Participant

                  I could probably add a curve for each β€œpriority” and have the float value evaluate that curve (instead of directly using that float value). Is that close to your suggestion?

                  Hey Gavalakis – long time user here – logged in just to say it would be amazing if you implemented a curve node that took an input and evaluated it inside Node Canvas – I would hugely support being able to integrate utility drivers intoΒ  elements of my BTs natively inside your product!

                   

                  Here’s a link to an OS project that links curves into priorities – there’s two notes of use (I guess perhaps better suited to flow canvas)

                  • Curve evaluation
                  • MultiplyAll / Average

                  The flow is multiple curves evaluations are then averaged, combining for a score 0-1, then fed into a priority selector.

                  https://github.com/OneManMonkeySquad/UtilityAI/blob/master/Docs/Editor.png

                  Thanks for the great software!

                  #13331
                  Gavalakis
                  Keymaster

                    Hello again,
                    I have recently modified the Priority Selector to include curves and multiple consideration per child node.
                    Each Consideration is a pair of input value and a curve, which together result in the consideration utility.
                    If multiple considerations are used per child (desire), then the average of all consideration utility results is used.
                    I have attached for you here the modified Priority Selector (it is backwards compatible with the existing one).

                    Please let me know what you think of it, or if you deem any further improvements would be nice πŸ™‚
                    Thanks!

                    #13330
                    das
                    Participant

                      The utility accumates down the chain?

                      Important for composition such as proximity * selfhealth * selfhunger

                      #13329
                      Gavalakis
                      Keymaster

                        Hey,

                        What do you mean? Each child can have multiple considerations. If multiple considerations are used, then the average utility weight of all considerations is used for that child. Then the child with the highest final utility wight is executed.

                        #13328
                        bzwill
                        Participant

                          @gravalakis – Ive just has a chance to start looking a this – how does it work? Do I add Evaulate curve actions under the priority selector?

                          If I want multiple curves evaluated, do I put them all in one action node?

                          #13327
                          bzwill
                          Participant

                            [quote quote=15341]Hey, What do you mean? Each child can have multiple considerations. If multiple considerations are used, then the average utility weight of all considerations is used for that child. Then the child with the highest final utility wight is executed. [/quote]
                            Hey Gavalakis.

                             

                            I’ve worked out my previous problem but I know what this refers to and I also have this need. To roll up a winner to a higher level to see if it wins.

                            Imagine a priority selector with 3 desires, and it having a way to take its top ‘winner’ and use that as a consideration for a higher order / parent priority selector.

                             

                            In this way, the considerations probably make / made more sense as decorators?

                            #13326
                            Gavalakis
                            Keymaster

                              Hello again,

                              Right now, each Priority Selector Desire can have one or more Considerations (value/curve pair). The Desire (child) with the highest Consideration Utility Value is executed.

                              I am not exactly sure what would the difference be if consideration were implemented as decorators in this particular case πŸ™‚

                              #13325
                              anton petrov
                              Participant

                                Hey Gavalakis!

                                I am very sorry that I have not looked at this before.

                                Priority Selector now looks very promising. We are going to improve AI in our game soon so I will definitely give it a try! Thank you so much!

                                #13324
                                Gavalakis
                                Keymaster

                                  You are very welcome and happy new year πŸ™‚ .

                                  Please let me know how the new Priority Selector works for you or if you find any more changes required.

                                  Cheers!

                                Viewing 15 posts - 1 through 15 (of 15 total)
                                • You must be logged in to reply to this topic.