Skip to content

Getting Started

Akamig edited this page Aug 25, 2022 · 12 revisions

This document guides you through building and running the Nine Chronicles launcher (a.k.a. 9c-launcher) with the game on your own computer from scratch. Following this guide, you can play NineChronicles with a launcher connected to the mainnet that works like the released launcher. We hope you can easily start participating and/or contributing to Nine Chronicles from here.

Instructions

1. Environment

  • Windows 10 or 11 is recommended.
  • Linux/macOS also works, but the compatibility is not guaranteed.
    • Also, Apple Silicon devices won't be able to launch the game itself.

2. Requirements

3. Cloning repository

Due to the usage of symbolic links and submodules, you need to use some flags when cloning. In case if you forgot to do so, follow the guides in the Troubleshooting section.

git clone -c core.symlinks=true https://github.com/planetarium/9c-launcher --recursive
cd 9c-launcher
git checkout main  # In case you're contributing, skip this
git pull
git submodule update --recursive --init
yarn install
yarn lefthook install # installs git hook for contributing, feel free to skip

4. Build 9c-launcher

The launcher depends on two other software: the game itself and the headless. The headless is responsible for communicating with the blockchain, and the game is a Unity client providing the gameplay experience of the Nine Chronicles. You can set them up using these command:

yarn build-headless # This builds NineChronicles.Headless.
yarn bundle-player # This downloads the latest Nine Chronicles Unity client version from the internet.

5. Config and run 9c-launcher

The launcher needs a configuration to tell the headless to which chain to use and how to set up and communicate with the desired chain. You can easily do this when if you're connecting to the mainnet.

curl https://download.nine-chronicles.com/9c-launcher-config.json -o dist/config.json
yarn codegen
yarn dev
# Press `Ctrl + C` on terminal to shut down the launcher
  • curl ... dist/config.json
    • Downloads the latest configuration of the mainnet, which allows you to use it just like a released launcher.
  • yarn codegen
    • Generates graphQL code from defined schema.

That's it! Enjoy the game with your own launcher! 🎮


Troubleshooting

yarn bundle-player does not work

Mostly, it's because the new version of NineChronicles Unity client is not built and uploaded to S3 yet. To resolve this, just wait for a while for the CI to build and upload NineChronicles Unity client.

Note In case you're using your customized source code or running under unsupported platform, this may not work but you can run the launcher itself.

yarn dev command exits with 0 (yarn start exited with code 0)

If you close the launcher on your taskbar, not terminal, this could happen when you run yarn dev again.

Fixing on Windows

  1. Open the Task Manager. - You can open it by pressing Ctrl + Shift + Esc.
  2. See details in Process tab, you can find the living Electron app. - If you see an instance of 'Nine Chronicles' they need to be terminated as well.
  3. Manually kill those living processes.
  4. The yarn dev should work now. - To prevent this, we recommend terminating the launcher with Ctrl + C.

src/v2/i18n or src/v2/stores is missing

Outdated as of https://github.com/planetarium/9c-launcher/pull/1817. We'll remove this section as the change makes into the upstream.

Running or building the launcher may fail if you're running Windows. To enable the symbolic links, follow the guides in the link below.

After doing so, run these commands in the launcher folder:

git config core.symlinks true
git checkout -- src/v2

References

Clone this wiki locally