The Game Processor - RenegadeMinds/testbed GitHub Wiki
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.