Skip to content
Ryan edited this page Feb 26, 2019 · 41 revisions

Overview

XAYA provides a convenient solution for developers to put their games up to 100% on the blockchain. The following materials can help you get started quickly.

The XAYA blockchain (daemon) is a decentralised data store. There are 3 main components to a XAYA application or game.

  1. XAYA daemon
  2. Game state processor
  3. Front end

3 main parts

The XAYA daemon (xayad) is the software that interfaces with the XAYA blockchain. It has an RPC interface to create accounts, make moves in games, etc.

The Game State Processor (GSP) is where moves are processed, and new game states are created.

The front end is where the game is displayed for players. This is what players interact with. All the blockchain goodness is invisible to them.

We'll look at the different parts in order, gradually building up to the point where you can confidently create your own games on the XAYA platform.

Step 0: Blockchain Basics

If you're not familiar with what a blockchain is or how cryptocurrencies work, we recommend that you read Blockchain Basics. This will provide you with a high-level overview of what a blockchain is. The shortest answer is that it's a secure decentralised data store. However, there are many benefits to it that are non-obvious.

Still, while blockchain is just a data store, XAYA is much, much more than just that. It's a complete decentralised gaming platform. How and why that is will become apparent as you progress through the various tutorials and documents here and see how XAYA enables decentralised autonomous worlds.

Step 1: xayad

Read and complete the Step 1: xayad tutorial here before you do anything else. It will give you a high-level overview and understanding of important fundamentals that you must understand in order to progress with XAYA.

Step 2: The Game State Processor

In the Step 2: The Game State Processor tutorial here we learn about the XAYA Game State Processor (GSP) and its relationship to other components.

Next...

The Guides and Tutorials section below provides high-level overviews of the various documents and tutorials.

Things to Skim Quickly

Skim over the following documents. Don't worry if you don't understand everything. A quick skim will familiarise you enough so that you'll find new material easier to follow as you progress through various tutorials and documents.

Background and Additional Information

For some background information, read through this section to see what parts of XAYA you're most interested in.

XAYA Specifications

Reading the XAYA Specifications will give you a high-level overview and familiarise you with various concepts and details. This is highly recommended reading and is considered reference material.

Wallets

Wallets are critically important. Read the Wallets section of the XAYA Electron wallet help for a quick high-level overview if you're not already familiar.

The XAYA CLI

Some tutorials use the XAYA Command Line Interface (xaya-cli). Read up on xaya-cli here.

XAYA RPC Methods

Next, read about XAYA RPC Methods. You'll need to know how to send RPC calls to the XAYA daemon. This will get you up to speed quickly.

libxayagame: The Core Engine for Games

The libxayagame Component Relationships shows you the basic architecture. It details how your game logic and front end interact with XAYA.

Start Coding with Hello World

If you skipped Step 1 and Step 2 above, well, it's time to get started coding! Let's jump into the deep end!

The Hello World tutorials are good templates for you to learn and begin coding your own games. Everything you need for a game is in there. (More complex games require more, but for simple games, Hello World is a decent template.)

Start with Hello World! in C++ or Hello World! in C#.

NOTE: The Hello World tutorials do not have any significant game logic, which makes them very easy to follow. Game logic is the part that game developers create.

Hello World in C++

The Hello World! in C++ tutorial is a thorough walk through for you to create a functioning game. This is strongly recommended for all developers.

Hello World in C#

Hello World! in C# includes a fully functional example project and several videos. In this tutorial, you'll learn how to wire up a working XAYA game.

Mover

The Mover Overview document provides a high-level view of what Mover is and does.

Once you've read that, try one of the Mover tutorials. The console MoverSharp tutorial demonstrates simple game logic, but does not get into updating the front end.

The Mover in Unity tutorial goes over much of the same material as the console version, but adds in updating the front end. This is ideal for Unity game developers to use as a template.

Developer Support

If you have questions, visit the XAYA Development forum. You can ask questions and get answers there.


Guides and Tutorials

The following are quick decriptions of the various documents and tutorials mentioned above. You can read through here to get a high-level overview.

For game developers, this is the first place you should look to get started with XAYA game development. The sections below are loosely arranged in order. You can read them from top to bottom, but feel free to skip around.

Additional resources will be added on an ongoing basis.

Blockchain Basics

If you're unfamiliar with blockchain technology, Blockchain Basics will give you a quick overview and highlight some important aspects. This is a quick, high-level overview and far from exhaustive. If you are already familiar, you should skip this.

XAYA Specifications

The XAYA Specifications repository contains technical specifications and design documents that describe how the various components and layers in the ecosystem interact. In particular, important topics are:

The specifications are required reading. Other documents will refer to specific sections of the specifications.

NOTE: The specifications contain some difficult material. You do not need to understand it all at once. However, as you progress you should refer back to it from time to time. If you don't understand something, just move on. You can also post in the XAYA Development forums.

XAYA RPC

XAYA uses RPC (Remote Procedure Calls) to communicate with the XAYA daemon (xayad). The daemon contains many of the same methods that you may already know from Bitcoin. It also contains methods unique to XAYA. The documents here will help you with those unique methods and provide some additional guidance on their purpose.

XAYA is language agnostic, so you can use any language you wish so long as it is capable of making RPC calls.

XAYA RPC Methods

The XAYA RPC Methods document describes several of the most useful RPC methods and provides examples. It is language agnostic and you should read this first.

RPC Windows C# Tutorial

The RPC Windows C# Tutorial uses a 3rd party library to demonstrate using several XAYA RPC methods. A sample Windows Forms application is provided with comments to assist you.

libxayagame

The libxayagame library lets developers focus on building blockchain games without worrying about any of the inner workings of the blockchain, such as reorgs. That is, libxayagame does some very, heavy, heavy lifting for you.

Instead, it provides a simple framework for you to code your games on top of the XAYA platform.

Once you have libxayagame wired up, you only need to implement 3 callback methods. The Mover example shows you how to do this.

Code ninjas and rock stars may enjoy browsing through the code or code documentation available here.

Component Relationships

The libxayagame Component Relationships document provides a high-level overview of the component relationships and information flows when using libxayagame. While it aims to explain the Mover sample game, other scenarios are briefly outlined.

How to Wire Up libxayagame in C#

This very short tutorial explains how to add libxayagame to a project.

Hello World!

This is a step-by-step "Hello World!" tutorial and a good place to start. Make certain that you've covered the "getting started" basics first.

Mover Sample Game Overview

Mover is an extremely simple game that uses the libxayagame library. The goal of Mover is to help you easily build your game.

Both libxayagame and Mover are written in C++. The Mover sample includes a game test written in Python. For more information, see the Mover Sample Game Overview tutorial.

Mover Sharp - A C# Implementation

MoverSharp is a truncated C# implementation that does not allow user input. It merely displays moves.

This tutorial illustrates how libxayagame is wired up for Mover and then explores game logic on the XAYA platform.

Mover in Unity

For C# developers, the Mover example has been ported to C# along with code to wrap the libxayagame C++ library.

The Unity project provides a front-end GUI for Mover. The wrapper and additional code implement the Mover game itself.

Regtestnet

Regtestnet is what you should primarily use during development instead of mainnet or testnet. At some point you may wish to move your testing to testnet, but that shouldn't be your first choice.

The regtest option gives you a private XAYA network where you have complete control.

You can instamine CHI at will and control exactly when and how blocks are mined. You can invalidate blocks, and undo that.

See the "Getting Started with Regtestnet" tutorial for more information.

Getting Started with xaya-cli

The XAYA Command Line Interface lets you easily interact with the XAYA daemon and XAYA wallets. It's used extensively in various tutorials. This tutorial introduces xaya-cli and gives examples that you can practice with to learn it very quickly.

XAYA Electron Wallet Help

This is end user documentation for the XAYA Electron wallet.

Clone this wiki locally