Announcement

Collapse
No announcement yet.

Quick AI Perception Jumpstart

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

    Quick AI Perception Jumpstart

    So I know that there are a couple of people who will be doing more in depth tutorials in the next few weeks but until then I thought I would share how to do a simple setup to get the new AI Perception system up and running in Blueprint. Also if you want c++ follow this link: https://forums.unrealengine.com/show...Jumpstart-(C-)

    (Note this is done in 4.7.5)
    1. So to start in the controller you want click Add Component and add an AIPerception Component
    2. Now setup your Sense (this will be what detects stuff) a)Add a new config with type AI Sight config (or whatever you want to use) b) Set the stuff for sight radius and angle (or hearing if your using that)
    3. Now under Events in the AIPerception Component hit add event. From there you can do stuff when your character detects stuff. The UpdatedActors array is an array of all Actors that it finds.
    4. So how does it find something? All you have to do is go into the actor or pawn or whatever and in the Begin Play add a Register Perception Stimuli Source node with the class being the type of sense you want to register (just do multiple nodes if you want to use multiple senses) and then set the target to self.

    Click image for larger version

Name:	AIStuff1.png
Views:	1
Size:	187.7 KB
ID:	1148152

    Click image for larger version

Name:	AIStuff2.png
Views:	1
Size:	45.9 KB
ID:	1148153

    And that's it, your done! If you AI can see anything registered it should fire the event and you can do stuff accordingly. Let me know if this was helpful or if you have any questions!

    Edit: So idk if this will affect everyone but if your having a lot of crashes check this post out: https://answers.unrealengine.com/que...rce-issue.html

    Thanks,

    -Chris
    Last edited by ckchessmaster; 04-20-2015, 01:49 PM. Reason: Added link to possible bug

    #2
    Hi Chris, I've just started working on the A.I. perception system and I have a doubt here. The 'Register Perception Stimuli Source' should be placed in the blueprint of the actor that needs to be detected by the A.I. right?
    Unreal Possibilities
    Wave Spawning System | Tower Defense Starter Kit | Grid Creation Systems

    Comment


      #3
      Yes thats correct. So in my case since I put it inside of my ai unit.

      Comment


        #4
        Thanks, I've got it working. But I think there are still some bugs with the perception component. I'm getting a lot of crashes when using it.
        Unreal Possibilities
        Wave Spawning System | Tower Defense Starter Kit | Grid Creation Systems

        Comment


          #5
          Awesome, yeah especially in the blueprint side of things. The c++ version is a bit more stable but even still it has bugs. I'm actually having quite a bit of trouble using my own setup haha. Just sort of comes with it being so new and unused I guess. If you find any kinds of bugs that are easily reproducible be sure to post it to answerhub so that MieszkoZ can find them easier.

          Comment


            #6
            I have done as described here: Added an AI perception component to the controller of the actor that should perceive others. Then I added a perecption stimuli component to the other actors that I want to perceive by the first actor. Then in the OnPerceptionUpdated event (in the perceiving actor controller, where the AI perception component is) I simply print out a string.

            However, when I run the game and a perceivable actor (with stimuli component) enters the sight radius of the perceiver, then nothing happens, nothing is printed.

            Any ideas what I might be missing?
            Modular Menu System @ UE4 Marketplace: "Build your UMG Menus in Minutes!"
            Marketplace Page | General Discussion | Support Thread | Preview Video

            Comment


              #7
              I have tried to implement Ai Perception as above but everything in 2a in the above image is disabled. I have tried with a Pawn and Character blueprint class and in their respective controllers all to no avail.

              Any advice would be most welcome.

              Thank you.

              Comment


                #8
                Hi guys.

                I am doing FPS AI at the moment which requires a possibility of 40-50 bots in one world.

                I am extremely interested in this system. Currently I am doing my own visibility manager since the old AISensing isn't giving me the performance I need.
                I'd like to ask some things about this new system if you're familiar enough with it.

                1) is it possible to customise the perception manager to it only sense from an array of units.
                2) Is it possible for AI to share certain awarenes ( such as visible enemies )? This is so that AI will ignore the process of these already detected stimuli.
                Developer at AmmoboxStudios.



                Eximius ( An FPS/RTS Hybrid )

                Comment


                  #9
                  I don't know why but my "AI" section is grayed out for some reason i'm not able to set the hearing range or the sight radius. Why is this? I'm able to set the senses config stuff though

                  Comment


                    #10
                    I found out the grey section automaticly updates if you update anything in teh sense section, there is a drop down beside the specific sense config

                    Comment


                      #11
                      This is how I did (it works but I had to tick the check boxes in red), the upper and grayed out section never got available but it stills works!

                      Click image for larger version

Name:	Captura.PNG
Views:	1
Size:	55.7 KB
ID:	1102217

                      Comment


                        #12
                        Originally posted by osakaro View Post
                        This is how I did (it works but I had to tick the check boxes in red), the upper and grayed out section never got available but it stills works!

                        [ATTACH=CONFIG]82983[/ATTACH]
                        This is exactly what my settings look like now and the AI section is grayed out. Checking those boxes makes no difference. Anyone know how to get it working?

                        Comment


                          #13
                          you dont need the upper and grayed out section when you have the lower and specifics ones

                          Comment


                            #14
                            I got sight and hearing to work, did you get touch to work, for some reason I can't?

                            Comment


                              #15
                              We wrote a tutorial about this : http://isaratech.com/ue4-ai-percepti...timuli-source/

                              Comment

                              Working...
                              X