Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article provides a summary of the steps involved in implementing chat in your game. For more information, be sure to review the pages in the See also section at the end of the article.
Implement chat features by using Microsoft Azure PlayFab Party
PlayFab Party, included in the Microsoft Game Development Kit (GDK), is the recommended solution for synchronous chat in the PC/Xbox ecosystems.
- Set up the PlayFab Party SDK: PlayFab Party SDKs provide networking and voice/text chat communication for games. There are PlayFab Party SDKs for different platforms and game engines. Select and download the one that you need.
- Authenticate the player: if you're using PlayFab Party in Xbox and PC games, we recommend that you use the Party Xbox Live Helper Library to ensure consistent functionality and behavior. This library helps your title meet Xbox services requirements.
- Create a network: when using a PlayFab Party network with a game session, choose which client and player will create the network by using PartyManager::CreateNewNetwork().
- Create the PartyLocalChatControl object: this object acts as the management object for chat operations that are related to a specific local user. You can choose the input and output device, mute state, and accessibility preferences. Each local user can have no more than one chat control. For a local chat control to communicate with another chat control, the following requirements must be met.
- The two chat controls must be in the same network.
- Connect the chat control to the network: call PartyNetwork::ConnectChatControl(). Upon connection, other devices in the network are notified that your chat control has joined the network with a PartyChatControlJoinedNetworkStateChange state change. You also receive a
PartyChatControlJoinedNetworkStateChange
for every other chat control already in the network and can immediately communicate with them. - Select audio inputs and outputs: use PlayFab Party to choose which audio devices are used by your chat control with the PartyLocalChatControl::SetAudioInput() and PartyLocalChatControl::SetAudioOutput() methods. Use the PartyAudioDeviceSelectionType enum to change the behavior of these methods:
PartyAudioDeviceSelectionType::None
: This audio device selection type is the default.PartyAudioDeviceSelectionType::SystemDefault
: When this audio device selection type is chosen, the chat control attempts to use the system's default communication device.PartyAudioDeviceSelectionType::PlatformUserDefault
: When this audio device selection type is chosen,PartyLocalChatControl::SetAudioInput()
andPartyLocalChatControl::SetAudioOutput()
require that theaudioDeviceSelectionContext
parameter be set to a platform user ID. PlayFab Party then attempts to use the platform default communication device that's associated with that user.PartyAudioDeviceSelectionType::Manual
: When this audio device selection type is chosen,PartyLocalChatControl::SetAudioInput()
andPartyLocalChatControl::SetAudioOutput()
use theaudioDeviceSelectionContext
parameter as a valid audio device identifier and attempt to use any device that matches that identifier.
- Implement chat permissions and muting: PlayFab Party gives you fine-grained control over how your players can communicate with each other. Rather than specifying teams or channels, PlayFab Party requires explicitly defining the permissions between each pair of chat controls.
- Implement text chat, translation, and moderation: PlayFab Party also enables you to send and receive text chat from other chat controls.
- The PartyLocalChatControl::SendText() method enables you to send text messages to an arbitrary number of chat controls. You can be assured that only chat controls that have the appropriate
PartyChatPermissionOptions::ReceiveText
chat permission receive the messages. - Text chat translation can also be enabled by calling PartyLocalChatControl::SetTextChatOptions().
- Setting the PartyTextChatOptions::TranslateToLocalLanguage option causes PlayFab Party to translate incoming text messages to the local chat control's language.
- The PartyLocalChatControl::SendText() method enables you to send text messages to an arbitrary number of chat controls. You can be assured that only chat controls that have the appropriate
- Implement accessible chat: powered by Azure Speech Services, PlayFab Party can transcribe player voice chat and synthesize speech from text.
- Implement audio input noise suppression: PlayFab Party enables you to suppress background noise in captured microphone audio before it's transmitted to remote chat controls. This can significantly increase the quality of your players' voice audio.
See also
PlayFab documentation is the best source of up-to-date information. For details, see the following articles and sample.
-
This is a simple multiplayer game that shows how to use the Microsoft Azure PlayFab Party and Multiplayer C++ SDKs and APIs in games. This sample includes a voice chat feature.