Let's have a look at the NextColony game architecture. This will explain the nature of a blockchain games in general and provide some insight into our game.
Warning: This might be a little bit technical.
Let's see what happens when a gamer clicks a button in the web app:
- The user clicks a button to produce a ship in the web client.
- We use SteemConnect and the authority we got from the login to create a transaction with custom information attached.
- The transaction with the custom information to build a ship is sent to the steem blockchain and will be included in a block.
- We load the transaction out of the Steem blockchain with our game server.
- We process all the streamed transactions from the Steem blockchain and apply our game logic and store the results in the database.
- The web client reads the game state out of our back-end server and can display the newly built ship.
Some implications of this architecture (and blockchain gaming):
- Every game activity is issued as a blockchain transaction.
- The game can only be as fast as the blockchain. Luckily steem is fast.
- The entire game state can be replayed from the steem blockchain (for example if the game DB is wiped).
- Users can also play the game by issuing blockchain transactions through another web client or bot.
- All consistency checks are done in the game server and illegal blockchain transactions are filtered out there. (For example building ships without resources could be issued as a blockchain transaction but would be rejected by the game server.)
- The game state is always known to everyone as the blockchain information and all activity is public and decentralized.
Let's look at two game concepts of NextColony that we designed in order to leverage the blockchain game approach:
- We create new planets through exploration randomly by using the blockchain ID's as seeds.
- This means that we can generate a unique galaxy while the game is played
- We can offer unexplored space and exploration even though the blockchain is fully public
- It also means that we can replay and recreate the random creation of planets based on the blockchain information
- The random creation can be verified with the blockchain and our algorithm.
- We create unique id's for planets/items based on the blockchain.
- This allows gifting of planets/items to other users with full tractability and fully identification of the item
- It will also allow trading of planets/items like you know from other blockchain games.
That's it for now. Stay tuned for more insights into NextColony and blockchain game concepts.
You can find a deep dive into id generation and randomness by @holger80 here: https://steemit.com/nextcolony/@holger80/nextcolony-about-the-unique-id-generation-and-rng