-
Notifications
You must be signed in to change notification settings - Fork 0
The Game Processor
In First Steps we explained xayad and the blockchain part of the system. In this second tutorial we look at the Game State Processor (GSP).
The GSP consists of 2 main parts.
- libxayagame
- Game logic
libxayagame reads all the relevant game information from the blockchain through xayad's RPC and in conjuction with the game logic (which you write), calculates the state of the game. The state of the game could be the position of players on a map, how many gold pieces they have, what armour they are wearing, or whatever is important to your game.
It can store the game state in memory or in a database, such as SQLite or LMDB.
The GSP runs autonomously and processes new blocks as they come in, in real time.
It also records "undo data" that is used to backtrack through game states should a fork or reorg occur in the blockchain.
The GSP can run independant of a front end (GUI), but requires the blockchain to receive the data to compute.
Front ends talk to the GSP to receive the state of the game. This could be all at once, or the front end could request only specific amounts of data at a time.
Now you're ready to build and work with libxayagame in simple C++ Hello World and C# Hello World tutorials.
- Step 0: Blockchain Basics
- Step 1: xayad <⸺ start here
- Step 2: The Game State Processor
- Step 3a: libxayagame Component Relationships
- Step 3b: Compile libxayagame in Windows
- Step 3b: Compile libxayagame in Ubuntu
- Step 4: Run xayad for Games
- Step 5: Hello World! in C++
- Step 5: Hello World! in C#
- Step 6a: Mover Overview
- Step 6b: Mover Console
- Step 6c: Mover Unity