Etherscape
  • Etherscape
  • Gameplay
    • Rogue-Lite
    • Play to Earn
      • Earn Gems
      • Kepithor Rewards
    • Characters
    • Multiplayer
    • The World
      • Heroic Quests
      • The Arena
      • Open World Events
      • Daily Bonuses
    • Economy
      • ✨Item Properties
      • ⬆️Account Upgrades
      • ⚔️Item Drop Rates
      • 🪙Token Types
      • 🗝️Heirlooms
      • ⚖️Currency Market
      • 💎Enjinite
      • 🐰Pets
      • 🧙Skins
    • Crafting
      • Crafting Station
      • How to Use the Etherforge
    • Gathering
    • Mastery System
    • Achievements
    • Social
    • Timed Events
      • Endurance of Light
      • Multiverse Quests
      • Rise of the Frozen Blight
      • Clockwork Invasion
  • Platforms
    • Input Types
  • Crypto Integration
    • Blockchain
      • Validators and Pools
      • Wallet Linking
    • Community Wallet
    • Etherbound Items
    • Governance
      • Imperial Sovereigns
      • Governance Rewards
      • Proposal History
      • Prop 12: Loot Flow Control
    • Multiverse Support
      • Enjin Multiverse Support
      • Custom Collaborations
      • Generic Multiverse Bonuses
    • Future Plans
      • Mastery System
      • Guilds
    • Enjin Blockchain Tips
  • Development
    • Release Notes
    • Feature Roadmap
    • Architecture
      • Latency Management
    • Bug Bounties / Bans
    • Submitting Debug Logs
  • Legal / Policy
    • Streaming
    • Community Wallet Disclaimer
    • In-Game Currency Disclaimer
    • Cheating Policy
    • Community Conduct Policy
Powered by GitBook
On this page
  • How The Etherscape Works
  • Client Server Setup
  • Storage
  • Auth
  • Blockchain
  1. Development

Architecture

PreviousFeature RoadmapNextLatency Management

Last updated 1 year ago

How The Etherscape Works

The Etherscape has built an online service designed to scale up to large numbers of concurrent players while enabling them to securely mint custom NFT items onto the Enjin blockchain. Below is an architecture diagram of how this is done along with some brief descriptions about how the different parts work.

Client Server Setup

Storage

  • Account information (email, wallet address)

  • Character data (level, class, stats)

  • Item data (random loot drops, resources, etc.)

  • Requests to mint items onto the blockchain

  • Global state (ex. next token id to use)

Auth

Firebase auth is used to create and authenticate user accounts. This is convenient since we are already using the Firebase suite for storage. Using Firebase we can easily create user accounts based on a player's email address. Once they log in, we can retrieve their token and use that to authenticate securely with the game server. Firebase will generate a user id for them which we use as they key to store their data in Firestore.

Blockchain

  • The player finds an item in the game with random properties they like.

  • The player acquires the necessary resources in game to "craft" the item into an NFT.

  • The player triggers the minting process in game.

  • The game server writes a work item to Firestore which includes the item metadata.

  • The resources and item are deleted from the player's account.

  • A minter process running in the cloud picks up the work item to process.

  • The minter finds the next valid token id to use for the collection.

  • The minter writes the metadata for the item into Firestore at a well-known location for the token id.

  • The minter calls the Enjin Platform to create a new token which will read its attributes from the well-known location in Firestore for the token id.

  • Once the item is minted, the work item is marked complete.

  • The game server sees the work item is complete and updates the players in game items to include it.

It would be possible to adjust the platform to write the attributes directly into the token. However, this would make the token about 5x more expensive to mint since it needs a reserve for reach attribute as opposed to just a single attribute with the URI.

For the game client and server, we are using with the library. It is written as a single codebase which makes it easy to iterate on, testing quickly by hosting the client and server on the local box in a single process. Then, for shipping to users, compile time variables can be used to remove all of the server specific code from the client.

The servers are hosted on small 2-core windows VM's in the cloud. Azure was chosen because the team is already familiar with it. However, other cloud providers like Amazon or Google would also work fine. The VM's run a Windows service which interacts with the system to check for new game builds and download and run them automatically. This enables quick and easy release automation. Scaling up can be done easily by adding more VM's.

For the live game service to run, it is necessary to store many kinds of data. For data storage, we are using the NoSQL database which is part of the suite. Firestore was chosen because it has integration with Unity and has all the necessary features needed. The following data is stored in Firestore...

One of the core gameplay mechanics for The Etherscape is to allow players to mint random loot drops onto the blockchain. In order to do this, we use the to interact with the . This is used to securely validate a user owns a wallet, read the tokens they own and trigger transactions to mint NFT's to their wallet. The workflow for minting a token looks like this.

Unity
Netcode for GameObjects
Azure
Unity Cloud Build
Firestore
Google Firebase
Enjin Platform
Enjin Matrixchain
The Etherscape Architecture