The technologies behind ExoPlanets

What we used in order to build the first browser based real-time multiplayer 3D crypto game — Backend to front.

ExoPlanets
5 min readJan 29, 2019

We here at ExoPlanets.io take great pride in what we have managed to accomplish, considering our rather small team and somewhat limited resources. The success of our endeavour, other than our ambition and hard work, relies on a combination of ingenuity, vision, and countless of coders that came before us and open sourced their work.

We’d like to share some of the amazing technologies we’ve harnessed and combined together to create this fully playable novelty — the 3D multiplayer exoplanets game.

Node.JS

Node makes a robust and streamline server. It allows wonderful performance due to its unblocking nature and great extensibility and compatibility due to the language it is written in. JavaScript became THE language of the web and the fact that almost all the components we needed to make this project work, both client and server side talk the same language was a real advantage.

NPM, node’s package manager, the largest ecosystem in code writing history, had ready made infrastructure for all of our JS needs, including the Ethereum blockchain node interaction, sockets and 3D modeling.

Working with JavaScripts on the server is fun, fast and easy to debug and remodel. It enables a lot of flexibility and easy to track modules, especially in a comparably modest project like our own.

Solidity

The language to write smart contracts on the Ethereum Blockchain is not a mature one, nor does it have a big community, code base or is easy to debug, but it is a real coding language and it allows for complex logic. Our greatest struggles in this project revolved around solidity, namely finding a way to validate transactions issued by our server and delivered by our users.

One of the main differences between a “normal app” and a decentralised one (a dApp), is that it runs on a Blockchain and not on a standard database, meaning that operations which involve registration or changing data on the blockchain require payment (gas fees).

In the ExoPlanets multiplayer game, we needed to allow our players to send server-signed transactions so that they will be able to pay for and mint new erc20 ExoTokens from our tokens contract, but only AFTER they actually harvested and mined them in the game, which runs on our orthodox centralized server.

Web3.js

Blockchain is envisioned to be the next generation of the web, to allow for a neutral, open, fare and secure cyber experience for all. If web2 brought the age of web applications, where everyone can share, contribute and become a significant part of the ever growing cyberspace, web3 is portrayed as the end of centralized data, an era in which data becomes transparent, objective and independent.

Web3.js is a neat javascript library that allows for a rather intuitive communication with the Ethereum blockchain.
This library served us tremendously in our marketplace and in the game itself, both front and backend. It has good documentation, great utilities for querying and registering data and it’s constantly being updated.

A-Frame

A-Frame is a truly amazing web framework for building 3D VR experiences.

Originally developed by Mozilla, it utilizes HTML structure to generate complex scenery and associated logic, one that can be easily integrated with common web technologies, a natural choice for our sort of endeavour.

We harnessed A-Frame from day 1 of ExoPlanets.io and used it to build a beautiful interactive 3D model for every exoplanet in the game. Later on this same technology helped us in constructing our own little universe, depicting everything within it in a beautiful 3d environment: stars, spaceships and foreign alien landscapes.

Sockets.io

Sockets is a fun to use, real time solution for javascript applications; it allows for an asynchronous bilateral communication between browser and server.

Thanks to sockets, the multiplayer feature is possible and our players can see each other’s spaceship flying around in space in real time, compete for minerals on planets’ surfaces and request to convert their hard earned resources to a minting request of new tokens on the blockchain.

Sockets gives our server a constant, instant control of the game: collecting and validating information, issuing orders and emitting essential data.

Other notable technologies

We used Redis to store sessions, Express to handle routing and mongodb to save some essential variables and constantly backup everything.

Summary

Building a game is not an easy task. Building a real time 3D multiplayer game is even harder, so building it for a browser and integrating it with the blockchain looked nearly impossible when we started, but we’re very proud in our success.

Modern web development has a lot to do with finding the right ingredients and learning how to use and combine them correctly. We have great admiration and appreciation for those who have contributed to the open source community and helped us in making our vision come true!

Written by our own lead developer Eko Goren & product manager Yaron Kachalon.

Eko Goren, Lead Developer
Yaron Kachalon, Product Manager

Relevant ExoPlanets Links:
Main Website
Multiplayer Game

Follow us on Twitter and join us on Telegram / Discord for more info and real time updates.

ExoPlanets Telegram:

--

--