Announcement

Collapse
No announcement yet.

AI Templates (Blueprint)

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

  • AI Templates (Blueprint)

    Hi again Unreal Community!
    This new thread will be dedicated to AI project samples using Blueprint and Behavior trees.


    Update : 04/20/2017 (NEW)

    For new updates check out my website
    Click image for larger version

Name:	ue4rces.PNG
Views:	3
Size:	70.0 KB
ID:	1216864
    I- A.I Examples Template:



    AI Agents:

    1. Turret:

    • Detect the player within a certain range (Inside detection sphere) and rotate towards him
    • Attacking he player if the Line Trace hits him

    Two Attacks:

    • Projectile : Instant Damage
    • Electricity : Continuous Damage

    2. Search Light:

    • Patrolling randomly in the map
    • Chasing and dropping bombs on the player
    Damage type: Radial Damage

    3. Robot:

    • Patrolling between patrol points or randomly.
    • When player is in sight, the robot can Chase, shoot and kill him.
    • When a suspicious noise is heard, the robot will search for the suspect in differs location around noise location.
    Damage type (Projectile): Instant Damage

    Sensory systems

    • Custom using a Sphere Collision + Line Trace for Turrets
    • Pawn Sensing Component (Sight) for Search Lights
    • AI Perception Component (Sight and Hearing) for Robots

    AI Logic :

    • For turrets the whole logic is in the Turret Blueprint
    • For Search lights and Robots, the AI logic is build using AI Controllers, Blackboards, Behaviors Trees, Services, Tasks, Decorators...


    II- Blueprint Only AI Samples :





    AI Agents:

    1. Guard:

    • Patrolling between Target Points.
    • When player is in sight, the guard can Chase, shoot and kill him.
    Damage type (Projectile): Instant Damage

    2. Search Light:


    • Patrolling along a spline.
    • Detecting and chasing the player
    • Alerting the guard if the player is detected
    Damage type: No Attack

    Sensory systems

    • Guard :
    - Sight : Trigger Box + Line Trace
    - Touch : Capsule Hit
    • Search Light
    - Sight : Cone Mesh

    AI Logic :

    AI logic is located inside each agent Blueprint class

    III- Patrolling AI using Timers :




    A Simple Patrolling AI
    Updated using Timers and a Custom Sensory system for enemy detection
    Last edited by Mhousse1247; 04-20-2017, 02:25 PM.
    Website [ LINK ]
    Twitter [ LINK ]
    Support ! [ LINK ]

  • #2
    Update :
    - Some bugs Fixed
    - Dead link updated
    Website [ LINK ]
    Twitter [ LINK ]
    Support ! [ LINK ]

    Comment


    • #3
      [MENTION=355]Mhousse1247[/MENTION] - Great work man, these are really useful.
      Storyteller - An immersive VR audiobook player

      Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

      Comment


      • #4
        can they be used in 4.13?
        i know, i should jsut DL and find out, but, im at work lol
        Founder and CEO of Angry Penguin Studio, LLC
        Dallas, TX USA
        https://www.facebook.com/AngryPenguinStudios

        Comment


        • #5
          Originally posted by n00854180t View Post
          [MENTION=355]Mhousse1247[/MENTION] - Great work man, these are really useful.
          Thanks !
          Website [ LINK ]
          Twitter [ LINK ]
          Support ! [ LINK ]

          Comment


          • #6
            Originally posted by Angrytoilet View Post
            can they be used in 4.13?
            i know, i should jsut DL and find out, but, im at work lol
            There are just 2 or 3 nodes to fix , but generally it work !
            Website [ LINK ]
            Twitter [ LINK ]
            Support ! [ LINK ]

            Comment


            • #7
              yeah - i had to replace the handle clears to the new ones and swap to my own character BP .. super easy ..

              just cant get him to walk around on my nav is all .. working on it now.


              edit:

              forgot i deleted my waypoint lol .. woops
              working on getting the detection to work. i think couple of the nodes dropped from the transfer ... will update when i get it working

              Edit:
              Walking around from waypoint to waypoint without issues (unless i stand in front of the bot and block, haha, that big dummy ...) but i cant seem to get the bot to "notice" the player. Still working on it.

              9/17 edit:
              Looks like the issue standing in my way is reported from the AI BP itself. The change to "Cast to PlayerCharacter" for the overlap node .....
              "Player Character" does not inherit from "Primitive Component"; cast would always fail.

              I assume this is something "wrong" with my player character itself, so, i looked over it all and i cant see any reason why i would be getting this. Any ideas?

              EDIT/UPDATE:

              Got it working - i connected the nodes from "other" (and not overlap) to the "cast to player" and it works 100% fine. Sheesh .. its that late-night sleepy blueprinting that gets me every time!

              This works REALLY great in 4.13 ... very fast and, dare i say, 0 change in FPS/CPU .. amazing work sir!
              Last edited by AP_Studios; 09-17-2016, 10:59 PM. Reason: update
              Founder and CEO of Angry Penguin Studio, LLC
              Dallas, TX USA
              https://www.facebook.com/AngryPenguinStudios

              Comment


              • #8
                WOW thankyou for this! you are awesome!

                Comment


                • #9
                  Originally posted by frostic View Post
                  WOW thankyou for this! you are awesome!
                  glad it helped !
                  Website [ LINK ]
                  Twitter [ LINK ]
                  Support ! [ LINK ]

                  Comment


                  • #10
                    Updated to 4.13
                    Website [ LINK ]
                    Twitter [ LINK ]
                    Support ! [ LINK ]

                    Comment


                    • #11
                      Timer issue fixed !
                      Website [ LINK ]
                      Twitter [ LINK ]
                      Support ! [ LINK ]

                      Comment


                      • #12
                        I had an issue with the Robot in the AI Blueprint, when he shoots at player, his projectile is colliding with the himself and not leaving his body, any idea on a simple collision setting on the robot? Not sure what would fix this, I am on a Mac, not sure if this would matter.

                        Comment


                        • #13
                          Thank you so much for the AI templates, I think I am beginning to grasp how to make the AI react smoothly to changes...

                          Comment


                          • #14
                            When i begun with AI i used your older example without BTree. Recently tested the new example with BTree, and i have to say that this is a very good setup, easy to follow code, with some nice features. Thanks for sharing, learned a lot, and no longer afraid of BTree's

                            Twitter | Facebook | YouTube | IndieDB

                            Comment


                            • #15
                              Originally posted by unit23 View Post
                              When i begun with AI i used your older example without BTree. Recently tested the new example with BTree, and i have to say that this is a very good setup, easy to follow code, with some nice features. Thanks for sharing, learned a lot, and no longer afraid of BTree's
                              Glad it helped !
                              I wasn't a big fun of behavior tree , I always liked to write my own logic.
                              I opened BT the first time after 2yrs of using ue4 , It was a litle tricky the first week , but after the process is straightforward
                              Website [ LINK ]
                              Twitter [ LINK ]
                              Support ! [ LINK ]

                              Comment

                              Working...
                              X