Skip to main content
Version: 5.11.8

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.

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

FunctionDescription
Custom accountCustom sign-up and login
GPGS loginFederation sign-up and login using GPGS login token
Login with AppleFederation sign-up and login using Apple login token
Token loginToken login with BACKND access token
NicknameCreate nickname
FriendFriend request, accept friend request, Look up friend list
SendQueueTransmit data using SendQueue

BACKND Match functions

FunctionDescription
Access match server / Terminate accessAccess match server and terminate access
In-game server access / Terminate accessAccess in-game server and terminate access
Binary message transmissionTransmit binary messages
View match recordView 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.)