Forgotten Empires
  • Welcome!
  • Getting Started
  • Why On Chain Game?
  • Why MINA?
  • Architecture of Forgotten Empires
  • Prerequisites
  • Building Forgotten Empires to Unity
  • Game
    • Unity
      • Component
        • Type
          • Animation Type
          • Music Type
          • State Type
          • VFX Type
      • Entity
        • Element
          • Component
            • Enemy
              • Enemy Worker
                • Enemy Animation
                • Enemy Behaviour
                  • Component
                    • Enemy Attack Behaviour
                    • Enemy Attack Stance Behaviour
                    • Enemy Idle Behaviour
            • NPC
              • Citizen
              • Merchant
                • Merchant Interaction
                • Merchant Trade
                • Merchant Trigger
                • Merchant UI
                • Merchant Update
            • Player
              • Player Animation
              • Player Attack
              • Player Camera
              • Player Damage
              • Player Economy
              • Player Fixed Update
              • Player Input
                • Player Attack Input
                • Player Movement Input
                • Player Rotation Input
              • Player Interaction
              • Unity Late Update
              • Player Inventory
                • Player Inventory Slot
              • Player Movement
              • Player Quest
              • Player Rotation
                • Player Attack Rotation
                • Player Movement Rotation
              • Player Start
              • Player State
              • Player Stats
                • Player On Chain Stats
              • Player Trails
              • Player Update
              • Player VFX
          • Element Worker
            • Element Effect
            • Element Event
            • Element Stats
            • Element Update
        • Item
          • Potion
          • Shield
          • Sword
        • Kingdom
      • Manager
        • Client Manager
          • Client Manager Worker
            • Client Login Worker
            • Client Music Manager
            • Client Start Worker
            • Client UI Worker
            • Client Update Worker
        • Server Manager
          • Server Manager Worker
            • Server Day Night Worker
            • Server Enemy Worker
            • Server Kingdom Worker
            • Server Object Pool Worker
            • Server Player Worker
            • Server Start Worker
            • Server Update Worker
    • o1js
      • Player
      • Item
      • Character
    • o1js Tests
Powered by GitBook
On this page

Building Forgotten Empires to Unity

Last updated 1 year ago

CtrlK

See example Forgotten Empires appchain here:

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

  • 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.

  • https://youtu.be/gQNMihjGnvU
    GraphqlClient: {
      url: "http://url/graphql"
    }