• Stars
    star
    331
  • Rank 127,323 (Top 3 %)
  • Language
    C#
  • License
    GNU Affero Genera...
  • Created about 4 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unity client application for Nine Chronicles, a fully decentralized idle RPG powered by the community.

Nine Chronicles

Nine Chronicles Banner

CircleCI Discord Planetarium-Dev Discord Invite

Nine Chronicles is a fully open-sourced online RPG without servers β€” like Bitcoin or BitTorrent, the gamers and miners connect to each other to power a distributed game network. Set in a vast fantasy world, it is governed by its players, and supported by a complex economy where supply and demand are the greatest currency.

Decentralized infrastructure has created new possibilities for online gaming, where communities can become the actual owners of an online world. By fully open sourcing the repositories for Nine Chronicles, players and developers alike can use any part of the game, from the beautiful bespoke 2D assets to in-game logic and code.

To learn more about the codebase and the GraphQL API, visit docs.nine-chronicles.com.

Dependency

Installation

  1. Install Unity Hub
  2. Install Unity 2021.3.5f1 version
  3. Clone repository
    git clone https://github.com/planetarium/NineChronicles.git
    
  4. Navigate to the cloned directory and run the command:
    git config core.hooksPath hooks
    git submodule update --init --recursive
    
  5. Run Unity and build project

To launch Nine Chronicles from the Unity editor, please follow the step-by-step guide.

Command Line Options

  • --private-key : private key to use.
  • --keystore-path : path to store private key.
  • --host : host name.
  • --port : port name.
  • --no-miner : disable mining.
  • --peer : add peer. Multiple peers can be added with --peer peerA peerB ... .
  • --ice-servers : TURN server information used for NAT traversal. Multiple servers can be added with --ice-servers serverA serverB.
  • --genesis-block-path: path of genesis block. Supports http(s) paths and uses Assets/StreamingAssets/genesis-block if not provided.
  • --storage-path : path to store chain data.
  • --storage-type : storage type name. Currently supports RocksDBStore (--storage-type rocksdb).
  • --rpc-client : starts client mode that does not store chain data.
  • --rpc-server-host : rpc server host name.
  • --rpc-server-port : rpc server port name.
  • --auto-play : automatically generate character and enter battle stage in the background.
  • --console-sink : print logs on console.
  • --development : run in development mode. Shows debugging UI and log level configuration.

Using Command Line Options on Unity Editor

To use the above command line options on Unity Editor or on build player, Assets/StreamingAssets/clo.json must be created. Below is an example:

{
   "privateKey": "",
   "host": "127.0.0.1",
   "port": 5555,
   "noMiner": true,
   "peers": ["02ed49dbe0f2c34d9dff8335d6dd9097f7a3ef17dfb5f048382eebc7f451a50aa1,nekoyume1.koreacentral.cloudapp.azure.com,58598"]
}
  • Assets/StreamingAssets/clo.json is excluded from version control.
    • Assets/StreamingAssets/clo_nekoalpha_nominer.json could be provided as a preset. To use this file, change the name to clo.json.

Command Line Build

$ /UnityPath/Unity -quit -batchmode -projectPath=/path/to/nekoyume/ -executeMethod Editor.Builder.Build[All, MacOS, Windows, Linux, MacOSHeadless, WindowsHeadless, LinuxHeadless]
  • Example
$ /Applications/Unity/Hub/Editor/2021.3.5f1/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectPath=~/planetarium/nekoyume-unity/nekoyume/ -executeMethod Editor.Builder.BuildAll

Editor Build

Use the Build menu on the Unity Editor.

Peer Configuration

Reading Order

Peer options for network communication is read in the following order:

  1. Command Line parameter upon execution (--peer)
  2. (On Windows) peers.dat in %USERPROFILE%\AppData\LocalLow\Planetarium
  3. Assets\Resources\Config\peers.txt inside NineChronicles project.

Since the current project doesn't include option 3, the game will run in a single node if peer configuration in either option 1 or 2 are not provided.

Format

Peer list is stored in plain text format and each line includes a node's publickey,host-name,port,version.

Ex)

   02ed49dbe0f2c34d9dff8335d6dd9097f7a3ef17dfb5f048382eebc7f451a50aa1,nekoyume1.koreacentral.cloudapp.azure.com,58598
   02d05be62f8593721f5abfd28fb83c043ed9d9585f45b652cb67fd6eee3fd3748f,nekoyume2.koreacentral.cloudapp.azure.com,58599
  • Host name and port must be public.
    • If --host is not provided upon execution, the actual host name and port could be different from the original due to the automatic relay communication via STUN/TURN. Therefore, nodes that are used as peers on other nodes must provide its --host option on execution.
  • Public key is a hexadecimal string derived from the PrivateKey that is used to create a Swarm object.

Docker-compose Miner Test

Seed private key and node host are hardcoded for local testing purposes.

  • Build LinuxHeadless and run the command below:
cd nekoyume/compose
docker-compose up --build

Auto Play Option

--auto-play option can be used to generate character and automate battle stages in the background. Currently, character's name is generated with the first 8 characters of the node's Address and repeats stage 1 battle at the TxProcessInterval.

Console Sink Option

--console-sink option can send logs via UnityDebugSink instead of ApplicationInsights.

White List

You can use nekoyume/Assets/AddressableAssets/TableCSV/Account/ActivationSheet.csv to manage white lists.

id,public_key
1,029d256bc6943cd9d18712b1fe1fdd061705d2ffa644a7705b3cf90f408d1ee278

If PublicKeys are registered in ActivationSheet.csv, only transactions that have been signed with the PrivateKeys of those PublicKeys can be mined.

White list feature will not be activated if there are no PublicKeys registered in ActivationSheet.csv.

More Repositories

1

libplanet

Blockchain in C#/.NET for on-chain, decentralized gaming
C#
489
star
2

9c-launcher

Nine Chronicles Launcher
TypeScript
44
star
3

NineChronicles.Headless

A headless node of NineChronicles game network, powered by Libplanet.
C#
34
star
4

planet-clicker

Libplanet-based sample clicker game
C#
29
star
5

lib9c

Lib9c is a library that contains key implementations of Nine Chronicles, a decentralized RPG developed with Libplanet. Lib9c includes Nine Chronicle's key features like in-game decisions and data models, which can be used to implement game core capabilities.
C#
19
star
6

libplanet-explorer-frontend

Libplanet Explorer Frontend
TypeScript
16
star
7

xunit-unity-runner

Run Xunit tests on Unity player
C#
15
star
8

bencodex

Bencodex: Bencoding Extended
14
star
9

UniLibplanet

Libplanet SDK for Unity
C#
13
star
10

NineChronicles.EthBridge

NineChronicles ⬌ Ethereum bridge
TypeScript
11
star
11

bencodex.js

An alternative take on implementing Bencodex in TypeScript/JavaScript
TypeScript
9
star
12

snack.planetarium.dev

Planetarium Engineering Snack
HTML
9
star
13

check-free-space

Checks if there are enough space in a specified path.
JavaScript
8
star
14

digital-garden

μ²œλ¬Έκ΄€ 곡개 μ „μž μ›μ˜ˆμ‹€
7
star
15

RandomXSharp

RandomX binding for .NET
C#
7
star
16

planet-node

A simple node implementation using Libplanet
C#
7
star
17

9c-infra

Infrastructure for NineChronicles
HCL
7
star
18

NineChronicles.RPC.Shared

C#
7
star
19

bencodex.net

Bencodex codec for .NET
C#
6
star
20

NCIPs

Nine Chronicles Improvement Proposal is a design document providing information to the Nine Chronicles community, or describing a new feature for Nine Chronicles software.
5
star
21

bencodex-python

Bencodex reader/writer for Python
Python
5
star
22

Telescope

A simple application to read a local blockchain storage.
C#
5
star
23

sphere

A signing library encapsulating multiple account providers to be used on Libplanet-based applications.
TypeScript
5
star
24

bencodex-viewer

Display a Bencodex tree on the web
TypeScript
5
star
25

planet-omok

Libplanet based Omok game
ShaderLab
5
star
26

lib9c-wasm

The experimental project to port Lib9c into JavaScript environment through WASM. Build your Nine Chronicles network transaction in your local at once.
C#
5
star
27

wncg-staking-interface

TypeScript
4
star
28

Cocona.Docs

A library to generate Cocona commands' documentation easily
C#
4
star
29

gamejam-laylas-island

C#
4
star
30

market-service

shop product list service for nine chronicles
C#
4
star
31

web9c

Reference frontend app to demonstrate JS libraries on Nine Chronicles / Libplanet.
TypeScript
4
star
32

9c-metric-dash

Python
4
star
33

NineChronicles.DataProvider

C#
4
star
34

changelog-check

Check if a push or a pull request contains self-describing changelog
Python
4
star
35

talks

Talks we gave
4
star
36

9c-k8s-config

Nine Chronicles kubernetes config yaml
Python
3
star
37

gamejam-isekai

C#
3
star
38

Flawless

Turn-based roguelike game for 2022 Planetarium hackathon.
C#
3
star
39

homebrew-brew

Planetarium's tap for Homebrew
Ruby
3
star
40

submodule-updater

Submodule Updater
Python
3
star
41

blackjack

C#
3
star
42

cosmwasm-research

Build playable decentralized game examples based on cosmos-SDK and cosmwasm
TypeScript
3
star
43

coincurve-stubs

Stubs, i.e., type information, for Coincurve
Python
3
star
44

libplanet-seed

C#
2
star
45

NineChronicles.HttpGateway

An application to provide HTTP API from NineChronicles RPC server
C#
2
star
46

NineChronicles.RPC.RelayServer

gRPC relay server for NineChronicles
C#
2
star
47

NineChronicles.IAP

Nine Chronicles In-app Purchase Service
Python
2
star
48

9c-headless-metric-gql-aggregator

Python
2
star
49

world-boss-service

world boss service
Python
2
star
50

9c-board

A beautiful board web application to see Nine Chronicles, like op.gg
TypeScript
2
star
51

ninechronicles-devforum

TBD
2
star
52

minority-game

ShaderLab
2
star
53

Voyager

Von voyage to libplanet's network
C#
2
star
54

Corvette

An EVM event monitoring and indexing service.
TypeScript
1
star
55

mothership-l2launcher

TypeScript
1
star
56

NineChronicles.BscBridge

TypeScript
1
star
57

9c-table-patcher

Patch & Sign Nine Chronicles table csv data
Svelte
1
star
58

Planetarium.Crypto

Cryptographic library for .NET Framework 3.5
C#
1
star
59

9c-toolbelt

python scripts for github action CI
Python
1
star
60

libplanet-unity-template

Template for Libplanet.Unity
C#
1
star
61

.github

1
star
62

daily-reward-app

A project for task to implement signing Progressive Web Application with sphere
TypeScript
1
star
63

9c-dash

Python
1
star
64

cdk8s-lib

cdk8s definitions of application used by @planetarium
TypeScript
1
star
65

godot-planet-clicker

C#
1
star
66

9c-headless-metric-log-aggregator

Dockerfile
1
star
67

NineChronicles.SeasonPass

Season pass service of Nine Chronicles
Python
1
star
68

NineChronicles.Arena

Arena Service for NineChronicles
Python
1
star
69

wncg-staking

wncg staking
JavaScript
1
star
70

bencodex-rs-exam

C#
1
star
71

awesome-9c

A curated list of NineChronicles software and resources
1
star
72

NineChronicles.Bridge.API

`planetarium/NineChronicles.Bridge`'s API
TypeScript
1
star
73

Unithereum

Ethereum integration package for Unity.
C#
1
star
74

staking_contract_wncg_eth

Staking Contract - WNCG on ETH
HTML
1
star
75

plds

JavaScript
1
star