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 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.

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.)

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.

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 PlayPad SDK 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 a queue named solo (of Solo type)

  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.

It should be working properly now, but a few steps are left to fully complete the integration:

  1. 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.

    warning

    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.

  2. For randomization, mid-game disconnections and errors handling, and more, use GameplayNetworkManager prefab:

  • GenericSoloServerHandler is responsible for initial randomization seed determination, starting the game and handling client disconnections on the server side - remember to remove conflicting DefaultServerHandler script from Elympics GameObject (or if you have your own one, merge the functionality)
  • MatchConnectionHandler is responsible for client-side errors and temporary disconnections handling; it also hides persistent MatchConnectingMask on OnConnected - remember to add MatchDisconnectionMask script to work with it (you can use DisconnectionMask prefab for that)
  • SoloMatchEnder is used for mid-game disconnection handling and also should be used by the developer directly to end the game (with proper configuration, it allows for 0 score mathers to be treated as not played ones) - it requires your score system to derive from SoloScoreProviderBase
  • SynchronizedRandomizer can be used in your game as a source of randomization - you can easily replace its implementation by removing the script from the prefab and providing your own one deriving from SynchronizedRandomizerBase
  • Customize MatchesConfig ScriptableObject options if needed - remember to move it to your own Resources folder (remember to delete it from the sample if you reimport later, so there are no Load conflicts)
  1. 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! 🎨