發佈您的遊戲

本文說明如何在 Google Play 遊戲電腦版發布遊戲。

事前準備

Google Play 遊戲 SDK 整合至遊戲。

將遊戲封裝為 WAB 檔案

如要使用 Google Play 遊戲電腦版,請將遊戲的安裝程式以 Windows 應用程式套件 (WAB) 檔案的形式,上傳至 Google Play 管理中心。如要建立 WAB 檔案,請按照下列步驟操作:

  1. 下載 Play 發布工具。 您可以在 Windows 指令列或 Powershell 執行這項工具。

  2. 建立 Play 發布設定檔,名稱不限。舉例來說,play_publishing_config.xml 的格式如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <play-publishing-config version="1.0">
      <application>
        <package-name>PACKAGE_NAME</package-name>
        <version-name>VERSION</version-name>
      </application>
      <installer requiresElevation=REQUIRES_ELEVATION>
        <path>PATH</path>
        <installation-path-registry-location>
          <key-name>KEY1</key-name>
          <value-name>VALUE1</value-name>
        </installation-path-registry-location>
      </installer>
      <launcher requiresElevation=REQUIRES_ELEVATION>
        <launch-path-registry-location >
          <key-name>KEY2</key-name>
          <value-name>VALUE2</value-name>
        </launch-path-registry-location>
        <executable-invocation>
          <filename>FILENAME</filename>
          <arguments>ARGS</arguments>
        </executable-invocation>
      </launcher>
      <uninstaller requiresElevation=REQUIRES_ELEVATION>
        <uninstall-path-registry-location>
          <key-name>KEY3</key-name>
          <value-name>VALUE3</value-name>
        </uninstall-path-registry-location>
      </uninstaller>
    </play-publishing-config>

    取代下列項目:

    • PACKAGE_NAME:遊戲的套件名稱。 例如 test.package.name
    • VERSION:遊戲版本。 例如 1.0
    • REQUIRES_ELEVATION:指出是否需要以管理員等提升權限執行可執行檔。

      • 「true」:以提升的權限執行可執行檔。

      • 「false」:執行可執行檔,但不具備提升的權限。

    • PATH:遊戲安裝程式 EXE 檔案的路徑。這個路徑可以是絕對路徑,也可以是相對於 Play 發布設定父項目錄的相對路徑。例如:path\to\test\installer。使用Authenticode 和程式碼簽署功能,簽署遊戲的安裝程式 EXE。

    • KEY1VALUE1:在 installer 元素中指定 Windows 登錄機碼值配對。

    • KEY2VALUE2:在 launcher 元素中指定 Windows 登錄機碼值配對。

    • KEY3VALUE3:在 uninstaller 元素中指定 Windows 登錄機碼值配對。

    • FILENAME:指定遊戲啟動器可執行檔的路徑。例如 path\to\launcher.exe

    • ARGS:遊戲啟動器可執行檔的引數。這些都是選填。

    Google Play 發布設定檔範例

    假設有一個名為 MyGame 的遊戲,遊戲安裝程式為 game_installer.exe,遊戲啟動器為 launcher.exe。這個範例也說明如何使用 CDATA。 play_publishing_config.xml 的外觀如下:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <play-publishing-config version="1.0">
      <application>
        <package-name>test.package.name</package-name>
        <version-name>1.0</version-name>
      </application>
      <installer requiresElevation="true">
        <path>game_installer.exe</path>
        <installation-path-registry-location>
          <key-name>SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MyGame</key-name>
          <value-name>InstallPath</value-name>
        </installation-path-registry-location>
      </installer>
    
      <launcher requiresElevation="true">
        <launch-path-registry-location >
          <key-name>SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MyGame</key-name>
          <value-name>ExePath</value-name>
        </launch-path-registry-location>
        <executable-invocation>
          <filename>launcher.exe</filename>
          <arguments><![CDATA[arg1&arg2>arg3]]></arguments>
        </executable-invocation>
      </launcher>
    
      <uninstaller requiresElevation="true">
        <uninstall-path-registry-location>
          <key-name>SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MyGame</key-name>
          <value-name>UninstallString</value-name>
        </uninstall-path-registry-location>
      </uninstaller>
    </play-publishing-config>
    
  3. 在 Windows 指令列或 Powershell 中執行 Play 發布工具。

    playpublishingtool.exe build-installer-bundle --input=PLAY_PUBLISHING_CONFIG_PATH --output=WAB_OUTPUT_PATH
    

    如要覆寫名稱相同的現有 WAB 檔案,請使用 --force 引數。

    playpublishingtool.exe build-installer-bundle --input=PLAY_PUBLISHING_CONFIG_PATH --output=WAB_OUTPUT_PATH --force
    

    取代下列項目:

    • PLAY_PUBLISHING_CONFIG_PATH:Play 發布設定的路徑。例如 path\to\play_publishing_config.xml
    • WAB_OUTPUT_PATH:WAB 檔案的路徑。 例如 path\to\output_bundle.wab

    如何使用 Play 發布工具

    假設您在目前的工作目錄中,有 Play 發布工具二進位檔 playpublishingtool.exe、Play 發布設定 play_publishing_config.xml 和遊戲安裝程式 game_installer.exe

    目前的工作目錄應如下所示:

    .\
    ├── game_installer.exe
    ├── play_publishing_config.xml
    ├── playpublishingtool.exe
    

    如要在相同目錄中建立名為 installer_bundle.wab 的 WAB,指令如下所示:

    playpublishingtool.exe build-installer-bundle --input=play_publishing_config.xml --output=installer_bundle.wab
    

    使用 --force 引數時,指令如下所示:

    playpublishingtool.exe build-installer-bundle --input=play_publishing_config.xml --output=installer_bundle.wab --force
    

    成功後,您應該會看到類似以下的輸出內容:

    Successfully built the installer bundle at installer_bundle.wab
    

    在資料夾中找出 WAB 檔案:

      .\
      ├── game_installer.exe
      ├── installer_bundle.wab
      ├── play_publishing_config.xml
      ├── playpublishingtool.exe
    

使用 Play 管理中心發布遊戲

為遊戲成功建立 WAB 後,請將其上傳至 Play 管理中心,並管理相關設定和規定。請按照下列步驟發布遊戲:

新增 Google Play 遊戲電腦版板型規格

發布遊戲時,只有第一次需要執行這個步驟。

  1. 在 Play 管理中心的左選單中,依序選取「測試及發布」>「設定」>「進階設定」 (直接連結)。
  2. 前往「板型規格」分頁,然後使用「+ 新增板型規格」下拉式選單新增 Google Play Games on PC

  3. 按一下右側「Google Play 遊戲電腦版」板型規格對應的「管理」按鈕。

  4. 選取「使用 Windows 應用程式套件遊戲的專屬測試群組」選項。

  5. 依序點選「儲存」和確認對話方塊中的「儲存」

上傳 WAB 檔案

如要上傳 WAB 檔案,請按照下列步驟操作:

  1. 在 Play 管理中心的左選單中,依序選取「測試及發布」>「正式版」 (直接連結)。
  2. 在「正式版」頁面中,從右側的板型規格下拉式選單,選取「僅限 Google Play 遊戲電腦版 (Windows)」
  3. 在「Windows 應用程式套件」分頁中,按一下「上傳 Windows 應用程式套件」按鈕,然後上傳 WAB 檔案。或者,您也可以點按表單右側的「上傳 Windows 應用程式套件」按鈕。
  4. 按一下 [儲存]

設定 Windows 電腦規格需求

如要設定 Windows 電腦規格需求,請按照下列步驟操作:

  1. 在 Play 管理中心的左選單中,依序選取「拓展使用者數量」>「商店發布」>「商店設定」 (直接連結)。
  2. 在「電腦需求」部分,按一下右側的「編輯」按鈕。
  3. 更新欄位,然後按一下「儲存」

設定應用程式內購圖片

這個步驟可以省略。如要設定應用程式內購圖像,請按照下列步驟操作:

  1. 在 Play 管理中心左選單中,依序選取「拓展使用者」>「商店發布」>「商店資訊」(直接連結)。
  2. 在「商店資訊」分頁的「預設商店資訊」部分,按一下右側的 -> (箭頭) 按鈕。系統隨即會將你導向「預設商店資訊」頁面。
  3. 前往「Google Play 遊戲電腦版」部分,然後上傳「Google Play 遊戲電腦版 (Windows) 應用程式內購圖片」
  4. 按一下 [儲存]

將變更送審

  1. 在 Play 管理中心的左選單中,選取「發布總覽」
  2. 在「尚未送審的變更」部分,按一下「將變更送審」

審查團隊核准變更後,Google Play 就會顯示您的遊戲。