Clone and run Byte Wars - Initial setup - (Unity module)
Clone the Byte Wars repository
You can find the Byte Wars project folder in the Byte Wars Unity GitHub repository and clone it using the following command:
git clone https://github.com/AccelByte/accelbyte-unity-bytewars-game.git
Open the Byte Wars project in Unity
To open Byte Wars in Unity, you can follow these steps:
- From the Unity Hub, go to Projects and click Open.
- In the file explorer, locate and open the Byte Wars folder you cloned. The Byte Wars project will be added into the project panel.
- Click on the project to open it in the Unity Editor.
The project must be opened with 2022.3.50f1 or later selected in the EDITOR VERSION column. If an earlier version is selected, use the dropdown in this column to select the correct version for the project.
The project may open in the Unity Editor automatically upon locating and opening it in the file explorer.
Run Byte Wars
You can run Byte Wars directly in the Unity Editor, or you can build and run it as a .exe
executable file or a web page (WebGL).
Run Byte Wars in the Unity Editor
With Byte Wars open in Unity, go to the Scenes folder in your Assets and double-click the MainMenu scene file to make sure the MainMenu scene is open in the Hierarchy.
Play the game in the Editor.
Run Byte Wars from a package
- Windows
- WebGL
With Byte Wars open in Unity, go to File > Build Settings. Leave everything as default and click Build.
In the file explorer, choose the folder where you want to save the package file and click Select Folder.
Allow time for it to finish packaging your files.
Open the folder where you saved the file and open
ByteWars.exe
to play the game.
You can run Byte Wars right from a terminal with the following command:
ByteWars.exe -window-mode -screen-width 1280 -screen-height 720
You need the WebGL Build Support module installed on your Unity Editor. If you have not, you can install it using Unity Hub. Fo more information about adding the necessary modules, refer to the Unity Hub documentation.
Enable compression and data caching to optimize the packaged WebGL build. To do this, open Byte Wars in Unity Editor and go to File > Edit > Project Settings.
In the new window, select Player from the left panel, then select Settings for WebGL tab. Next, expand the Publishing Settings section and set Compression Format to Brotli and enable Data Caching.
Next, package Byte Wars as WebGL build. Go to File > Build Settings. Select WebGL as build platform and click Build.
In the file explorer window, choose the folder where you want to save the package file and click Select Folder.
Allow time for it to finish packaging your files.
Open the folder where you saved the file and copy it to your local web server.
Run the game by opening your local web server's IP address in a web browser.