Friend or Foe? Problems with the Generic Team ID


Author: Luis Lugo

Posted on 03/14/2025

During the development phase of the AI agents, I encounter the problem that if I spawn 2 or more "enemies" into the scene they would just look at each other and follow each other around, mostly ignoring the player. This is obviously something we want to avoid moving forward because it definitely is game breaking and the player would no doubt be frustrated trying to engage with the game and the game behaving completely erratic.

My teammates pointed out that our AIController was in fact missing the Generic Team Id logic that takes care of handling how the AI behaves towards other actors in the world depending on their Team Id. I attempted to resolve the issue in the controller by getting the team id from the actors perceived by the Sight_Config component and handling the attitude towards them based on if the Id matches the same as the controller's pawn, it is friendly, if the controller matches the Id given to the player (let's say 1),  it is hostile, and if does now match either then it is neutral. As of now I am still coming up with a solution since I've hit a wall trying to set the Team Id on the Agents and Player's classes. 

Leave a comment

Log in with itch.io to leave a comment.