Home Unreal Engine

I cant get NPC behaviour right UE 5.3

polycounter lvl 9
Offline / Send Message
Pinned
iffytecnoid polycounter lvl 9
I´ve been trying for the NPC to attack these crops for a while. Before I had the model to work with I was using a cube, and that seemed to work well, but now that´s set up with something more alike to the final result they seem to fail to attack most of the time, sometimes 1 NPC will do attack, but rarely. I tried changing the size of the sphere trace but that didn´t really work. I tried changing the acceptance radious for when the NPCs move to the food, didn´t change anything. Maybe it´s something on the behaviour tree? I´m at a loss. Any help would be tremendously appreciated.

Here is a video showcasing the issue a little: https://youtu.be/0S-itRcVgH4

Replies

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    its quite hard to follow what's going on in the video to be honest

    i dont think you have much choice but to chuck some breakpoints in the BPs and identify which test is failing - it's probably a lot easier when there aren't 50 NPCs trying to do it all at once 
  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
    code related questions like this are probably best for the unreal forums if you didnt ask there already

    if you had it working before, rather than guess at things its usually easiest to revert back to when it was working
    you can just make a feature branch from that point
    can duplicate the project so that you can step through the working code node by node and have the broken project on other screen. easiest to spot what the difference that way. 

    if you aren't using some form of version control so you can't do that, you should feel a great sense of shame. 

    one thing helpful to do whenever using the AI move to nodes is to put print strings on all of the execution outputs and print out the movement result enums. you might find that it is failing for some reason and thus the success never fires. 

    IMO regular blueprints are a lot easier to deal with than blackboard/BT and EQS. I quit using behavior tree because it's just too many moving parts to deal with when you can get same result in a single blueprint graph. 
  • iffytecnoid
    Offline / Send Message
    iffytecnoid polycounter lvl 9
    poopipe said:
    its quite hard to follow what's going on in the video to be honest

    i dont think you have much choice but to chuck some breakpoints in the BPs and identify which test is failing - it's probably a lot easier when there aren't 50 NPCs trying to do it all at once 

    You are right. Only one works just fine though, the moment I set up 2 guys only 1 will attack.
  • iffytecnoid
    Offline / Send Message
    iffytecnoid polycounter lvl 9
    Alex_J said:
    code related questions like this are probably best for the unreal forums if you didnt ask there already

    if you had it working before, rather than guess at things its usually easiest to revert back to when it was working
    you can just make a feature branch from that point
    can duplicate the project so that you can step through the working code node by node and have the broken project on other screen. easiest to spot what the difference that way. 

    if you aren't using some form of version control so you can't do that, you should feel a great sense of shame. 

    one thing helpful to do whenever using the AI move to nodes is to put print strings on all of the execution outputs and print out the movement result enums. you might find that it is failing for some reason and thus the success never fires. 

    IMO regular blueprints are a lot easier to deal with than blackboard/BT and EQS. I quit using behavior tree because it's just too many moving parts to deal with when you can get same result in a single blueprint graph. 
    I posted it both here and there. I´ll try what you recommended, thanks!

  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
    if one agent is working but others are not I think that suggest a communcation / reference problem more than an execution flow problem. In other words, there is probably a link between your behavior and what actors that it drives somewhere and this is not setup appropriately. 
Sign In or Register to comment.