Pong 2D: Getting started

Tutorial: Pong 2D Multiplayer in Unity – Getting started

This is getting started with Elympics tutorial! What is Elympics? How can I use it? Should I use it? Why?

Getting Started

In order to show you how to use Elympics in practice, and how easy it is to create multiplayer games, we’ve prepared a small demo of Pong 2D. This demo showcases local (hot-seat) multiplayer. In this tutorial we’ll use Elympics to migrate it to online, fully server-authoritative, deterministic and fair gameplay! Let’s get started! 💻💪

Pong 2D

Demo consists of basic functionalities of a pong-style game - moving pads (Player 1 - arrow keys, Player 2 - W / S keys). Ball bouncing, score counting and match control (win / lose conditions). This game can be downloaded here. Please feel free to follow along this tutorial!

Launch it and download Elympics!

After launching Unity, we can see our base Pong 2D game.

Pong 2D

Feel free to launch Play Mode and play around in local multiplayer (hot-seats) mode. To start our journey with Elympics, lets first download it using Unity Package Manager. Open it in unity in Window -> Package Manager.

Use the Add package from git URL and download Elympics SDK package by pasting this address: https://github.com/Elympics/Unity-SDK.git

Download Elympics

If all goes well, you should have some new menu bar items available: ParrelSync and Tools (with Elympics hidden inside). Now we’re ready to jump right to our multiplayer configuration.

Tools/Elympics

Configuring Elympics

In order to start creating multiplayer games using Elympics, first we need to create our local Game Config, which is an object that gathers all information about gameplay settings, synchronization, etc.

First, let’s log in to our developer account for Elympics. Go to Tools -> Elympics -> Manage games in Elympics.

Tools/ManageGames

Input your login credentials (email and password). Make sure that your Elympics Web Endpoint is set correctly to https://api.elympics.cc and that it’s marked as Connected.

If you don’t have an Elympics account, you’ll need to create one here.

Then click Synchronize to download your current endpoints and game configurations.

Before completing the next step, you’ll need a configured Elympics game in our web panel.

The next step is to create a Game Config object for our game. Note that this is a local (Unity) game config, but it needs to be synchronized with the web. We don’t have any configs now, so let’s create one with Create first game config!.

Create Game Config

Now copy the name and identifier from games list displayed below your account data. Set your version number and select the gameplay scene PongDemo.

Gameplay scene is the scene that Elympics will launch once your players are connected to the game.

Pong Settings

Ok, ready!!

The configuration is done! The last step of setup is to add Elympics root object to your gameplay scene.

Final step: configuring the scene

In order to use Elympics during gameplay, we need to add main Elympics object (prefab) to our scene. To do that, right-click in your scene hierarchy and select ElympicsSystem.

Elympics System

Congratulations!! 🎉🎉

You’ve successfully integrated Elympics package to your game! In the next part we’ll focus on adding world synchronization and input handling. 🎉🎉