PlayPad
PlayPad is a webGL game hosting application and our solution for facilitating communication between games and Web3. With this solution, the game does not communicate directly with Web3. Instead, it interacts with the PlayPad (using external communication interfaces) which then communicates with Web3.
This approach ensures that the game remains isolated from the complexities of Web3 interactions, allowing for a more streamlined and secure integration. The PlayPad acts as an intermediary, handling all the necessary communication with Web3 and providing a simplified interface for the game to use.
At the moment, Web3 integration for such games is supported only for WebGL but works properly on both mobile and desktop browsers. Additionally, the PlayPad supports Telegram, making it versatile for different user platforms.
Currently, we do not provide the PlayPad for self-hosting. Therefore, localhost testing will not work and will result in an error. Please use the solution provided below for a production environment simulation. For testing in the Editor check out testing article.
Uploading client game builds
We are working on the upload feature available directly from our developer console.
To provide a better and faster development experience right now, we are sharing a simple script which uploads to the PlayPad.
To run it, our support will provide an access key in the form of a JSON file which needs to be placed next the to script file.
Contact us on Elympics Developers Discord's playpad-key-requests* channel to receive a key.
The key will be named after game, for example awesome-game.json
Script dependencies
Script is compatible with all platforms where bash is available.
Works directly on macOS and Linux distros.
On Windows machines you can use WSL or git bash available via installer.
Scripts depend also on Google Cloud SDK, please follow install steps from Google Cloud documentation.
Script install
- Get a script from GitHub Gist
- If your game name is
awesome-game
then put your keyawesome-game.json
next toupload.sh
. - Make sure in same folder there is also a directory named
build
.
Your folder should look like this:
./awesome-game.json
./build
./upload.sh
Script usage
There are two modes to use - copy and sync, if you aren't sure - use copy.
- Upload a server build inside the Unity Editor.
- Create WebGL build using Brotli compression or none.
Be careful of using the same name twice to reupload a build, since it could result in your browser remembering previous version and a need to clear your browser cache (for exampleCTRL + SHIFT + R
on Chrome).
Instead, we encourage to use versioning for builds by creating builds with meaningfull names, e.g. using semantic versioning. - Copy game files from your WebGL build subfolder Build to the
build
folder. Note that base of their names (name of the directory the game was built into) will be used as a version indicator when composing the game link. - Run a script to copy all files from
build
folder to the PlayPad, it will overwrite files with the same file names (in such case remember to clear cache when trying to test your build).
bash upload.sh copy awesome-game build
Using sync
command will remove all previously uploaded files!
Your current files in build
folder will replace all existing ones.
Example output from bash upload.sh
upload.sh <task> <args>
Tasks:
1 copy
2 sync
usage: upload.sh copy/sync [game name] [build dir]
copy - upload files to cloud, overwrite already existing files in cloud
sync - remove all files from cloud and upload to cloud current files from disk
example of usage:
bash upload.sh copy good-game build_dir
bash upload.sh sync awesome-game builds/awesome
Task completed in 0m0.035s
Playing Your Game
To play your game, visit https://hosting.elympics.ai/ with a path leading to your game and one of uploaded versions to run.
For example https://hosting.elympics.ai/awesome-game/build-0.2.1
When launching the game for the first time, you will be asked to provide its game id for it to work properly.
To play with horizontal aspect ratio, you need to add parameter ?aspectRatio=16:9
to the link.
For example https://hosting.elympics.ai/awesome-game/build-0.2.1?aspectRatio=16:9
And to enable Brotli compression, ?extension=br
.
For example https://hosting.elympics.ai/awesome-game/build-0.2.1?extension=br
If you want to use both custom parameters, use &
inbetween them.
For example https://hosting.elympics.ai/awesome-game/build-0.2.1?extension=br&aspectRatio=16:9
This is not a production environment but a test environment. Links for the builds hosted on PlayPad should not be published for your game. Use this environment solely for testing and development purposes.
Testing in Telegram
- Search for "Elympics bot" at Telegram and click START if it is your first time.
- Type
/debug <link to your hosted game>
, for example/debug https://hosting.elympics.ai/awesome-game/build-0.2.1?extension=br
. - The bot provides you with a button to launch the game in Telegram.
In order to test Telegram games properly, you need to link your Telegram and Elympics accounts (not the developer's but user's one).