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 PlayPad) -> 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.) |
PlayPad SDK
Available through the package you can read more about here.
Note that these are meant for integration with 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 PlayPad SDK 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 a queue named
solo
(of Solo type) -
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
warningThere 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.
It should be working properly now, but a few steps are left to fully complete the integration:
-
Copy the lobby scene from the sample (remember to add it to the build settings!). Any other files you are willing to modify should also be copied with the exception of prefabs, which should be made into variants.
warningAlthough 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. -
If you use randomization, you should make it deterministic for a tournament to ensure fairness and keeping the challenge uniform between all the contestants. For that use
IServerHandlerGuid
to receiveInitialMatchPlayerDatasGuid
, then derive the seed frominitialMatchPlayerDatas.CustomMatchmakingData.TryGetValue(TournamentConst.TournamentIdKey, out var tournamentId)
andtournamentId.GetHashCode()
.
If it is not available (like in the Editor), randomize the seed the same way as previously.
Please note that providing unexistent tournament id for the match will prevent it from starting. -
Find
RttReporter
prefab and put it in your scene to ensure connection quality tracking.
The sample should now be integrated correctly 🎉
Your lobby is now ready to embrace your creativity regarding the design and functionality! 🎨