Clone and run Byte Wars - Initial setup - (Unity module)
Clone the Byte Wars repository
You can find the Byte Wars AMS project from the tutorialmodules-ams
branch on the Byte Wars Unity GitHub repository. Use the Git command below to clone the project.
git clone -b tutorialmodules-ams https://github.com/AccelByte/accelbyte-unity-bytewars-game.git
Open the Byte Wars project in Unity
Launch the Unity Hub. From the side panel, select Projects and click on the Add button. From the dropdown, select the Add project from disk.
On the pop-up window, locate the Byte Wars project you cloned and click ont he Add Project button.
Once done, the Byte Wars project will be listed on the Unity Hub. Make sure the EDITOR VERSION is set to 2022.3.50f1.
Click the project entry from the list to open it on the Unity Editor.
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
Open Byte Wars project in Unity Editor. Then, go to the Assets/Scenes folder and double-click the MainMenu.unity scene file to open the Main Menu scene.
Click on the play button to start the game in the Unity Editor.
Run Byte Wars as game build
- Windows
- WebGL
Open Byte Wars project in Unity Editor. Then, go to File > Build Settings.
On the Build Settings window, select Windows, Mac, Linux for the Platform and choose Windows as the Target Platform. Then, click on the Build button to build your game client as executable.
In the file manager window, choose the folder where you want to save the game build file and click Select Folder button.
Unity will start to build and package your game. Once it is done, open the folder where you saved the game build. Then, run the
ByteWars.exe
to start the game.
You can also run Byte Wars from terminal using the command below:
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.
First, you need to 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 the game as WebGL build. Go to File > Build Settings. Select WebGL as build platform and click on the Build button.
In the file manager window, choose the folder where you want to save the game build file and click Select Folder button.
Unity will start to build and package your game.
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.