Every other part of my AI is rather smooth but the combat system lacks much. It stares at me instead of shooting when it first sees me through perception. the rotating back toward the player currently uses a MoveComponentTo for rotation that is awkward, there’s no strafing and I’m not sure to start with that. I’ve done an AimOffset before and I think I can figure it out here too. Not sure where to start when it comes to telling it to take cover. Anyone know a really good AI combat Tutorial?
So you’ve asked a couple things here, from what I gather:
- Combat lacks, which is subjective, though it sounds like the AI should shoot immediately on sight (correct?) - I don’t know how this tree runs exactly, but from the looks of it there are no abort priorities in place, which may solve the stutter.
- The BTS_IsPlayerInShootingRange - what does that bp graph look like?
- For Strafing, or essentially, to look at the player while moving is a slight more complex. One route could be a tick event on the ai controller which turns the pawn based on an interpTo cycle. Another could be animated based, since strafing means the lower body does something different than the upper body. These two could be coupled, where the lower body has it’s own slot to blend it’s animations for, while the top half continues to look at the player. The first methods would be far simpler to prototype.
- For awareness of environment, look more into the EQS system. It’s sort of like a more advance trace evaluator that can recognized collision aspects of the environment around it.
This would be a good place to review the concepts of and learn more about AI BT’s, it’s more recent and covers shifts in behaviors, EQS, and although there is not strafing, the information may lead you to a more definite area to look into. https://www.youtube.com/watch?v=iY1jnFvHgbE
1 Like