Overview - SpaceXpanse/Documentation GitHub Wiki

SpaceXpanse Multiverse platform provides a convenient solution for developers to put their decentralized applications aka dapps up to 100% on the blockchain. The following materials can help you get started quickly.

The SpaceXpanse ROD blockchain is a decentralized data store. And there are 3 main components to an application or game.

  1. Daemon or headless part of ROD core wallet
  2. Game state processor or GSP
  3. Front end or Metaverse

The daemon (spacexpansed) is the software that interfaces with the ROD blockchain. It has a JSON-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 dapp/game is displayed for users/players. It consumes game states. 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 SpaceXpanse Multiverse 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, SpaceXpanse Multiverse is much, much more than just that. It's a complete decentralized application platform. How and why that is will become apparent as you progress through the various tutorials and documents here and see how SpaceXpanse Multiverse enables decentralized metaverses.

Step 1: spacexpansed

Read and complete the Step 1: spacexpansed 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 SpaceXpanse.

Step 2: The Game State Processor

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

Step 3: libspex

The core of the GSP is libspex. It does much of the heavy lifting for blockchain operations, and nicely isolates developers from that complexity so that they can focus on creating their dapps/games.

Read libspex component relationships for a high-level overview of libspex and how it interacts with other components.

In order to stay up-to-date with the latest improvements and feature additions, it's recommended to compile libspex on your own. Using git will keep your libspex code fresh with the latest version and compiling is very simple with the provided scripts in the "HOW TO" documents below.

See here to compile libspex in Windows or here to compile libspex in Ubuntu.

Step 4: Run libspex for Games In Step 1 above we learned about the SpaceXpanse daemon, spacexpansed, and how to issue some RPC commands to it. There was quite a bit in there.

Running spacexpansed for dapps is very short and well worth the 3 minutes it takes to read to refresh your memory and get a solid grasp on just what the most important options are for you to run spacexpansed properly.

If you encounter any errors while trying to run a game or application, the first thing to check is whether or not spacexpansed is running properly.

Step 5: Hello World!

Hello World is a simple SpaceXpanse game that you can build. Once you've finished, you'll have mastered 90% of everything you need to know to build your own games on the SpaceXpanse Multiverse platform.

Hello World in C++ is a long, thorough tutorial where you code every line and where every line is explained in detail.

Hello World in C# is a quicker tutorial that focuses on the bare basics of the SpaceXpanse platform. Pre-compiled binaries for libspex are included with the sample solution so you can run it immediately, set break points, and dive straight into the code. The tutorial itself includes videos and walks you through all the most important aspects of building a game on the SpaceXpanse platform without getting into too much nitty-gritty details. For those details, the code is extensively commented, and you can study those on your own.

Hello World! with SQLite is a C++ console application tutorial that shows you how to use spacexpanse::SQLiteGame. Before you start on your own game, you should read this. SQLiteGame makes developing your blockchain game far easier than using a CachingGame. Further, you can build MASSIVE game worlds with SQLiteGame. This is most likely how you will choose to make your game.

Keep in mind that ALL 3 of these Hello World implementations are for THE EXACT SAME GAME and if you want to play the game, you can equally use any of them.

Further, you could easily write your own version in Python, Ruby, or any other modern programming language.

Go further with Mover

Now that you've got some experience with the platform, it's time to look at implementing game logic. Hello World didn't have any significant game logic, but with Mover we have some very simple game logic to examine.

Start with the Mover Sample Game Overview. This is a high-level overview to explain the various moving parts and concepts behind Mover.

Once you've completed that, you can dive into the code.

Again, we have multiple tutorials for you, depending upon your preferences.

The Mover console tutorial is a C# console application with a code walk-through. Much of what is in the code walk-through you've already seen in Hello World, so those portions you can skip. The main content to focus on is how the game logic is implemented in the 3 callbacks.

The Mover sample game in C# with Unity tutorial is substantially the same as the Mover Console Tutorial, but adds in a front end with Unity. This is closer to a "real world" example of a game. Again, as above, the main content to focus on is how the game logic is implemented in the 3 callbacks.

Both the Mover console and Mover Unity games are the exact same game, just as with Hello World above. You could easily write your own Mover game in Java, Ruby, Python, or any other modern programming language just by porting the code for the callbacks properly and then wiring up libspex as described in other documents.

Next...

If you've completed the above steps, you're in a very good position to begin programming your own blockchain-based dapp/game.

Make certain that you've reviewed the tutorial on SQLite as that is probably the best choice for you to create a game on the SpaceXpanse Multiverse platform.

The next thing to do is to explore other documentation linked in the sidebar navigation. There's a wealth of information there and most is very easy to get through quickly.

Developer Support

If you have questions, visit the SpaceXpanse Multiverse Discord channel. You can ask questions and get answers there.