💻

Nine Chronicles Source Code Guide

Currently, Nine Chronicles is comprised of three major projects:
1.
🎮 Unity game client (user interface)
2.
🌐 Blockchain node (processes transactions, performs mining)
3.
🚀 Launcher (manages node and client software, private key, handles installation and update)
NineChronicles_Projects-Page-3.png

🎮 Unity Client

The source code for the game client is located at github.com/planetarium/NineChronicles. This repository houses the entire Unity client of the game, including the interface and graphics resources.
img02_(1).gif
Untitled.png
Nine Chronicles in Unity Editor
The whole repository is licensed under GPL-3.0, meaning anyone can fork this repository to make their own versions of Nine Chronicles, as long as they also remain open source. It doesn't even have to be a blockchain game, so imagination is the limit, really.

🌐 Blockchain Node

Much of the game logic actually lives not in the game client, but in the blockchain component of Nine Chronicles. This is because every in-game action needs to be simulate-able and verifiable by other nodes in the network. You can think of the Unity Client as an interface that replays game actions created on the blockchain network.

Nine Chronicles Headless

The blockchain node for Nine Chronicles is nicely nested in a wrapper project called NineChronicles.Headless.
A headless build is a software capable of working on a device without a graphical user interface. NineChronicles.Headless launches the full node of Nine Chronicles without the UI, so you could for instance launch a headless build and write a command-line app to grow your characters on the Nine Chronicles network.
Actually, the Unity game client talks to this exact headless node via RPC to receive game data and issue actions. There are projects like CryptoKasm/9c-swam-miner which wraps the headless build into a simple script for those wanting to mine their own NCG income.

lib9c

Lib9c is a library that contains key implementations of Nine Chronicles. Lib9c includes Nine Chronicle's key features like in-game decisions and data models, which can be used to implement core features of the game.
If you want to implement a new in-game logic (for example, a global level boss), this is the repository you would modify.
Inside the Actions folder, you will find many classes that correspond to in-game actions that players can make. Lib9c also houses a behavioral-tree simulator which are used to generate verifiable battle results.

Libplanet

Finally, Libplanet is a .NET library for creating multiplayer online game in decentralized fashion. This means the whole gameplay occurs on a peer-to-peer network among equal nodes rather than an authorized central server. Under the hood, it incorporates many features (e.g., digital signature, BFT consensus, data replication) of a blockchain.
This is the underpinning blockchain technology that holds everything together! Documentation for Libplanet are hosted on docs.libplanet.io.

🚀 Launcher

Launcher is the critical piece of software that manages the node and client software, players' login info, installation and update.
image_(63).png
Login screen
It is based on a cross-platform toolkit Electron, and we will expand the Launcher to be able to run javascript addons talking to the GraphQL API. Meanwhile, once you have the launcher set up, you can interact with it through the playground app: e6c8059ca33b3742.pngNine Chronicles GraphQL API Guide.

Curious for More?

We have more repositories over on our Github, such as the block explorer and a sample Libplanet clicker project.
We're always happy to discuss your creative ideas for developing the Nine Chronicles ecosystem. Do check out 👐Nine Chronicles Software Grant Program , and hop onto our Discord to share your thoughts. Thanks!