Skip to main content

Package Samples

Some of our sample resources are downloadable inside the Unity Editor. They are minimalistic projects showcasing some of our features. The samples can be used as a learning example or as a basic setup in the prototyping phase of your game.

To find them, go to Package Manager -> Elympics (or Elympics External Communicator) -> Samples.

Then click Import button next to the sample of your choice.

If it contains a Gameplay scene, remember to add the attached Elympics Game Config to the list in the Manage games in Elympics window and choose it as the active game.

Known bug

There is a bug that won't allow developer to add an ElympicsGameConfig to the list manually. To do so, please delete ElympicsConfig and recreate it using Manage games in Elympics view like when starting your project.

Samples location

tip

If you want to make changes on the Gameplay scene and be able to upload your own builds, register your own game in the Elympics panel and change GameConfig in Tools -> Elympics -> Manage games in Elympics in Unity.

Available samples

Elympics

NameTypeDescription
Simple MenuMenu sceneSimple menu scene with implemented matchmaking, all play modes and available games choose buttons.
EmptyGameplay sceneEmpty project with Elympics included on scene.
Button ClickerGameplay sceneClicker-type game for 1-4 players. (Remember to set the player count in game config and used queue name to p1/p2/p3/p4.)
Tech DemoGameplay sceneSample with 2 players moving and throwing instantiable balls.
Match eventsBoth scenesA sample to illustrate the lifecycle of Elympics match.
EGB testBoth scenesA sample for checking response data from External Game Backend.
Leaderboard testOtherA sample to illustrate usage of leaderboards. (Works only if your game has generated any leaderboard data.)

Lobby Package

Available through the package you can read more about here.

Note that these are meant for Playpad but can be run in the Editor too.

NameTypeDescription
Asynchronous game lobby sample with leaderboardsBoth scenesDefault implementation of asynchronous game lobby with leaderboards, ready to use and adjust to developer's needs.

Asynchronous game lobby sample with leaderboards

Feel free to use this sample's lobby scene for testing and as a base for your own project. You still need to integrate the gameplay scene you created.

Running the sample in the Editor (already done steps can be skipped):

  1. Update Elympics SDK to the newset version
  2. Install Newtonsoft (com.unity.nuget.newtonsoft-json)
  3. Install LobbyPackage or update it to the newset version
  4. Import the sample
  5. Import TextMeshPro essentials
  6. Add new scenes to the build settings
  7. Add the attached Elympics Game Config to the list in the Manage games in Elympics window and choose it as the active game (please note the known bug mentioned before in this article)
  8. Starting from the lobby scene, test if the setup works correctly

 

To integrate your own gameplay:

  1. In the console, create three solo gueues for your game - training, eth, telegram

  2. Select your own game as an active one in Manage games in Elympics view. Also remember that your gameplay scene has to be added in the build settings

  3. Be sure to check “Use HTTPS/WebRTC” in your game’s ElympicsConfig in order to make Elympics SDK work with WebGL
    WebRTC setting

warning

There is a known bug, that when building to WebGL this checkbox is set automatically, but it doesn’t really work. In such case you have to check it when using another build target, be sure to save, upload new server build and only then you can proceed with building on WebGL. You will see in a version control tool if the change occured properly.

  1. Do not forget to include respect fetching in your game if you haven't already. The sample may help you with this task by providing easy way of accessing matchId. When using method below use await if you want to wait for it's result or .Forget() otherwise
private async UniTask DisplayRespect()
{
if (ElympicsLobbyClient.Instance == null
|| !ElympicsLobbyClient.Instance.IsAuthenticated
|| ElympicsLobbyClient.Instance.AuthData.AuthType is AuthType.None or AuthType.ClientSecret)
{
respectText.text = "Log in to earn respect";
}
else
{
var respectService = new RespectService(ElympicsLobbyClient.Instance, ElympicsConfig.Load());
var matchId = FindObjectOfType<PersistentLobbyManager>().CachedMatchId;
var respectValue = await respectService.GetRespectForMatch(matchId);

respectText.text = respectValue.Respect.ToString();
}
}
  1. The sample should now be integrated correctly 🎉
tip

Copy the lobby scene from the sample (remember to add it to the build settings!) and adjust it to match your own design and functional needs! Any other files you are willing to modify should also be copied.
Although using these directly from Samples directory may be possible, it is not recommended as updating the package (and reimporting the sample) would erase your changes.