Author: Luis Lugo Rosas
Posted: 3/27/2025
One of the biggest roadblocks I continue facing is getting Unreal Engine's Generic Team ID system to work correctly with my AI enemies. I had previously attempted to implement team-based behavior for AI perception, but it still wasn’t functioning as expected. The AI was detecting and reacting to all characters, including allies, instead of filtering out friendlies and only targeting enemies. This issue was particularly frustrating because it caused AI characters to attack the wrong targets and break immersion in combat scenarios. This problem could completely undermine the intended faction-based combat system. Enemies like Ghouls and the Lich are supposed to prioritize attacking the player, not each other. Without proper team differentiation, AI perception remains unreliable, making strategic gameplay elements impossible. Since other tasks weren’t blocking progress as much, I decided to revisit this issue and attempted to implement a proper fix this week.
After realizing that my Generic Team ID implementation wasn’t working, I tried an alternative approach by modifying the Behavior Tree directly. My idea was to use selectors to filter AI perception targets based on whether they were players or enemies. I set up a selector node to check if the perceived actor was part of the player's team before allowing an attack behavior to execute. However, despite these changes, the AI still failed to consistently differentiate between friend and foe, continuing to react to all detected actors without discretion. The issue likely stems from how AI perception components process stimuli before the behavior tree is involved. If the perception system itself isn’t correctly filtering out friendlies, then the behavior tree can’t apply the necessary logic effectively. While this approach didn’t work, it confirmed that the root of the issue lies deeper within the perception system or team setup, indicating I need to revisit the underlying AI perception configuration or the team interface itself. Until I find the right fix, this issue continues to prevent the AI from engaging in combat properly, leading to immersion-breaking moments where enemies attack the wrong targets or fail to react appropriately.
Did you like this post? Tell us