EpicSurvivalGame icon indicating copy to clipboard operation
EpicSurvivalGame copied to clipboard

Added AI Perception implementation, removed Pawn Sensing.

Open saracen opened this issue 5 years ago • 2 comments

I've been working my way through your excellent Unreal Engine 4 Mastery: Create Multiplayer Games with C++ course recently and figured I'd try swapping out the Pawn Sensing implementation for an AI Perception one.

It works quite well. However, it's not without issues:

  • The stimulus max age functionality doesn't really work. I don't think this impacts this game too much, because you get a similar game play experience with LoseSightRadius, allowing you to shake off a zombie by running further away. You cannot check to see whether a stimulus has expired in OnTargetPerceptionUpdated unfortunately. It could be made to work by getting additional actor info on every tick. But... not ideal.
  • The hearing config uses bDetectFriendlies = true as a bit of a hack. Not using this doesn't detect you as an enemy, because for some reason the hearing sense differs from the sight sense in that it doesn't use the AI Controller's GetTeamAttitudeTowards. I think this is a bug in the engine.

I don't mind if this doesn't get merged, however, it'd be great if you could let me know if this implementation is correct. If it is, at the very least hopefully it'll save somebody else some time figuring out how to swap out Pawn Sensing :).

saracen avatar Jul 02 '18 06:07 saracen

Rebased for 4.20.

saracen avatar Jul 24 '18 23:07 saracen

FYI I'm keeping this around (but not merging as you mentioned as well) for others to look into when using AI Perception. As that framework was never updated by Epic (and I've had some issues with it) I am sticking to Pawn Sensing for the project itself. Maybe in UE5 we can see some improvements, then I'll re-consider.

tomlooman avatar Sep 02 '21 08:09 tomlooman