Need help with Logic of NPCs for choosing a target

Forums πŸ’¬ NodeCanvas βš™οΈ Support Need help with Logic of NPCs for choosing a target

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16471
    xood
    Participant

      Hello!

      Tell me how to correctly implement the logic of NPCs for choosing a target.

      I have my npcController and npcModel classes. The scenes in the project are small. The number of NPCs in the scene is 10-15. I have a class – manager, which contains two lists of NPCs (two fractions):

      List <NPCController> enemies

      List <NPCController> friendly

      I implemented a custom task to verify that the NPC sees an enemy target (checking distance, viewing angle and raytrace). Based on the result of the check, I fill out for each NPC a list of enemies that he sees:

      List<NPCController> iSeeNPC

      How do I use BT to correctly build a goal selection from a list? For example, I want to choose a goal with a minimum level of health. The problem is that I can’t sort out the List of NPCConttoller in BT – of all the actions, I can only work with lists of objects from the unity set (GameObject, Transform etc)

      Make separate lists for transform npc, life npc etc. – in my opinion is wrong.

      If I will create a new custom task for this and next actions, then I will lose the benefits of BT.

      Can I work in BT with my NPCConttoller classes in the same way as with Transform, GameObject, etc. classes?

      Or do I need to change my approach to creating logic AI?

      #16473
      xood
      Participant

        I posted my question also in discord. If the answer is there sooner, I will copy it here.

        #16472
        xood
        Participant

          The solution turned out to be very simple. I should have read the documentation carefully πŸ™‚

          You can add your own custom types to work in the tree: https://nodecanvas.paradoxnotion.com/documentation/?section=working-with-custom-types

           

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