The technologies behind ExoPlanets
What we used in order to build the first browser based real-time multiplayer 3D crypto game — Backend to front.
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.
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.
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.
Solidity - Solidity 0.4.24 documentation
Solidity is a contract-oriented, high-level language for implementing smart contracts. It was influenced by C++, Python…
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.
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 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.
A-Frame - Make WebVR
A web framework for building virtual reality experiences. Make WebVR with HTML and Entity-Component. Works on Vive…
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.
SOCKET.IO 2.0 IS HERE FEATURING THE FASTEST AND MOST RELIABLE REAL-TIME ENGINE ~/Projects/tweets/index.js var io =…
Other notable technologies
We used Redis to store sessions, Express to handle routing and mongodb to save some essential variables and constantly backup everything.
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!