Patcher

Overview

The Patcher service combines BuildInfo, BuildUtil, and Differ tools that enable you to upload and publish your game. Each of these three services is described below:

BuildInfo

BuildInfo manages your game’s build version. This system stores every detail of a game’s build version in a build manifst. BuildInfo is comprised of two components:

  1. BuildInfo Service This service handles all functions related to the build process. Every communication between the BuildInfo system and third-party services is managed by this service.
  2. BuildInfo CLI This component is a command-line tool which consumes the BuildInfo service. This program is used to automate game deployment and should be put in CI/CD tools.

BuildUtil

BuildUtil is used to upload your game binary to the cloud for distribution. While the binary is uploading, BuildUtil provides the meta information to be recorded by BuildInfo.

Differ

Differ is a service that can compare different uploaded versions of a game. This allows your players to update their game to a new version without completely re-downloading the game file.

Tutorials

In this tutorial, you will learn how to perform the required setup before you can upload your game using BuildUtil. Before you start, make sure you have read about Namespace.

Creating BuildUtil Client Credentials

In order to upload your game, you must first create client credentials for BuildUtil. This will ensure that BuilUtil will be able to upload your game. To do so, follow these steps:

How to Create BuildUtil Client Credentials

  1. In the Admin Portal, click Platform Configurations and select OAuth Clients. The list of existing OAuth Clients appears.

    uploading-a-game

  2. Click Create New in the top-right corner. The Create New OAuth2 Client form appears.

    uploading-a-game

  3. Fill in the Create New OAuth2 Client form:

    uploading-a-game

    • Client ID is automatically filled in.
    • Input the Client Name. The client name can include the separators ' , . - , as well as spaces.
    • Select Confidential for the Client Type. BuildUtil is a private client so the client type must be Confidential.
    • Input a unique Client Secret. Or, you can click Generate Client Secret and the Admin Portal will generate a secret for you.
    • Select the publisher namespace from the Namespace dropdown list.
    • Select the Target Audience. For BuildUtil, this often includes the IAM and BuildInfo clients. If you leave this field empty, BuildUtil will be available to all clients.

    When you’re finished, click Create.

  4. After creating the new client credentials, you’ll be directed to the Client Details.

    uploading-a-game

  5. In the Client Details window, open the Permissions tab to add permissions to the newly created client. Then, click Add to add permissions to the client.

    uploading-a-game

  6. The Add Client Permissions form appears.

    uploading-a-game

    Input the permissions Resource in the text field and select the Action. Below are some examples of how to fill in the Resource parameter:

    • ADMIN:NAMESPACE:{namespace}:BUILDINFO This permission allows an admin to access BuildInfo in whatever client they’re logged into.
    • ROLE This permission allows admins to access data related to Roles.

    When you’re finished, click Confirm.

  7. The client permissions will be updated in the Client Permissions panel.

    uploading-a-game

Creating Game Client Credentials

You’ll need to create client credentials for your game in order to connect it with our services. The procedure to create Game Client Credentials is similar to BuildUtil Client Credentials. To do so, follow these steps:

  1. Click Create New in the top-right corner. The Create New OAuth2 Client form appears.

    uploading-a-game

  2. Fill in the Create New OAuth2 Client form:

    • Client ID is automatically filled in.
    • Input the name of your game in the Client Name field.
    • Select Confidential for the Client Type. A game client is a private client so the client type must be Confidential.
    • Input a unique Client Secret. Or, you can click Generate Client Secret and the Admin Portal will generate a secret for you.
    • Select the publisher namespace from the Namespace dropdown list.
    • Select the Target Audience. For your game you can fill in clients that will connect to your game, such as Matchmaking. If you leave this field empty, the game client will be available to all other clients.

    When you’re finished, click Create.

    uploading-a-game

  3. After creating the new client credentials, you’ll be directed to the Client Details.

    uploading-a-game

  4. In the Client Details window, open the Permissions tab to add permissions to the newly created client. Then, click Add to add permission to the Game Client.

    uploading-a-game

  5. Input the permissions Resource in the text field and select the Action. Below is an example of how to fill in the Resource parameter:

    • NAMESPACE:*:MATCHMAKING:CHANNEL

    This permission allows admins to access data related to Matchmaking in-game.

    uploading-a-game

    When you’re finished, click Confirm.

  6. The client permissions will be updated in the Client Permissions panel.

    uploading-a-game

Configuring BuildUtil

If this is your first time uploading a game, you’ll need to configure BuildUtil using the credentials you just created. You can skip this step if you’ve configured BuildUtil before.

  1. Download the latest BuildUtil.exe and save the file in your directory.

  2. Then, open your terminal or command line to run the latest Build Util using the following ./justice-build-util-v3.3.1-linux_amd64 configure -i.

    Note:

    • If you use Linux and you can’t locate the BuildUtil executable file you just downloaded, use chmod +x ./justice-build-util-v3.3.1-linux_amd64 to change the access level for BuildUtil so that it can be executed in Linux.
  3. After that, a new line in your terminal or command line will appear: Insert IAM URL. Input your IAM URL and click Enter. E.g.: https://justice.dev.accelbyte.io/iam/

  4. Then, a new line will appear: Insert Uploader’s Client ID. Input the BuildUtil Client ID you previously created and click Enter.

  5. Next, a new line will appear: Insert Uploader’s Client Secret. Input the BuildUtil Client Secret you previously created and click Enter.

  6. After that, a new line will appear: Insert Log level (OPTIONAL). The log level determines how detailed the log files will be. You can also leave this line empty if you choose, so that no extra information is added to the log. When you’re done, click Enter.

  7. When you’re finished, your terminal should look like this:

    uploading-a-game

    You can also use this command to configure BuildUtil if you’re already familiar with the above procedure:

    ./justice-build-util-v3.3.1-linux_amd64
    configure --clientid <buildutil_client_id> --clientsecret <buildutil_client_secret> --iamurl <iam_url>

Uploading a Game using BuildUtil

Once you have created the client credentials both for the BuildUtil and the Game Client, you can begin to upload the game into your publishing platform. In doing so, you need to make sure that you have the game binary of the game you want to publish already prepared. Also make sure you have set up the prerequisites given in the Game Publishing Getting Started Guide. You can upload the game using BuildUtil with the upload command. If this is the first time you’re uploading a game, you need to first configure build util by following steps in the previous section.

  1. Set up the Game SDK configuration. Below is an example of the Unity SDK configuration.

    {
    "PublisherNamespace":"AccelByte",
    "Namespace":"AccelByte",
    "ClientId":"899e6970d63b4df893e6da7d346c4989",
    "RedirectUri":"http://127.0.0.1"
    }
  2. Then, run the upload command. You can refer to the table below for information about each command.

    CommandDescription
    --url (-u)Base URL to the service. For example: ./justice-build-util-v3.3.1-linux_amd64
    --namespace (-n)The publisher namespace. This is the default namespace in the Admin Portal.
    --appID (-a)The app id of the game to upload. The app id should be unique for each game.
    --dir (-d)The absolute path of the directory containing the file to be uploaded
    --entrypoint (-e)Entrypoint / executable game relative path in the build folder. Please note that this is relative to the game directory ( --dir ). For example, if the entrypoint is /home/dev/GameA/executable/Game.exe and the specified directory is /home/dev/GameA , then the entrypoint value should be executable/Game.exe .
    --version (-v)A version of the game to upload. For example 1.0.0, 1.0-alpha, etc.
    --platformId (-p)The target platform identifier where the uploaded game will run. Pick one of these values: [win32, win64, windows, darwin, linux-ia32, linux-amd64, linux-generic ]. For example, you’re targeting the Windows 32-bit, pick win32.
    --sdkconfig (-f)Absolute path to the SDK config file.
    --ignore (-g)Optional. Absolute path to the ignore file. If you’re going to ignore certain files, create an ignore file with the same pattern with git ignore file and save it somewhere. You can also place the file named .ignoreconfig inside the directory of the game to be uploaded and just skip this flag. In that case, BuildUtil will automatically read your file.
    --type (-t)The type of game to be uploaded.. The two options are GAME or DLC.

    Here is the syntax of the upload command:

    ./justice-build-util-v3.3.1-linux_amd64 upload -u <base_url> -n <publisher_namespace> -a <game_appid> -v <game_version> -e <entrypoint_file> -f <absolute_path_to_sdk_config> -d <absolute_path_to_game_directory> -p <game_ platformid>

    For example:

    ./justice-build-util-v3.3.1-linux_amd64 upload -u https://justice.dev.accelbyte.io -n accelbyte -t GAME -a other123 -v 1.0 -e "otherexe.exe" -f "/home/taufiqi/Downloads/UnitySDKConfig.json" -d "/home/taufiqi/Documents/samplegame" -p win64

    Here is what the upload looks like in the terminal:

    uploading-a-game

    uploading-a-game

Setting Up the Current Version Through the Admin Portal

After you have successfully uploaded your game using Build Util, you can check your uploaded game in the App Distributions menu in Admin Portal. Follow these steps to view your uploaded game.

  1. In the Admin Portal, click the Platform Configuration dropdown menu and open the App Distributions menu.

    uploading-a-game

  2. Then, find the game you uploaded from the list. In this example, the name of the uploaded game is game2. Click View to view the uploaded game details

    uploading-a-game

  3. In the Builds panel, choose the build you want to set as the current build by clicking the three dots in the Action column, then choose Set as Current.

    uploading-a-game

  4. The Set as current modal will appear. Click the Set button to proceed.

    uploading-a-game

Setting Up the Current Version from Build Util

You can also set up a game version as current using Build Util through the command prompt or terminal. The result is identical to setting a game version as current from the Admin Portal. In order to set up the current version using Build Util, run the setcurrent command with the following parameters.

CommandDescription
--url (-u)Base URL to the service.
--appID (-a)AppId for the game which will be updated.
--namespace (-n)The publisher namespace, which is the default namespace in the Admin Portal
--platformId (-p)The target platform identifier where the uploaded game will run. Pick one of these values : [win32, win64, windows, darwin, linux-ia32, linux-amd64, linux-generic ]. For example, you’re targeting the Windows 32-bit then pick win32.
--version (-v)The version of the game to be set as the current version. For example 1.0.0, 1.0-alpha, etc.

Here is the example of the updated command:

./justice-build-util-v3.3.1-linux_amd64 setcurrent --url https://alpha.justice.accelbyte.net -a other123 -n accelbyte -v 1.0 -p win64

And here is an example of how it looks in the terminal:

uploading-a-game

Add a Launch Argument Through the Admin Portal

You can add or update a launch argument for your builds through the Admin Portal by following the steps below.

  1. In the Admin Portal, click the Platform Configuration dropdown menu and open the App Distributions menu.

    uploading-a-game

  2. Find the game you want to edit by clicking the View button.

    uploading-a-game

  3. Here you can see the list of your builds. In the Actions column, click the three dots and choose Edit Launch Argument.

    uploading-a-game

  4. The Edit Launch Argument form appears. Here you can input the desired arguments.

    uploading-a-game

    • For example, if there is a build that cannot run using VGA because it will crash, you can input --novga as the launch argument to run it without using the GPU as long as that build supports the specific argument.

      Note:

      • Updating the launch arguments will rewrite the previous launch arguments.

      Here’s what the launch arguments look like after they’re updated:

      uploading-a-game

Downloading Game Using BuildUtil

You can download the game using Build Util for debugging purposes.

Note: The real mechanism of download should only happen in Launcher.

To download a game run the download command with the following parameters:

CommandDescription
--url (-u)Base URL to the service.
--namespace(-n)The publisher namespace. This is the default namespace in the Admin Portal.
--dir (-d)The directory where the game will be downloaded.
--sourceID (-b)The Build ID of the game.
--buildInfoVersion (-r)The BuildInfo version to be used. If you’re uploading the game and specifying the -r flag as 1, then fill this param with value 1. If no value of -r is supplied during the upload, then fill this param with value 2. Any values other than 1 and 2 are invalid.

Here is the example of the updated command:

./justice-build-util-v3.3.1-linux_amd64 download -d ~/Documents/samplegame -n accelbyte -b Ru3DBU-sLr --url https://alpha.justice.accelbyte.net -r 2

Also, here is how it looks in the terminal:

uploading-a-game

Once you are done, you can find the downloaded file in the directory that you previously specified.

What’s Next?

  • After learning how to upload your game, check out how you can publish it using our in-browser and standalone applications Player Portal and Launcher.
  • When publishing your game, you can add additional content like news or player support with Contentful.