Team Affiliation #
- Overview
- Core Concepts
- What is Team Affiliation?
- Use Cases
- Gameplay Tag Based System
- Components
- Gameplay Tag Component
- Affiliation Tags
- Setting Up Team Affiliation
- On Characters (AI/NPCs)
- On Player Controller
- On Player Character
- Checking Affiliation
- Is Affiliated Function
- Common Use Cases
- Integration with Other Systems
- Attribute Manager (Damage Prevention)
- Vendor System (Discounts)
- AI Behavior
- Example Implementations
- Call of Duty Style Teams
- RPG Faction System
- Dynamic Alliances
- How To Guides
- Setting Up Team-Based Shooter
- Setting Up Faction-Based RPG
- Creating Custom Affiliation Logic
- OVERVIEW
The Team Affiliation System is a lightweight, tag-based system that determines relationships between characters. It enables complex gameplay mechanics based on whether characters share affiliations.
Core Features:
- Gameplay tag based affiliation
- Works on Characters, Player Controllers, and AI
- Integrates with damage, vendor, and AI systems
- Simple to implement, powerful in application
- No complex team management required
Common Applications:
- Team-based shooters (Call of Duty style)
- Faction systems (RPG guilds, clans)
- Friend/enemy AI relationships
- Vendor discounts for allies
- Quest access based on reputation
- Multiplayer team coordination
The system uses Gameplay Tag Components to store affiliation tags. Characters with matching tags are considered affiliated.
Core concepts #
What is Team Affiliation? #
Team affiliation determines whether two actors (characters, players, AI) belong to the same group or faction.
Affiliation Check:
Actor A has tag: Team.Chaos
Actor B has tag: Team.Chaos
Result: Affiliated (same team)
Actor A has tag: Team.Chaos
Actor C has tag: Team.Order
Result: Not Affiliated (different teams)
Key Principle:
If two actors share at least one affiliation tag, they are affiliated. The system compares gameplay tag containers to determine this.
Flexibility:
Actors can have multiple affiliation tags:
Player has tags:
- Team.BlueTeam
- Faction.Merchant
- Guild.Blacksmiths
NPC has tags:
- Faction.Merchant
Result: Affiliated (both have Faction.Merchant)
This allows for complex relationships like alliances, guilds, and sub-factions.
Use Cases #
Team-Based Shooters (Call of Duty, Battlefield):
- Prevent friendly fire between teammates
- Shared objectives and spawn points
- Team-based scoring
- Enemy identification
RPG Faction Systems (Skyrim, Fallout):
- Guild memberships
- City allegiances
- Dynamic reputation
- Faction-specific vendors and quests
Multiplayer Coordination:
- Clan/party systems
- Raid groups
- PvP teams
- Alliance mechanics
AI Behavior:
- Friendly AI won't attack affiliated players
- Guards attack hostile factions
- Civilians flee from enemies
- Allies provide assistance
Vendor Integration:
- Discounts for faction members
- Exclusive items for allies
- Reputation-based pricing
- Guild shops
Gameplay Tag Based System #
The team affiliation system uses Gameplay Tags stored in Gameplay Tag Components.
Why Gameplay Tags?
- Flexible and extensible
- No hardcoded team IDs or enums
- Easy to add new factions at runtime
- Designer-friendly
- Network-replicated automatically
Tag Hierarchy:
You can organize affiliation tags hierarchically:
Team
├─ Team.BlueTeam
├─ Team.RedTeam
└─ Team.GreenTeam
Faction
├─ Faction.Empire
├─ Faction.Rebels
└─ Faction.Neutral
Guild
├─ Guild.Warriors
├─ Guild.Mages
└─ Guild.Thieves

Tag Matching:
The system checks for ANY matching tag between actors. Partial hierarchy matches work too (if configured in gameplay tag settings).
Components #
Gameplay Tag Component #
The Gameplay Tag Component stores affiliation tags for an actor.
Component Location:
Add the Gameplay Tag Component to:
- Player Controller: For persistent player affiliation (survives respawn, saved/loaded)
- Character: For AI/NPC affiliation or temporary player affiliation
- Any Actor: System works on any actor with the component
Tag Container:
The component contains a Gameplay Tag Container that stores all affiliation tags for that actor.
Adding Tags at Design Time:
- Select actor with Gameplay Tag Component
- Find Gameplay Tags section
- Add tags to container
Adding Tags at Runtime:

Replication:
The Gameplay Tag Component automatically replicates tags to clients in multiplayer, ensuring all players see correct affiliations.
Affiliation Tags #
Affiliation tags identify which team, faction, or group an actor belongs to.
Tag Naming Convention:
- Team Tags: Team.BlueTeam, Team.RedTeam, Team.Chaos, Team.Order
- Faction Tags: Faction.Empire, Faction.Rebels, Faction.Merchants
- Guild Tags: Guild.Warriors, Guild.Mages, Guild.Assassins
- Custom Tags: Any hierarchy you define
Creating Affiliation Tags:
- Open Project Settings → Gameplay Tags
- Create parent tag (e.g., “Team”)
- Add child tags (e.g., “Team.BlueTeam”, “Team.RedTeam”)
- Use these tags in Gameplay Tag Components
Multiple Affiliations:
Actors can have multiple tags for complex relationships:
Character Tags:
- Team.BlueTeam (main team)
- Faction.Military (faction)
- Guild.Snipers (specialization)
This character is affiliated with:
- All BlueTeam members
- All Military faction members
- All Sniper guild members
Setting up team affiliation #
On Characters (AI/NPCs) #
For AI characters and NPCs with static affiliations, add tags directly to the character blueprint.
Setup Steps:
- Open character blueprint (e.g., BP_Enemy_Chaos)
- Add Gameplay Tag Component (if not already present)
- In component details, add affiliation tags
- Example: Add “Team.Chaos” tag
When to Use:
- AI that belong to fixed factions
- NPCs with permanent allegiances
- Enemies in specific areas
- Static world characters
If the character dies and respawns, tags added to the character will persist. However, if you want tags to reset on death, handle this in your respawn logic.
BP_Enemy_Chaos:
- Gameplay Tag Component
- Tags: Team.Chaos
BP_Enemy_Order:
- Gameplay Tag Component
- Tags: Team.Order
Chaos enemies won't attack each other, but will attack Order enemies.

On Player Controller #
For player affiliations that should persist through death and be saved/loaded, add tags to the Player Controller.
Setup Steps:
- Open player controller blueprint (e.g., BP_PlayerController)
- Add Gameplay Tag Component (if not already present)
- Add affiliation tags in BeginPlay or when joining team
- Save/load tags with player data
When to Use:
- Multiplayer team assignments
- Persistent faction memberships
- Saved player allegiances
- Cross-session affiliations
Advantages:
- Survives character death/respawn
- Can be saved and loaded
- Persists across level transitions
- Easy to modify at runtime
On Player Join Server:
- Assign player to team (Blue or Red)
- Add corresponding tag to Player Controller
- Team.BlueTeam OR Team.RedTeam
- Tag persists until player leaves or changes team
Runtime Tag Modification:
Player joins Team Blue:
- Add Gameplay Tag: Team.BlueTeam
Player switches to Team Red:
- Remove Gameplay Tag: Team.BlueTeam
- Add Gameplay Tag: Team.RedTeam
On Player Character #
For temporary or respawn-reset affiliations, add tags to the player character.
Setup Steps:
- Open player character blueprint (e.g., BP_PlayerCharacter)
- Add Gameplay Tag Component (if not already present)
- Add affiliation tags
When to Use:
- Temporary disguises or infiltration mechanics
- Testing/debugging
- Single-player with no save system
- Affiliations that should reset on death
Tags on the character will reset when the character dies and a new character is spawned (unless you manually transfer tags).
Player wears enemy uniform:
- Add Tag: Faction.Enemy (to character)
- Enemies treat player as ally
- On death or disguise removal, tag is removed
- Player reverts to original faction
Choosing Player Controller vs Character:
- Player Controller: Persistent affiliation (recommended for most games)
- Character: Temporary affiliation or single-player without save system
Checking affiliation #
Is Affiliated Function #
The core function of the team affiliation system is Is Affiliated.
How It Works:
- Get Gameplay Tag Component from Actor A
- Get Gameplay Tag Component from Actor B
- Compare tag containers
- If ANY tag matches between containers, return true
- If no matching tags, return false
Attacker shoots Target:
- Check Is Affiliated(Attacker, Target)
- If true (same team):
- Prevent damage (friendly fire disabled)
OR
- Apply reduced damage (friendly fire enabled)
- If false (different teams):
- Apply full damage

Blueprint Implementation:
The function is available as a blueprint node and can be called from anywhere:
- Weapon logic
- AI behavior trees
- Damage calculations
- Vendor interactions
- Quest systems
Common Use Cases #
The team affiliation system provides the foundation for many gameplay mechanics. Here are some possibilities:
Friendly Fire Prevention:
On Apply Damage:
- Is Affiliated(Attacker, Victim)?
- If true → Block damage
- If false → Apply damage
This is implemented and used by the damage system to prevent friendly fire when enabled.
AI Target Selection:
AI looking for target:
- Get all nearby actors
- For each actor:
- Is Affiliated(Self, Actor)?
- If false → Valid target
- If true → Ignore (ally)
- Select closest valid target
This is implemented in AI behavior to ensure AI only targets non-affiliated actors.
Vendor Discounts (Example):
Player opens vendor:
- Is Affiliated(Player, Vendor)?
- If true → Apply faction discount
- If false → Standard prices
Quest Access (Example):
Player interacts with quest giver:
- Is Affiliated(Player, QuestGiver)?
- If true → Show faction quests
- If false → Show generic quests or deny access
Door/Area Access (Example):
Player approaches restricted door:
- Is Affiliated(Player, DoorFaction)?
- If true → Allow entry
- If false → Door locked
These are just examples of how you can use the affiliation system in your own implementations.
Integration with other systems #
The team affiliation system is designed to integrate with other gameplay systems. The Is Affiliated function can be called from any system to check relationships between actors.
Damage Systems:
Check affiliation before applying damage to implement friendly fire prevention or reduced friendly damage.
AI Systems:
Use affiliation checks in AI behavior trees to determine valid targets and allies.
Vendor Systems:
Implement faction-based pricing by checking if player is affiliated with vendor.
Quest Systems:
Gate quest availability based on player affiliation with quest givers.
Access Control:
Use affiliation to control access to doors, areas, or features.
The affiliation system provides the relationship data – you implement the specific behavior in your own systems.
Example implementations #
Call of Duty Style Teams #
Team-based multiplayer shooter with two teams.
Setup:
- Create gameplay tags:
- Team.BlueTeam
- Team.RedTeam
- On player join:
- Assign to team based on balance
- Add tag to Player Controller
- Implement friendly fire prevention in your damage system using Is Affiliated check
- Configure spawn points by team
Result:
- Blue team members are affiliated with each other
- Red team members are affiliated with each other
- Blue team is not affiliated with Red team
- Team identification in UI
Team Switching:
On Switch Team:
- Remove old team tag
- Add new team tag
- Respawn player at new team spawn
RPG Faction System #
Dynamic faction system with multiple guilds and reputations.
Setup:
- Create faction tags:
- Faction.Empire
- Faction.Rebels
- Faction.Merchants
- Guild.Warriors
- Guild.Mages
- etc.
- NPCs have static faction tags on their characters
- Player gains/loses faction tags through quests and actions
- Player Controller stores current faction tags
Dynamic Affiliation:
Player completes Empire quest:
- Add Tag: Faction.Empire
- Remove Tag: Faction.Rebels (if present)
Player joins Warrior Guild:
- Add Tag: Guild.Warriors
- Can stack with Faction.Empire
Implementation Examples:
- Use affiliation checks to determine AI hostility
- Implement faction-based vendor pricing
- Gate quest availability
- Control area access
How to guides #
Setting Up Faction-Based RPG #
Step 1: Create Faction Tags #
- Open Project Settings → Gameplay Tags
- Create faction hierarchy:
Faction
├─ Faction.Empire
├─ Faction.Rebels
├─ Faction.Merchants
└─ Faction.Neutral
Guild
├─ Guild.Warriors
├─ Guild.Mages
└─ Guild.Thieves
Step 2: Add Tags to NPCs #
- Open NPC character blueprints
- Add Gameplay Tag Component
- Add appropriate faction tags:
Empire Guard:
- Faction.Empire
Rebel Scout:
- Faction.Rebels
Merchant NPC:
- Faction.Merchants
Step 3: Add Component to Player Controller #
- Open BP_PlayerController
- Add Gameplay Tag Component
- Player starts with no faction (or default faction)
Step 4: Create Faction Join System #
- Create faction join quest/interaction
- On join faction:
Join Empire:
- Add Tag: Faction.Empire
- Remove any conflicting tags (Faction.Rebels)
- Save player data
Step 5: Implement Faction Benefits #
- AI Behavior: Use Is Affiliated to determine targeting
- Vendor Systems: Check affiliation for pricing
- Quest Systems: Check affiliation for quest availability
Step 6: Test Faction Interactions #
- Join a faction
- Verify faction NPCs are friendly
- Check enemy factions are hostile
- Test vendor discounts
- Verify faction quests appear
Creating Custom Affiliation Logic #
You can extend the affiliation system with custom logic beyond simple tag matching.
Check Affiliation with Reputation:
- Is Affiliated(Player, NPC)?
- If true:
- Get reputation level from player data
- Apply benefits based on reputation level
- If false:
- No benefits
Complex Affiliation:
- Check Is Affiliated(A, B)
- Additional checks:
- Both must be in same area
- Event flag must be active
- Time of day restriction
- Return combined result
This allows for context-sensitive affiliations beyond simple tag matching.
