Announcement

Collapse
No announcement yet.

[Request] Behavior Trees - Simple Functions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Request] Behavior Trees - Simple Functions

    I was wondering if someone could walk me through a simple behavior tree setup. I have found tutorials out there but for whatever reason I am just not grasping this.

    As a control, I am using the 3rd person blueprint template so I am not doing and coding in C++.

    I simply want to take the existing player blueprint (Hero I think?) and turn him into a bot that can follow an array of way points. If he sees the player (using a bool "bPlayerSeen") he chases the player and if the bool is false he goes to the nearest way point and starts over. The final condition is that if touches the player it sets a bool to true ("bPlayerIsCaught").

    Is it possible that someone could walk me through this?

    Thank you
    Mike "Z"
    UI / Game Designer
    LinkedIn

    #2
    Hello,
    there are some tutorials ever in the forum that you can download and use which perfectly do the job. Mainly done by silentx. I tried them all this week with 4.3.1 and it was totally working. I did not try with 4.4 but you can check :

    https://docs.unrealengine.com/latest...art/index.html
    https://docs.unrealengine.com/latest...fer/index.html
    https://docs.unrealengine.com/latest...nce/index.html

    to learn how using behavior trees and having fun with AI

    Comment


      #3
      Thanks I will give this a try over the next few days.
      Mike "Z"
      UI / Game Designer
      LinkedIn

      Comment


        #4
        Hi again,
        i see that i forgot to link you silentx' s thread about behavior trees. check the aiproject, it does what you describe : https://forums.unrealengine.com/show...-amp-Flying-AI

        Comment


          #5
          So I followed the tutorial at: https://docs.unrealengine.com/latest...reeQuickStart/

          For the most part it seems like I made it through because I didn't get any errors compiling or running but the AI itself is not working. I have tried to follow everything down the blueprints and the behavior tree and for the most part it looks good but I do notice something not working right in the tree during simulation so I am going to include a screenshot.

          The two major differences are:
          1. I included this in an existing project so I had to use some different naming conventions.
          2. This was done in the 3rd person camera setup.

          Any insights on this would be great!

          Attached Files
          Mike "Z"
          UI / Game Designer
          LinkedIn

          Comment


            #6
            Anyone out there have any ideas where to start to look for these issues?
            Mike "Z"
            UI / Game Designer
            LinkedIn

            Comment


              #7
              For you information, I follow up those tutorial yesterday and I have similar problems (close enought don't work), but I left on side to work in other things.

              Comment


                #8
                From the screenshot you posted, it looks like neither TargetToFollow or TargetLocation are set (they are both 'None' in your blackboard view and the red indicator on their decorators indicates that they aborted). This in turn means that when your tree runs that none of its branches do anything.
                Tom Sarkanen | Unreal Engine Developer | Epic Games UK

                Comment


                  #9
                  Me I had a question about behavior trees !

                  I want to create a command where the AI will create some sort of wall to protect a tower. Keep in mind that I am doing this with C++ and a small portion of blueprints. I just need a little help getting this started and I am pretty sure I will be on my way.

                  I had in my something like if(ProjectCharacter.location <= DefenceDistance)
                  { AiController->MoveToLocation()}

                  Something along these lines however I am not entirely sure if this could work

                  Thanks in Advance !

                  Comment


                    #10
                    Originally posted by Tom Sarkanen View Post
                    From the screenshot you posted, it looks like neither TargetToFollow or TargetLocation are set (they are both 'None' in your blackboard view and the red indicator on their decorators indicates that they aborted). This in turn means that when your tree runs that none of its branches do anything.
                    What's confusing is that I did this twice from scratch with the same results... I am not sure where I did not set things right. Any thoughts on where I missed a step?
                    Mike "Z"
                    UI / Game Designer
                    LinkedIn

                    Comment


                      #11
                      Originally posted by mikezteh69 View Post
                      What's confusing is that I did this twice from scratch with the same results... I am not sure where I did not set things right. Any thoughts on where I missed a step?
                      It's possible you may have missed the channel setting in the visibility trace of your service BP, or maybe some other part that is preventing the Blackboard keys from being set. Perhaps you could post a pic of that BP?
                      Tom Sarkanen | Unreal Engine Developer | Epic Games UK

                      Comment


                        #12
                        Here are some shots of the other BP. I changed the BP name in this version.

                        Attached Files
                        Mike "Z"
                        UI / Game Designer
                        LinkedIn

                        Comment


                          #13
                          Sorry I should have been more clear, it is the 'AgroCheck' service BP that I was suggesting to check over, as that is the BP that sets the Blackboard entries that the behavior tree relies on.
                          Tom Sarkanen | Unreal Engine Developer | Epic Games UK

                          Comment


                            #14
                            Apologies. Have a look at these.
                            Attached Files
                            Mike "Z"
                            UI / Game Designer
                            LinkedIn

                            Comment


                              #15
                              The only difference I can see is that the sphere trace you are doing is using the same point for both start and end as you are not adding (0, 0, 15) as in the example, rather that value is (0, 0, 0) in your graph.
                              This means you are doing a zero-length sweep, which will not hit anything (the implementation ignores very small sweep lengths).
                              Tom Sarkanen | Unreal Engine Developer | Epic Games UK

                              Comment

                              Working...
                              X