Sort GOs by BB variable(Linq ?)

Forums 💬 NodeCanvas ⚙️ Support Sort GOs by BB variable(Linq ?)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #18657
    emmcd333@gmail.com
    Participant

      How would I best go about creating a task which would sort a target list by one of its’ BB variables? I was thinking Linq but wasn’t sure how you would structure in a new task.

      Thanks for all the response.

      #18662
      Gavalakis
      Keymaster

        Hello,

        Can you please provide some more information like an example of what you mean? Maybe an example pseudo code. Cause I am not really sure what you mean and maybe I misunderstand the goal.
        I will provide you the final task shortly after 🙂

        Thanks!

        #18661
        emmcd333@gmail.com
        Participant

          Sure thing. The scenario would be that a series of GOs are entered into a List based on some criteria, say a Tag. They would be the opposition. They would have a BB variable of ‘threatLevel’ which I would have conjured up. Yes, you could grab individual variables, but, what is being developed is an RTS AI based where there is primary input is not keyboard related and decision making is in larger data sets.

          What I think would be a versatile addition, then, would be addition at least a secondary sort criteria sounding like ” OrderBy, then OrderBy”. Adapted from the Distance sort task, this would Linq sort by other GOs’ BB variables.

          #18660
          Gavalakis
          Keymaster

            Hey,

            So it’s a list of GameObjects where each of those gameobject’s have a blackboard attached and you want to order the list by one of the blackboard variables attached to those gameobject blackboards?

            Let me know if I get that right 🙂
            Thanks.

            #18659
            emmcd333@gmail.com
            Participant

              Yeah, it would good to have the option to add additional sort keys. Probably, we could just extend with a customization based upon what the syntax and handling looks like, but basically you’ve got it. I attached a little Excel thing with an explanation of why and where we are going with this. I really think it would be useful for any who are complex data sets in decision making.

              Thanks, guy.

              Primary Key Secondary Key Tertiary Key
              targetList
              Contents threatLevel speed position
              GO1 65 10 some Vector
              GO2 100 0 some other Vector
              GO3 90 5 etc.
              GO4 20 20 etc.

              So, what I would do with this after identifying the targetList contents
              would be able to discriminate that while GO2 is the most powerful
              perhaps GO4 is the real threat based on some data set. Where I want
              to go with this is exploring fuzzy logic at certain game events for higher level
              decision making in a command & control hierarchy. I want to have GO’s
              as autonomous decision makers as much as is feasible. The end object for prototype
              and first demo is the game playing against itself.

              #18658
              Gavalakis
              Keymaster

                Hello again,
                Could this be something like what you are after:

                This basicaly orders a list of blackboards based on some variable name and type T, then saves the sorted list of the gameobjects to a new variable.

                Let me know.

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