Announcement

Collapse
No announcement yet.

UDK Bot AI not working correctly

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

    UDK Bot AI not working correctly

    Hi all,

    I'm making a simple level to learn bot AI. I've managed to spawn a bot and have it move around and shoot at me but when I add more bots to the factory they seem to mess up.
    What is happening is when the bots come across the same path node the one that is spawned second will stop doing anything and stay put on the node whereas, the other bot will continue to do whatever. This will happening with every other spawned bot if there is already a bot spawned before it.

    What I'm asking is why is this happening and how can I go about fixing it?

    EDIT:
    Screenshot 1

    Enemies are spawned once the player is spawned, Add each enemy to a list, upon death they are removed from the list. When enemies = 0 a boss enemy(Need to modify health), Once dead a box in the middle is destroyed.
    Below is spaghetti junction, a loop which moves the bots to a different pathnode at each interval.



    Screenshot 2

    The bot will first look for the player, if in sights will shoot, if not will stop shooting.



    Hope this helps

    #2
    Anybody? I've still not fixed this :/

    Comment


      #3
      Perhaps you didn't get a reply because your description is somewhat vague. Its customary to post Kismet screenshots along with the properties window. There's a lot of settings and things to get right, more so with pathnodes because there's there several gotchas.. For example what's your settings for Deathmatch AI, PlayerClass, and what is the maximum distance between the pathnodes and the bots....? I've helped with similar questions recently,. Do an advanced forum search and take a look at the links I gave others... Also, try to specify game type and build and mention anything else that is custom...

      Comment


        #4
        I can only give some ideas to fix
        Have you tried to add more Factories instead of only one or spawn bots in a different way?
        Or maybe add some more pathnodes.

        Comment


          #5
          Did you put all the bots in the same team, for example, 255? If they are in different teams, some behaviors can be messed up because the bots can conflicts the behaviors. Is there any screenshot of your Kismet?

          Comment


            #6
            Originally posted by frankit View Post
            Perhaps you didn't get a reply because your description is somewhat vague. Its customary to post Kismet screenshots along with the properties window. There's a lot of settings and things to get right, more so with pathnodes because there's there several gotchas.. For example what's your settings for Deathmatch AI, PlayerClass, and what is the maximum distance between the pathnodes and the bots....? I've helped with similar question recently,. Do an advanced forum search and take a look at the links I gave others... Also, try to specify game type and build and mention anything else that is custom...
            Ah sorry, I'll put some screenshots in the first post to better help .
            I don't know my settings for Deathmatch, My Pathnodes have a short distance between them.


            Originally posted by Ganga View Post
            I can only give some ideas to fix
            Have you tried to add more Factories instead of only one or spawn bots in a different way?
            Or maybe add some more pathnodes.
            I have too many pathnodes in the first area . As for another factory I never thought of that, I'll give it a go.

            Originally posted by AmyP View Post
            Did you put all the bots in the same team, for example, 255? If they are in different teams, some behaviors can be messed up because the bots can conflicts the behaviors. Is there any screenshot of your Kismet?
            They are on the same team, Screenshots in main post.

            Comment


              #7
              1. Are you using the Deathmatch AI setting in the Actor Factory, are you using UTPawn, are you leaving Player Class empty?..
              2. Are you using Pylons or Pathnodes solely?
              3. What's your game type: World Properties -> Default Game type / Game type in PIE?

              Comment


                #8
                Ok I'll assume you're using UTGame with the UTPawn class, and Deathmatch AI unchecked and PlayerClass left blank in the Actor Factory...

                What the screenshot doesn't show is the exact inputs to Move To Actor and that's often where the problem is... But lets assume you're supplying the correct Bot object reference lets call it Bot2 for simplicity, as Bot1 is working as expected. So if Bot2 is getting stuck, we need to look at the next path node, not the one its getting stuck at, but the pathnode that is being set as the next destination with Move To Actor. So how far away is that pathnode? And is it being selected dynamically from an object list? i.e. Are there multiple simultaneous paths for the bots to travel in your level?

                For example, where there are multiple paths, and not just linear pathnodes between small rooms / tight spaces I assign the pathnodes to an object list as per player objects, and then use a loop with Get Distance, to pull out the closest next pathnode for the Bot to route to next, a node that is also in the direction of the player. But I check the distance first though, using Get Distance, because if the pathnode is too far then the Bot will get stuck, which is exactly what you described in the original post... This is the logic that's missing from your kismet above, and so it makes it difficult to see what's going on. Using a second actor factory might help troubleshoot this, so just spawn two bots for the moment, one per factory.

                But overall, unless you're working in small rooms or tight spaces or on-a-rail, I wouldn't use this approach at all. Instead I would use Pylons, and have the Bot chase the player directly by attaching an object to them that can then be fed into Move To Actor, forgoing pathnodes entirely. Why is this better? Because the Bot doesn't need to follow pre-assigned paths, and so it makes the gameplay less scripted and less staid on repeat!

                For example, you can attach a DynamicTriggerVolume to the player, and then pass that as an input to Move To Actor. Its more reliable as you control the Bot movement directly via player movement. It works best in open levels. But overall, the layout of the level is key to how successful the AI will be, and you haven't said anything about that...So if you don't like this option or still cant get Bot2 working, then why try enabling 'Deathmatch AI' and disable move to actor and the fire loop and see how you get on in the level you have... After, you'll have more clues as to the next strategy...

                Comment


                  #9
                  Originally posted by frankit View Post
                  1. Are you using the Deathmatch AI setting in the Actor Factory, are you using UTPawn, are you leaving Player Class empty?..
                  2. Are you using Pylons or Pathnodes solely?
                  3. What's your game type: World Properties -> Default Game type / Game type in PIE?
                  1) No, Yes, Yes.
                  2) Pathnodes only.
                  3) Gametype is UTGame

                  Originally posted by frankit View Post
                  Ok I'll assume you're using UTGame with the UTPawn class, and Deathmatch AI unchecked and PlayerClass left blank in the Actor Factory...

                  What the screenshot doesn't show is the exact inputs to Move To Actor and that's often where the problem is... But lets assume you're supplying the correct Bot object reference lets call it Bot2 for simplicity, as Bot1 is working as expected. So if Bot2 is getting stuck, we need to look at the next path node, not the one its getting stuck at, but the pathnode that is being set as the next destination with Move To Actor. So how far away is that pathnode? And is it being selected dynamically from an object list? i.e. Are there multiple simultaneous paths for the bots to travel in your level?

                  For example, where there are multiple paths, and not just linear pathnodes between small rooms / tight spaces I assign the pathnodes to an object list as per player objects, and then use a loop with Get Distance, to pull out the closest next pathnode for the Bot to route to next, a node that is also in the direction of the player. But I check the distance first though, using Get Distance, because if the pathnode is too far then the Bot will get stuck, which is exactly what you described in the original post... This is the logic that's missing from your kismet above, and so it makes it difficult to see what's going on. Using a second actor factory might help troubleshoot this, so just spawn two bots for the moment, one per factory.

                  But overall, unless your working in small rooms or tight spaces or on-a-rail, I wouldn't use this approach at all. Instead I would use Pylons, and have the Bot chase the player directly by attaching an object to them that can then be fed into Move To Actor, forgoing pathnodes entirely. Why is this better? Because the Bot doesn't need to follow pre-assigned paths, and so it makes the gameplay more dynamic, more active and less staid on repeat!

                  For example, you can attach a DynamicTriggerVolume to the player, and then pass that as an input to Move To Actor. Its much more reliable, and much more effective as you control the movement process directly. Overall, this works better for open levels. But the layout of the level is key to how successful the AI will be, and you haven't said anything about that...So if you don't like this option or still cant get Bot2 working, then why try enabling 'Deathmatch AI' and disable move to actor and the fire loop and see how you get on...
                  The pathnodes are close together and they are not in an objectlist.
                  I've used two factories and the bots both spawn and run around the area. The thing is they seem to be following certain pathnodes and then stopping at that node for some reason
                  My area at the moment is open space with pillars for cover.
                  The option to attach a triggervolume to the player seems like a good idea
                  I have used the Deathmatch AI however I wanted it so all the bots would target the player and not each other

                  Comment


                    #10
                    Deathmatch AI can still be used once they are on the same explicit team i.e. Team Deathmatch, so experiment with that... Maybe the pathnode height is an issue after rebuilding paths, it wouldn't be the first time... Make sure there's no collision issues either with landscapes or a mesh that's blocking the pathnode... Open space? Definitely drop path nodes and use Pylon and a DynTrigger, its much more interesting and far less scripted.

                    Comment


                      #11
                      I'll try the things you suggested in the morning. One other question, When I kill the bots spawned from the first factory after they die I get this message: Kismet Warning: Obj UTPawn has no handler. I believe this is to do with the trace loop still trying to work? If so how can I eliminate this warning?

                      Comment


                        #12
                        Exactly! I prefer 1, but both are used!

                        1. IsAlive node
                        2. Use Compare Object node with inputs BotEnemy1, <empty object variable>

                        Comment


                          #13
                          OK so I tried the isAlive node and it worked fine as soon as I found where to put it in the sequence.
                          I've had a go at changing the bots ai, I now have it following me via a dynamic volume. The thing is the bot will shoot only 3 shots and then stop shooting entirely. Any ideas?
                          Secondly, How can I modify the bots movement speed or make it stop at a certain distance from me? As he just runs into my face . Infact while typing this I could change the volumes distance from me instead? I guess that could work.

                          Comment


                            #14
                            I've now made more attempts at adjusting this sequence but nothing has changed.
                            What I thought to do was attach volume to player, then while the bot(s) is chasing the player get their distance, if they are too close E.g. 100 units then reduce the bots speed.
                            I also figured, why not try a touched event with the volume instead? Nope nothing changes.
                            I'll post a screenshot to show what I did.

                            Any help?

                            Comment


                              #15
                              If the Bot behaves mysteriously i.e. stops firing after 3 shots, then start adding Log nodes at each at the crucial junctions, as it will build up a script log in the console window telling you what's going on. You can use Freeze / Unfreeze to stop the Bot once it gets close enough. You can use Modify Property with AccelRate to alter the speed. So either slow the Bot down the closer it gets, or increase the players speed, or use Freeze / Unfreeze... You can forward offset the attachment of the DynTrigger so the Bot won't run into your face...

                              Comment

                              Working...
                              X