Byte Wars is the official tutorial game for AccelByte Gaming Services (AGS). It is intended to act as a sample project that can be used as a reference on the best practices to integrate our services into your game. We created Byte Wars from scratch as a fully functional offline game. This offline game was then brought online with the power of AccelByte’s platform by adding different services from each of our service areas like access, play and engagement. Every tutorial module walks you through a step by step guide to add a specific feature to Byte Wars which you can then translate into your own game.
- Use Unity Editor 2021 LTS with minimum version 2021.3.16f1.
Byte Wars published the source code in two branches:
- main branch is the vanila version game source code without AccelByte's plugin and will in use for Tutorial Module 1: Initial Setup.
- tutorialmodules branch is the branch that has the AccelByte's Plugins and all the Byte Wars tutorial modules with feature flag.
Just run the following git command to clone the game.
git clone git@github.com:AccelByte/accelbyte-unity-bytewars-game.git
The tutorialmodules
branch has a package of AccelByte Unity SDK setup in package manager from the following GitHub link:
This AccelByte Unity SDK package are required to follow along the Byte Wars Tutorial and it will be automatically downloaded when the project opened for the first time.
To clone the repository and checkout the tutorial branch, run the following command:
git clone --branch <branch-name> git@github.com:AccelByte/accelbyte-unity-bytewars-game.git
- From Unity Hub, go to Projects sidebar and click open in the project panel
- A file browser will appear, then select Byte Wars project folder and click open.
- The Byte Wars project will be added into the project panel with the editor version. Click on the project to open it in the Unity Editor.
- Open the Byte Wars project on your Unity Editor.
- From project window, go to Assets>Scenes then double click MainMenu scene file. Make sure MainMenu has opened in the hierarchy.
- Open the Byte Wars project on your Unity Editor
- In your menu taskbar, go to File > Build Settings, a popup window will appear and and leave build setting as default and click build button.
- Select the destination folder to save the package file and press select folder button.
- Open the destination folder and double click the ByteWars.exe to play the game.
- Build Server run:
build_server.bat
- Build Client run:
build_client.bat
- To enable debug mode add
BYTEWARS_DEBUG
in Edit -> Project Settings -> Player -> Script Compilation -> Scripting Define Symbols. please removeBYTEWARS_DEBUG
scripting define symbols before publish/release it - To test peer to peer server and act as host on branch
Main
orMaster
, addBYTEWARS_P2P_HOST
in Scripting Define symbols
Peer to Peer mode is currently disabled, to enable it check Assets\Scripts\UI\MainMenu\PlayOnlineMenu.cs
line 28
.
Follow along Byte Wars Tutorial Module 2: Getting Online.
To revert files with only line ending difference use --renormalize. Example this command will revert all prefabs with only line ending difference and also stage (add) other actually changed prefab files.
git add --renormalize *.prefab