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.
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.
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
Name | Type | Description |
---|---|---|
Simple Menu | Menu scene | Simple menu scene with implemented matchmaking, all play modes and available games choose buttons. |
Empty | Gameplay scene | Empty project with Elympics included on scene. |
Button Clicker | Gameplay scene | Clicker-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 Demo | Gameplay scene | Sample with 2 players moving and throwing instantiable balls. |
Match events | Both scenes | A sample to illustrate the lifecycle of Elympics match. |
EGB test | Both scenes | A sample for checking response data from External Game Backend. |
Leaderboard test | Other | A 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.
Name | Type | Description |
---|---|---|
Asynchronous game lobby sample with leaderboards | Both scenes | Default 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):
- Update Elympics SDK to the newset version
- Install Newtonsoft (com.unity.nuget.newtonsoft-json)
- Install LobbyPackage or update it to the newset version
- Import the sample
- Import TextMeshPro essentials
- Add new scenes to the build settings
- Add the attached
Elympics Game Config
to the list in theManage games in Elympics
window and choose it as the active game (please note the known bug mentioned before in this article) - Starting from the lobby scene, test if the setup works correctly
To integrate your own gameplay:
-
In the console, create three
solo
gueues for your game -training
,eth
,telegram
-
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 -
Be sure to check “Use HTTPS/WebRTC” in your game’s
ElympicsConfig
in order to make Elympics SDK work with WebGL
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.
- 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 useawait
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();
}
}
- The sample should now be integrated correctly 🎉
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.