Question on the Suspicion conditions

When we set the LastSeenLocation, we use the Already existing EnemyActor, I guess this is ok, but the EnemyActor being unset on PerceptionUpdated event, wouldn’t that make the EnemyActor be none when we set the LastSeenLocation? I feel the LastSeenLocation should be set like fo 1 frame at the most, since the service will run every frame and when the player LOS the NPC, It will get set for a frame and then get unset on the next frame.

This is what I see on my game btw, So i’m setting up my behavior differently.

But I have to ask, does this works for you guys? Does the NPC does it’s suspicion round?

1 Like

Well, I found out why it does not work here, seems the LastSeenLocation really is set correctly, but gets unset the next frame (as I said). The thing is, when the behavior node is Observer aborts to none, then the NPC goes into the suspicion behavior, and complete it even if it’s invalid.

This design doesn’t feel good. I tried to set the LastSeenLocation based on the Stimulus, but I cannot find the rigth way to get to the value yet…

Also, Looking at the suspicion node, The NPC need to come chasing after me as soon as he seens me again, not after he wait to the Wait time set in the suspicion BT. That’s why I’d rather set the Observer aborts to Self.

Also, for the sake of argument, What if we don’t use the Actor at all to controler the direction of the chase? We could simply chase the stimuli location set in the NPC_AI_BP. This removes a variable and let us control the NPCs with vectors only.

I guess we can think of some games where the interaction is more than only chasing a subject. So maybe getting the Actor to interract with it more directly would be nice. But when chasing only the Actor location, Chasing the simuli should be enough?

1 Like

I ran into this problem myself and commented in another thread in this section. Maybe there’s a bug in 4.13.1 that allowed it to work for Sam but I have been using 4.25 and it really seemed like it couldn’t work.

The problem with using the AI Perception component that isn’t triggered on the perceive event is that the data will be gone. I couldn’t make it work no matter what, if it was triggered from a tick event. You can look at the “known actors” array but then you resolve the current player location and the AI can chase you without seeing you! Based on the debug information it seems that the last known location is saved somewhere but I couldn’t find it.

Ah, indeed. It’s fixed two lectures later as one of the bugs found in the logic.

Privacy & Terms