Team/Faction Integration

Introduction
In a combat game, faction relationships are essential for determining allies and enemies. This distinction is particularly important during damage calculations, where it is necessary to differentiate between opponents.
Unreal Engine's built-in GenericTeamAgentInterface
is the mainstream interface for handling these enemy and ally relationships, and the AIController
implements this interface by default. Additionally, most built-in AI systems (such as the perception system) heavily rely on this interface.
Unfortunately, it is not exposed to Blueprints, and different projects typically need to implement the GenericTeamAgent
interface on other Actors.
To address this issue, GCS provides a solution that is pluggable. GCS does not force you to use it and offers an easy way to delegate this mechanism to other systems or your own implementations.
Design Diagram

Provided Interfaces and Components
GCS offers an interface: GCS_CombatTeamAgentInterface
.
This interface allows you to implement it on Actors or components using Blueprints/C++, enabling you to set and get the CombatTeamId
(which is of the Unreal built-in GenericTeamId
type).
Additionally, it provides a default implementation of this interface in component form: GCS_CombatTeamAgentComponent
.
Using the Interface
In all reference content provided by GCS, a static function called GetCombatTeamAgentInterface
is used to obtain the TeamAgentInterface
from an Actor (or its first component implementing the interface). This interface is then used to determine the relationship between two Actors, such as whether A can damage B or whether allies are filtered when acquiring targets.
Using the Component
Simply attach GCS_CombatTeamAgentComponent
to any Actor that coexists with the combat system component and sets its default TeamId
.

This component also provides events for team changes, allowing you to update the visual representation of weapons or character outfits based on team changes, such as distinguishing between red and blue colors.
The built-in weapon trace logic will use this component, so you need to set different TeamID
in order to make them hit each other.
Custom Implementation
If you prefer not to use the default component (for example, if you already have an AI system managing faction relationships), you are free to implement this interface on your other actors or components. It's very flexible.