TheBackendMatch
TheBackendMatch is a simple shooting game developed using BACKND Match.
This example was developed on Unity 2020.1.3f1 and BACKND SDK 5.9.0 dotnet4.
License
TheBackendMatch follows the BSD-2-Clause license.
The source code can be modified and used normally and commercially.
BACKND does not take responsibility for or guarantee the use of the source code.
The Unity package file contains the source code(Free Unityasset to launch the game) and some of the 3D model resources.
To use the model or source code for a private project, refer to the relevant link.
The 3D model resources contain the following free Unity assets.
https://assetstore.unity.com/packages/2d/textures-materials/sky/fantasy-skybox-free-18353 https://assetstore.unity.com/packages/3d/environments/landscapes/nature-pack-extended-66146 https://assetstore.unity.com/packages/3d/characters/meshtint-free-boximon-fiery-mega-toon-series-153958 https://assetstore.unity.com/packages/vfx/particles/spells/48-particle-effect-pack-13998 https://assetstore.unity.com/packages/vfx/particles/effect-textures-and-prefabs-109031 https://assetstore.unity.com/packages/3d/environments/meshtint-free-tile-map-mega-toon-series-153619The source code contains the following free Unity assets.
https://assetstore.unity.com/packages/tools/dispatcher-41637
Store links
Unity package file
Included functions
TheBackendMatch contains the following BACKND Base and BACKND Chat functions.
The BACKND functions used are only a part of the BACKND functions and may be added to the TheBackendMatch example game in the future.
BACKND Base functions
Function | Description |
---|---|
Custom account | Custom sign-up and login |
GPGS login | Federation sign-up and login using GPGS login token |
Login with Apple | Federation sign-up and login using Apple login token |
Token login | Token login with BACKND access token |
Nickname | Create nickname |
Friend | Friend request, accept friend request, Look up friend list |
SendQueue | Transmit data using SendQueue |
BACKND Match functions
Function | Description |
---|---|
Access match server / Terminate access | Access match server and terminate access |
In-game server access / Terminate access | Access in-game server and terminate access |
Binary message transmission | Transmit binary messages |
View match record | View match record |
How to launch the example game
1. Download the Unity package above.
2. Apply the relevant package in an empty Unity project.
3. Create a new project in BACKND Console.
- Get the Client App ID and Signature Key from the project. See the relevant documentation.
- BACKND SDK is already included in the source code, so there is no need to install it separately.
- On the left menu of the console, select BACKND Chat to activate it.
- On the left menu of the console, select BACKND Matchto activate BACKND Match.
4. Enter the Client App ID and Signature Key issued in Step 3 to The Backend > Edit Settings.
5. When the material is not applied to the character
If the material is not applied to Prefab or models and is displayed in magenta, install Univeral RP(Render Pipeline) on the upper section of Unity, from Window - Package Manager
.
After that, drag UniversalRednerPipelineAsset.asset in Asset > LWRP
to Player Settings > Graphics > Scriptable Render Pipeline Settings to apply it.
Apply the dead-reckoning technique
Player movement/rotation
- When the client sends a movement key packet, the host sends the direction of the movement and the current location of the client to the server to broadcast such information.
- Based on this information, the client moves to that location and maintains the movement direction until the next location packet arrives.
Bullet shooting
- When the client sends a bullet shooting key packet, the host sends the location of bullet creation and movement direction of the bullet to the server to broadcast such information.
- Based on this information, the client creates a bullet and moves it in the relevant direction.
Hit by bullet
- If the player is hit by a bullet, the host sends a message to the server to inform that the player is damaged in order to broadcast such information.
- The client applies the damage packet received from the server and applies it to the game to process damage.
- A wall getting hit by a bullet does not trigger synchronization. It is processed by each client.
- If the player is hit by a bullet in the client, not the host, it will be ignored.(Damage is not processed.)