Announcement

Collapse
No announcement yet.

AI not working in Development/Shipping Build

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

    AI not working in Development/Shipping Build

    I have a custom AI character set up using AI Perception. The game works perfectly fine when i PIE, but when I build the game, None of the AI characters move. I know it isn't a NavMesh issue, because when the AI sees the player, It actually switches to "chase" state and follows the player.

    When I turn on AI debugger, and Perception visualiser, It doesn't seem to be the correct radius and it's located at 0, 0, 0.

    Is there any additional setting or option before building?

    Twitter | UE4 Marketplace

    #2
    Make sure your AI possession rules are correct.

    In the Pawn class defaults, check out possession rules: "Placed in world", "Spawned" or "Both". Set it to "Both".
    [Released] Multiplayer Combat Editor
    A-RPG Sacred Swords
    Auto-Chess Live Development
    Youtube Tutorials

    Comment


      #3
      Originally posted by Yun-Kun View Post
      Make sure your AI possession rules are correct.

      In the Pawn class defaults, check out possession rules: "Placed in world", "Spawned" or "Both". Set it to "Both".
      I set it on "Both" but it still doesn't work. I don't think it's a possession issue, cuz the AI does react to Stimulus from the Player.

      Twitter | UE4 Marketplace

      Comment


        #4
        Is any of the components / functions used by your AI contained in a plugin?

        Is the plugin properly added to the list of dependency modules in your Target.cs cpp file (if you have one)?

        If you have plugin components and no cpp file including it, I suggest your create a blank cpp class just to generate a Target.cs file in order to include your plugins.
        [Released] Multiplayer Combat Editor
        A-RPG Sacred Swords
        Auto-Chess Live Development
        Youtube Tutorials

        Comment


          #5
          Originally posted by Yun-Kun View Post
          Is any of the components / functions used by your AI contained in a plugin?

          Is the plugin properly added to the list of dependency modules in your Target.cs cpp file (if you have one)?

          If you have plugin components and no cpp file including it, I suggest your create a blank cpp class just to generate a Target.cs file in order to include your plugins.
          I'm not using any plugin in my project. Also it's all blueprints, I know nothing about cpp. I came across this post which claims that "Get Blackboard Value as..." doesn't work in dev/shipping build.

          https://answers.unrealengine.com/que...but-not-s.html

          Not sure how else to get blackboard values in Blueprints if that is actually the case

          Twitter | UE4 Marketplace

          Comment


            #6
            I have no leads anymore.

            You need to find out what is the problem in order to know how to fix it.

            To find this out you have to isolate systems from one another and gather feedback about the state of your logic to understand what is causing the issue.

            To me, you need to add print strings to your logic and enable it in your build (to enable it simply built in Development mode, which should be your default build mode anyway I suppose).

            Add a print string that triggers whenever pawn sensing is updated.
            Deactivate anything but movement, then pawn sensing, then attacking or whatever logic you have. I'd suggest to deactivate everything but the pawn sensing and movement logic, to see if anything you just deactivated was actually preventing it from working as it should.

            I also need more information about the behavior you're expecting to have and the behavior you're actually getting right now.
            [Released] Multiplayer Combat Editor
            A-RPG Sacred Swords
            Auto-Chess Live Development
            Youtube Tutorials

            Comment


              #7
              Yeah, im going to step back and debug each state from the beginning. Looks more like a logic issue. Will share updates as i go. I pretty much followed the Advanced AI course on Pluralsight. But their project too works in PIE mode.

              Twitter | UE4 Marketplace

              Comment


                #8
                I haven't been able to find the actual issue, but I did notice that after the AI character sees the player and chases and attacks it, it actually goes back to the patrolling state and works normally as expected. It looks like there is something just stopping them from working when the level is loaded. I tried removing the Idle state all together so the AI starts off at Patrolling. And the debug info shows that it is in the Patrolling state, but they just don't move.

                Twitter | UE4 Marketplace

                Comment


                  #9
                  Originally posted by Yun-Kun View Post
                  I have no leads anymore.

                  You need to find out what is the problem in order to know how to fix it.

                  To find this out you have to isolate systems from one another and gather feedback about the state of your logic to understand what is causing the issue.

                  To me, you need to add print strings to your logic and enable it in your build (to enable it simply built in Development mode, which should be your default build mode anyway I suppose).

                  Add a print string that triggers whenever pawn sensing is updated.
                  Deactivate anything but movement, then pawn sensing, then attacking or whatever logic you have. I'd suggest to deactivate everything but the pawn sensing and movement logic, to see if anything you just deactivated was actually preventing it from working as it should.

                  I also need more information about the behavior you're expecting to have and the behavior you're actually getting right now.
                  Actually I just noticed that AI Perception doesn't work at all in the build.

                  Twitter | UE4 Marketplace

                  Comment


                    #10
                    Am I the only one having trouble getting AI Perception to work in a built game?

                    Twitter | UE4 Marketplace

                    Comment


                      #11
                      So, small update on the AI character not moving. The Auto Possess Pawn rule doesn't seem to work with "Placed in World" when I build the game. I tried spawning the enemy AI class in the level, and that worked fine in the built version. But I'm still having trouble getting AI perception component to work

                      Twitter | UE4 Marketplace

                      Comment

                      Working...
                      X