Chat System #
The Chat System provides in-game text communication between players. It supports multiple message categories (global, team, party, private), server-side validation, and UI features like mute/unmute, player list, and console command auto-completion.
Key Features:
- Send messages via a UI text input box
- Message categories: Global/All chat, Team chat, Party chat, Private messages (whisper)
- System messages (broadcast to all players)
- Server-side message validation and distribution (recipient filtering)
- Console command integration for team/party/private messaging (slash commands)
- Mute/unmute specific players (non-persistent, session-only)
- Player list with toggle button (UI panel for selecting whisper targets)
- Auto-completion for console commands
- Clear chat functionality
Use Cases: – Team coordination in multiplayer games – Private messaging between players – System announcements and notifications – Moderated chat with profanity filtering and rate limiting (optional, extensible)

2. Core Concepts #
- Chat Manager (AC_GameState_Chat_Manager_Advanced): Server-side component that manages message distribution, validates messages, and filters recipients based on message category.
- Chat Communicator (AC_PlayerController_Chat_Communicator_Advanced): Client-side component that translates user input into server RPC calls and displays received messages in the UI.
- Message Categories: Different communication channels (global, team, party, private, system). Each category has different recipient filtering rules.
- Recipient Filtering: The Chat Manager ensures messages are only sent to players who should receive them (e.g., team messages only go to teammates).
- Console Command Integration: Team, party, and private messages are sent via console commands (e.g., /team Hello, /whisper PlayerName Hi). The Console Command System processes these commands and routes them to the Chat System.
- System Messages: Special messages (e.g., server announcements, event notifications) that are broadcast to all players regardless of category.
3. Components #
Chat Manager (AC_GameState_Chat_Manager_Advanced) #
- Attached to: GameState
- Purpose: Server-side message distribution and validation
- Responsibilities:
- Receives messages from Chat Communicator components (via server RPC)
- Validates messages (optional: profanity filter, rate limiting, permission checks)
- Determines recipients based on message category (global, team, party, private)
- Distributes messages to the appropriate recipients (via client RPC)
- Manages system messages (broadcast to all players)
Chat Communicator (AC_PlayerController_Chat_Communicator_Advanced) #
- Attached to: PlayerController
- Purpose: Client-side message sending and UI display
- Responsibilities:
- Translates user input (from chat UI) into server RPC calls
- Sends messages to the Chat Manager (server)
- Receives messages from the Chat Manager (client RPC) and displays them in the UI
- Handles console command integration (slash commands for team/party/private messages)
- Manages local mute list (filters messages from muted players before displaying)
- Provides auto-completion for console commands
4. Message Categories #
The Chat System supports multiple message categories. Each category has different recipient filtering rules.
Global / All Chat #
- Recipient: All players in the session
- Use Case: General communication visible to everyone
- Example: “Good game everyone!”
Team Chat #
- Recipient: Only players on the sender’s team
- Use Case: Team coordination, strategy discussion
- Example: /team Let's attack point B
- Note: Requires Console Command System integration (see Section 5)
Party Chat #
- Recipient: Only players in the sender’s party/squad
- Use Case: Small group coordination within a team
- Example: /party Follow me
- Note: Requires Console Command System integration (see Section 5)
Private Message / Whisper #
- Recipient: One specific player (target)
- Use Case: Private conversation between two players
- Example: /whisper PlayerName Hey, want to team up?
- Note: Requires Console Command System integration (see Section 5)

System Messages #
- Recipient: All players (broadcast)
- Sender: Server or game logic (not player-initiated)
- Use Case: Server announcements, event notifications, match updates
- Example: “Match starts in 30 seconds”
- Note: System messages are sent to all players regardless of category; they are not a selectable category for player messages.
5. Console Command Integration #
Team, party, and private messages require the Console Command System to function. The Chat System UI integrates console command input using slash (/) commands.
How It Works #
- Player types a command in the chat UI input box (e.g., /team Hello team).
- The Chat Communicator detects the / prefix and routes the input to the Console Command System.
- The Console Command System processes the command (e.g., /team, /party, /whisper PlayerName).
- The Console Command System calls the Chat System’s message sending function with the appropriate category and message content.
- The Chat Manager receives the message and distributes it to the correct recipients.
Supported Commands (Examples) #
- /team
: Send a message to all teammates - /party
: Send a message to party members - /whisper
: Send a private message to a specific player
Alternative: Chat-Only Implementation #
The current implementation uses the Console Command System for team/party/private messages. However, you can rewrite the Chat System to handle these categories directly (e.g., via a UI dropdown to select the category) without relying on console commands. This would require implementing the category selection and recipient filtering logic directly in the Chat Communicator and Chat Manager.
For more details on console commands, see the Console Command System documentation.
6. Message Flow and Server Validation #
Message Flow #
- Client (Sender):
- Player types a message in the chat UI input box.
- Player submits the message (press Enter or click Send button).
- Chat Communicator translates the message into a server RPC call (includes message content, category, and target if applicable).
- Server (Chat Manager):
- Receives the message via server RPC.
- Validates the message (banned word filter, and optionally: rate limiting, permission checks).
- Determines recipients based on message category (global → all players, team → teammates only, private → target player only, etc.).
- Sends the message to recipients via client RPC.
- Client (Recipient):
- Chat Communicator receives the message via client RPC.
- Checks if the sender is muted (local mute list).
- If not muted, displays the message in the chat UI.
Server Validation #
Banned Word List (Implemented) #
The Chat Manager (AC_GameState_Chat_Manager_Advanced) includes a banned word list for content moderation.
Behavior: – The banned word list is a configurable array of strings in the Chat Manager component. – When a player sends a message, the server checks if it contains any words from the banned word list. – If a banned word is detected: – The message is blocked (not sent to any recipients). – The server sends a notification back to the sender (e.g., “Your message contains prohibited language and was not sent.”). – If no banned words are detected, the message proceeds to recipient filtering and distribution.
Configuration: – Add, remove, or modify entries in the banned word list array as needed for your project’s content policy. – You can add common misspellings or variations to catch attempts to bypass the filter.
Use Case: – Enforce community guidelines by blocking offensive language, slurs, or spam triggers. – Prevent toxic behavior and maintain a positive player experience.
Additional Validation (Optional, Extensible) #
You can extend the Chat Manager’s validation logic to include:
- Advanced Profanity Filter: More sophisticated pattern matching or third-party profanity detection services (beyond simple word matching).
- Rate Limiting: Track how many messages each player sends per time window; reject messages if the player exceeds the limit (prevents spam).
- Permission Checks: Verify the player has permission to send messages (e.g., server-muted players cannot send messages).
- Content Length Limit: Reject messages that exceed a maximum character count.
To add additional validation, modify the Chat Manager’s message receive function (server RPC) to include your custom validation logic before distributing messages.
7. UI Features #
The Chat System UI provides several features for message input, display, and management.
Message Input Box #
- Purpose: Text field where players type messages.
- Behavior:
- Players type their message and press Enter (or click Send button) to submit.
- If the message starts with /, it is routed to the Console Command System (see Section 5).
- Otherwise, it is sent as a global/all chat message (or the default category if you customize it).
Clear Chat #
- Purpose: Clear all messages from the chat UI display.
- Behavior: Removes all displayed messages from the chat window (local action only; does not affect other players).
- Use Case: Clear clutter or reset the chat view after a long session.
Toggle Player List #
- Purpose: Show/hide the player list panel.
- Location: Button attached to the chat UI (typically on the right side or adjacent to the chat box).
- Behavior: Clicking the button toggles the player list panel on/off.
- Use Case: See who is online, select a player for whispering (see Section 9).
8. Mute and Unmute #
Players can mute and unmute other players to filter unwanted messages.
Behavior #
- Mute: When a player is muted, their messages are not displayed in the muting player’s chat UI.
- Unmute: Removes the mute; messages from the player are displayed again.
- Local Only: Mute/unmute is a client-side filter (managed by the Chat Communicator). It does not affect other players or the server.
- Non-Persistent: Mute lists are not saved between sessions. When the player leaves the game and rejoins, all mutes are cleared.
How to Mute/Unmute #
- Via Player List: Right-click (or select) a player in the player list and choose “Mute” or “Unmute” (UI context menu or button).
- Via Console Command (if implemented): /mute PlayerName and /unmute PlayerName.
Use Case #
- Mute players who are spamming, being toxic, or disruptive.
- Temporarily ignore a player’s messages without affecting your ability to see messages from others.
9. Player List #
The Chat System includes a player list panel that displays all players in the session.
Features #
- Display: Shows a list of all connected players (names, and optionally avatars, ranks, or other info).
- Toggle: A button (attached to the chat UI) toggles the player list panel on/off.
- Whisper Integration: Click on a player in the list to initiate a private message (whisper) to that player. This typically pre-fills the chat input box with /whisper PlayerName so the user can type the message and send.
- Mute/Unmute: Right-click or select a player to access mute/unmute options (see Section 8).
Use Case #
- Quickly see who is online.
- Select a player for private messaging without typing their name manually.
- Manage mute list visually.
10. Auto-Completion #
The Chat System provides auto-completion for console commands.
Behavior #
- Scope: Auto-completion works only for console commands (e.g., /team, /party, /whisper), not for generic message text or player names.
- How It Works:
- Player types a partial command in the chat input box (e.g., /te).
- The Console Command System checks available commands that start with /te.
- A suggestion list appears (e.g., /team).
- Player presses Tab (or selects from the list) to auto-complete the command.
- Integration: Auto-completion is handled by the Console Command System. The Chat UI displays the suggestions and allows the player to select one.
Use Case #
- Quickly type commands without remembering the exact syntax.
- Reduce typos when entering commands.
For more details on auto-completion, see the Console Command System documentation.
11. How-To: Set Up and Use Chat #
Step 1: Add Chat Components #
- Add the AC_GameState_Chat_Manager_Advanced component to the GameState.
- Add the AC_PlayerController_Chat_Communicator_Advanced component to the PlayerController.
- Ensure the Console Command System is also present (required for team/party/private messaging).
Step 2: Configure Chat UI #
- Create or configure the chat UI widget (or use the provided chat widget).
- Bind the message input box to the Chat Communicator’s send message function.
- Add a button to toggle the player list panel.
- Add a “Clear Chat” button to clear displayed messages.
Step 3: (Optional) Implement Server Validation #
- Modify the Chat Manager’s message receive function (server RPC).
- Add validation logic (profanity filter, rate limiting, permission checks, etc.).
- Reject or censor messages that fail validation.
Step 4: Test #
- Start a multiplayer session with multiple players.
- Send a global message (type a message and press Enter).
- Send a team message (/team Hello team) and verify only teammates receive it.
- Send a private message (/whisper PlayerName Hi) and verify only the target player receives it.
- Mute a player and verify their messages do not appear in your chat UI.
- Toggle the player list on/off.
- Test auto-completion by typing a partial command (e.g., /te and press Tab).
12. Examples and Use Cases #
Example 1: Team Coordination #
Scenario: In a team-based shooter, teammates use team chat to coordinate strategy.
Implementation: – Player types /team Let's attack point B in the chat input box. – The Console Command System processes the /team command. – The Chat Manager sends the message to all teammates (filters out enemy team members). – Teammates see the message in their chat UI.
Example 2: Private Messaging #
Scenario: Two players want to have a private conversation.
Implementation: – Player A clicks on Player B’s name in the player list. – The chat input box is pre-filled with /whisper PlayerB. – Player A types Hey, want to team up? and presses Enter. – The Chat Manager sends the message only to Player B. – Player B sees the message in their chat UI (other players do not see it).
Example 3: Mute Toxic Player #
Scenario: A player is spamming the chat. Another player wants to mute them.
Implementation: – Player opens the player list. – Player right-clicks on the spammer’s name and selects “Mute”. – The Chat Communicator adds the spammer to the local mute list. – Future messages from the spammer are filtered and not displayed in the muting player’s chat UI. – Other players (who did not mute the spammer) still see the spammer’s messages.
Example 4: System Announcement #
Scenario: The server wants to announce that the match is starting in 30 seconds.
Implementation: – Server (or game mode logic) calls the Chat Manager’s system message function. – The Chat Manager sends the system message to all players (broadcast). – All players see “Match starts in 30 seconds” in their chat UI, regardless of their team or party.
Example 5: Auto-Complete Command #
Scenario: A player wants to send a team message but doesn’t remember the full command syntax.
Implementation: – Player types /te in the chat input box. – The Console Command System detects the partial command and suggests /team. – Player presses Tab (or selects from the suggestion list). – The input box auto-completes to /team. – Player types the message and sends it.
13. See Also #
- Console Command System: Handles slash commands for team/party/private messaging and provides auto-completion.
- Team Manager: Provides team affiliation data for recipient filtering (team chat).
- Player Manager: Provides player list and player state data.
- HUD: May integrate the chat UI widget for display.
