# Building Forgotten Empires to Unity

See example Forgotten Empires appchain here: [https://youtu.be/gQNMihjGnvU](https://youtu.be/gQNMihjGnvU)

### How to Set Up?

Setting up Forgotten Empires includes several steps.

* **Unity Setup:** Install Unity with Unity Hub from Unity's offical website.
* **Dependency Installation:** Add Newtonsoft Json via Unity Package Manager and download Unity Mirror from the Unity Asset Store.
* **Repository Cloning:** Clone the game repository and integrate it into your Unity project.
*   **Building Appchain:**\
    \
    Clone Proto-kit starter-kit repository. Starter-kit includes two important things, starter-kit client side and sequencer for building the appchain.\
    \
    `git clone https://github.com/proto-kit/starter-kit`

    \
    Move Forgotten Empires runtime codes to starter-kit runtime files.\
    \
    `Web3/test-chain/src > packages/chain/src`



    Move Forgotten Empires client library files to starter-kit client library files.\
    \
    `Web3/client/lib > apps/web/lib`

    \
    Move Forgotten Empires components and containers to starter-kit contrainer & components files.\
    \
    `Web3/client/components > apps/web/components`\
    `Web3/client/containers > apps/web/containers`

    \
    Finally if you are planning to use a hosted sequencer add your config to \
    \
    `packages/chain/src/client.config.ts`\


    ```
    GraphqlClient: {
      url: "http://url/graphql"
    }
    ```
*   **Sequencer and UI Start:**\


    ```
    pnpm dev
    ```

    \
    This activates the sequencer and ui\

* **Connect Game to Sequencer:**\
  \
  Data Manager includes the functionality for you to send queries to the sequencer's graphql, you only need to set the url of the graphql from DataManager, later player's information will be updated continously with onchain data.
