AGS Best Practices
Last updated on December 17, 2024
Following best practices for game integration can help prevent issues from occurring, minimize the impact of issues that do occur, and provide players a better user experience.
This article covers some best practices to use for game integration.
The Basics
Document Link
Get your copy of the Best Practices document here.
- Implement logins before calling any AGS APIs.
{' '}
Details
An error will occur when an API is called without a login auth token. - Implement login queue (AGS Private Cloud only).
- Enable login queue.
Details
Login queues only allow players to enter the game when space is available, preventing an influx of players from overloading the server during peak play hours.Step to Check :
1. In the AGS Admin Portal under your game namespace, go to Live Service Utilities > Login Queue.
2. Ensure the Feature Status under the page title says Active.
3. If its Inactive, press the Activate button to the right.
4. Verify your product versions match what's shown on the Activate Login Queue popup.
5. Click Confirm.
6. Verify your Feature Status has been updated to Active. - Set appropriate login queue limits.
Details
Login queue limits that are set above your server's capability increases the risk of your server being overloaded.Step to Check :
- Enable login queue.
- Connect to AGS Lobby after login.
{' '}
Details
An AGS Lobby connection is needed to deliver notifications and access social and matchmaking features. - Ensure party retention.
- Create or restore a party when the game is launched.
Details
Placing the player in a party—either alone or as part of a previous party—from the start ensures seamless interactions with party features.Step to Check :
- Create a new party when the player leaves or is kicked from a party.
Details
A player should always be in a party—even a party of just themselves—to ensure seamless interactions with party features.Step to Check :
Reference :
- Create or restore a party when the game is launched.
- Handle WebSocket (Lobby and Chat) connection errors and reconnect conditions.
- Handle internet connection loss error.
Details
Alleviate player frustration during connection issues.Step to Check :
- Handle connection errors caused by the game running in the background .
Details
Provide a continuous game experience for players as they swap between games, applications, and processes.Step to Check :
1. Run the game until a Lobby connection is established.
2. Switch to a new game or process (i.e., launch another game on console or press Alt + Tab on PC).
3. Return to the original game.
4. When Lobby gives an error signal, take note of the callback.
5. Reconnect the device to the internet.
6. Ensure appropriate flow when the connection is reestablished. - Handle matchmaking connection errors.
Details
Prevent players from being stuck in the matchmaking process after a connection loss.Step to Check :
1. Run the game until a Lobby connection is established.
2. Start matchmaking.
3. Disconnect the device from the internet during the matchmaking process.
4. When Lobby gives an error signal, take note of the callback.
5. Reconnect the device to the internet.
6. Ensure appropriate flow when the connection is reestablished. - Handle multiplayer match connection errors.
Details
Allow players to return to the match they were playing after a connection loss.Step to Check :
1. Run the game until a Lobby connection is established.
2. Start matchmaking and join a multiplayer match.
3. Disconnect the device from the internet.
4. When the Lobby gives an error signal, take note of the callback.
5. Reconnect the device to the internet.
6. Ensure appropriate flow when the connection is reestablished. - Handle errors for simultaneous same account Lobby connection attempts (single point of presence).
Details
Prevent players from logging into the same account on multiple devices or clients.Step to Check :
- Handle internet connection loss error.
- Implement logouts when closing the game.
- Implement logout when Close is pressed on the client window.
Details
Ensure the player is logged out when the player closes the window. - Implement logout when the an Exit option in the game menu.
Details
Ensure players can log out using the user interface.
- Implement logout when Close is pressed on the client window.
- Implement friend sync.
- Sync friends on game launch.
Details
Ensure the player's friend list is up to date when they start the game.Step to Check :
1. Run the game in two separate clients.
2. Log into each client with separate accounts, ensuring each has a profile in the same environment and namespace and they have each other as friends.
3. Check each client's friend list in the game and verify they're on each other's list.
4. Search for each player in the AGS Admin Portal under Lookup Users and verify they're on each other's friend list.Reference :
- Sync friends after player attempts to add friend in the platform interface.
Details
Ensure a player's friend list gets updated after players attempt to add a friend via the platform interface (e.g., Steam, PSN, Xbox) while the game is running.Step to Check :
1. Enable AGS Game SDK logs.
2. Run the game in two separate clients.
3. Log into each client with separate accounts, ensuring each has a profile in the same environment and namespace.
4. Use one account to add the other as a friend through the platform interface.
5. Return to the game.
6. Open the game logs.
7. Verify friend sync was called.Reference :
- Sync friends after player accepts friend request in the platform interface.
Details
Ensure a player's friend list gets updated after players accept a friend request via the platform interface (e.g., Steam, PSN, Xbox) while the game is running.Step to Check :
1. Run the game in two separate clients.
2. Log into each client with separate accounts, ensuring each has a profile in the same environment and namespace.
3. Use one account to add the other as a friend through the platform interface.
4. Accept the friend request in the other client through the platform interface.
5. Check each client's friend list in the game and platform interface to verify they're on each other's list.
6. Search for each player in the AGS Admin Portal under Lookup Users and verify they're on each other's friend list.Reference :
- Sync friends after friend removal.
Details
Ensure a player's friend list gets updated after the player removes a friend from their list.Step to Check :
1. Run the game in two separate clients.
2. Log into each client with separate accounts, ensuring each has a profile in the same environment and namespace and they have each other as friends.
3. Use one account to remove the other from their friend list using the unfriend AGS API.
4. Verify the updated friend list in the game and the platform interface (e.g., Steam, PSN, Xbox).Reference :
- Sync friends on game launch.
- Implement blocklist sync.
- Sync blocked players after player block.
Details
Ensure a player's blocked players list is up to date when using the blocked players feature in the platform interface (e.g., Steam, PSN, Xbox).Step to Check :
- Sync blocked players on game launch.
Details
Ensure the blocked player's list is up to date when they start the game.Step to Check :
1. Run the game in two separate clients.
2. Log into each client with separate accounts, ensuring each has a profile in the same environment and namespace.
3. Close one of the clients.
4. Use the open client to block the other account.
5. Close the remaining client.
6. Relaunch the game using the same two accounts.
7. Verify the updated blocklist in the game and the platform interface.
8. Search for each player in the AGS Admin Portal under Lookup Users and verify they're not in each other's friend list.
- Sync blocked players after player block.
- Set up third-party store.
- Configure third-party store.
Details
Ensure third-party platform stores are properly synced with AGS Ecommerce. - Verify consumable items.
Details
Ensure consumable items are working properly and refunds are synced with the third-party platform store. Avoid including both consumable and durable items in the same bundle. - Verify durable items.
Details
Ensure consumable items are working properly and refunds are synced with the third-party platform store. Avoid including both consumable and durable items in the same bundle.
- Configure third-party store.