Graceful Disruption Handling in Online Game Integration During Maintenance
Online games powered by AccelByte Gaming Services (AGS) rely on a strong backend infrastructure for essential features such as authentication, matchmaking, friend lists, and cloud saves. Regular maintenance is crucial to maintaining stability, security, and performance. However, if not managed properly, maintenance periods can result in poor player experiences, unexpected disconnections, and failed API requests.
To minimize these disruptions, developers should implement graceful disruption handling to keep players informed, manage retries effectively, and reduce the impact on gameplay. By utilizing AccelByte's built-in retry mechanisms, games can ensure a smoother experience even during service interruptions.
Prerequisites
These handling examples are explained based on the Byte Wars implementation. For better insights, set up Byte Wars in your workspace by following our step-by-step guide on Unreal Engine Byte Wars Setup or Unity Byte Wars Setup.
AGS Network Communications
AGS mainly relies on two types of network communication:
- WebSocket connection; used for lobby and chat service.
- HTTP connection; used for access, social features, storage, and engagement service.
Both the AGS Unreal Engine and Unity SDK come with built-in features for automatic reconnection and retrying with a set timeout. However, if the default timeout is reached, additional handling is needed to manually attempt a reconnection.
How to Implement Graceful Disruption Handling
Example of graceful disruption handling in the game integration during regular maintenance:
📄️ Impact of Maintenance Disruption
📄️ Lobby WebSocket Recovery
Learn best practices for handling Lobby WebSocket disruptions in real-time applications. Ensure seamless reconnections and maintain gameplay stability.
📄️ API Call Recovery
Learn how to handle failed API calls gracefully in games, ensuring smooth gameplay even during network disruptions.
📄️ Game Maintenance Testing
Test how your game handles service disruptions before launch with AccelByte’s maintenance simulation. Prepare for real-world downtime with detailed reports
🗃️ Game State Recovery
6項目
Game SDK Log
To help developers debug connection issues, it's recommended to enable verbose logging for AccelByte-related components in the game SDK. This provides detailed insights into network disruptions and reconnection attempts.
- Unreal Engine
- Unity
In the Unreal Engine SDK, the following log categories can be enabled to get the AccelByte-related components:
- LogAccelByte – General logs for the AccelByte SDK, covering API requests and responses.
- LogAccelByteOSS – Logs related to the AccelByte Online Subsystem, useful for matchmaking, authentication, and session handling.
- LogAccelByteLobby – Logs WebSocket connections for lobby interactions, such as party management and friend notifications.
- LogAccelByteWebsocket – Provides detailed logs on WebSocket connectivity and reconnection attempts.
- LogAccelByteHttpCache – Provides detailed logs on HTTP cache.
- LogAccelByteHttpRetry – Provides detailed logs on HTTP retry mechanisms.
Enabling these logs helps developers track issues, analyze retry behavior, and debug disruptions more effectively, ensuring a smoother player experience even during network interruptions.
To enable these logs in your Unreal Engine project, follow these steps:
- Open the Config/DefaultEngine.ini file in your game project directory.
- Add the log category names under the [Core.Log] section, like this:
...
[Core.Log]
LogAccelByte=VeryVerbose
LogAccelByteOSS=VeryVerbose
LogAccelByteLobby=VeryVerbose
LogAccelByteWebsocket=VeryVerbose
LogAccelByteHttpCache=VeryVerbose
LogAccelByteHttpRetry=VeryVerbose
...
- You also can control the level of detail for different log categories using command-line parameters when starting your game. To do this, add the following flags at the end of your launch command:
-LogCmds="LogAccelByte VeryVerbose, LogAccelByteOSS VeryVerbose, LogAccelByteLobby VeryVerbose, LogAccelByteWebsocket VeryVerbose, LogAccelByteHttpCache VeryVerbose, LogAccelByteHttpRetry VeryVerbose"
This will enable detailed logging for AccelByte components, helping you track network issues, API requests, and reconnection attempts more effectively.
In the unity SDK, you can enable the log by following the steps in the Set up Unity SDK Log Guide page.