Code Monkey home page Code Monkey logo

akamig / ninechronicles Goto Github PK

View Code? Open in Web Editor NEW

This project forked from planetarium/ninechronicles

0.0 0.0 0.0 1.11 GB

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

Home Page: https://nine-chronicles.com/

License: GNU Affero General Public License v3.0

Shell 0.13% Python 0.42% C 0.18% C# 94.46% PowerShell 0.02% Inno Setup 0.09% GLSL 0.21% HLSL 1.15% Dockerfile 0.02% ShaderLab 3.33%

ninechronicles's Introduction

Nine Chronicles

Nine Chronicles Banner

CircleCI Discord

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 2020.3.4f1 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/2020.3.4f1/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.

ninechronicles's People

Contributors

area363 avatar basixkor avatar bbeom06 avatar boramqo83 avatar boscohyun avatar caesty avatar caesty0 avatar dahlia avatar edwardathomson avatar greymistcube avatar hskim881028 avatar ipdae avatar jaeho0103 avatar jckdotim avatar jessicac-silva avatar kijun avatar limebell avatar longfin avatar moreal avatar namyujeong avatar oremal avatar paulosalvatore avatar plafina2 avatar planet-submodule-updater avatar riemannulus avatar sonohoshi avatar tyrosine1153 avatar unengine avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.