Cardinal
Getting Started

Getting Started

The easiest way to get started with building a Cardinal game shard is via the starter-game-template (opens in a new tab). To get the template, run the following command in your preferred development directory:

git clone https://github.com/Argus-Labs/starter-game-template

Anatomy of the Starter Game Template

The starter game template has 2 directories, but you will only need to worry about the cardinal directory.

Cardinal

Cardinal is where the game logic lives. We recommend the following directory structure to organize your code:

  • component: component definitions
  • system: system functions implementations
  • query: query implementations for your game state (used by external clients)
  • tx: transaction definitions

The starter game template comes with some existing code in these directories, so you can get a feel for how things should be organized and implemented.

Nakama

Nakama is where the relayer and account abstraction layer lives. We expect most people to use our version of Nakama, which comes with a few benefits:

  • Automatically set up RPC endpoints for game clients to hook into the Cardinal game world
  • Handle account abstraction and persona tags (similar to gamer-tags)
  • Allows for account authentication using a third party account such as Google, Facebook, or Steam
  • Allows for non-chain interactions with backend Cardinal systems for easy testing and development

Docker Compose

The starter-game-template contains a Docker Compose (opens in a new tab) configuration that can run several cardinal related services locally.

  • cardinal: The aforementioned cardinal based game server
  • nakama: A pre-build Nakama image that can communicate with the game server
  • postgres: The storage layer that Nakama depends on
  • redis: The storage layer that Cardinal depends on
  • testsuite: Some sample integration tests that verify Nakama and Cardinal are communicating correctly