Fully onchain, ZK space conquest MMORTS Dark Forest-inspired game,
powered by Argus Labs' 「 World Engine 」
- Overview
- Getting Started
- Running Dark Frontier's World Engine backend
- Running Dark Frontier's client
- Gameplay Tutorial
This repository contains both the Dark Frontier's Unity game client (/client
) and World Engine's Cardinal game
shard (/backend
).
Dark Frontier provides a real-world example of what you can achieve with World Engine and have processed live production workload with 700K+ transactions.
To learn more about World Engine, visit https://world.dev.
We recommend reading the World Engine quickstart guide before proceeding.
The quickstart guide will guide you in installing the prerequisites for running a World Engine project that is needed to run a Dark Frontier instance on your machine.
If you have any questions, please reach out to our friendly community on Telegram!
- Go
- Docker
- World CLI
To install the World CLI, run the following command:
curl https://install.world.dev/cli! | bash
- Download ZK circuit artifacts
make getCircuitArtifacts
- Run vendor to statically link the artifacts into Cardinal
cd cardinal && go mod vendor && cd ../
- Start Nakama and Cardinal. Ensure you're in
/backend
directory, then:
world cardinal start
- To stop both the Nakama and Cardinal
world cardinal stop
World Engine's Nakama Allowlist feature allows you to restrict access to the game using game keys.
To enable this feature, set the following environment variable:
ENABLE_ALLOWLIST=true
Enabling the allowlist feature will enable two new RPC endpoints to manage and use game keys.
You can interact with these RPC endpoints easily through the Nakama API Explorer, accessible via browser at
localhost:7351
.
For local development, use admin:password
as your login credentials.
An admin-only endpoint that generates N number of game keys.
{
"amount": 5
}
{
"keys": [
"ABCD-EFGH-1234-5678",
"ABCD-EFGH-1234-5678",
"ABCD-EFGH-1234-5678",
"ABCD-EFGH-1234-5678",
"ABCD-EFGH-1234-5678"
]
}
A user-facing endpoint which allows a user to redeem a game key.
create-persona
endpoint will be 🛑 BLOCKED until a user calls claim-key
with a valid key.
{
"key": "ABCD-EFGH-1234-5678"
}
{
"success": true
}
- Unity Hub
- Unity 2022 LTS
- Install Unity Hub. and load
/client
project in unity. - Open the Bootstrap scene: Assets/Scenes/Bootstrap.unity
- Locate and select the GameObject named Bootstrap within the Bootstrap scene.
- Configure the communication setting
- The default configuration connects to your local World Engine backend instance.
- For testing, you can use Argus Labs' cloud prover to generate ZK proofs required for game moves: https://lambda.argus-dev.com/generate-proof
- Check
Will Start In Clean Test Mode
to force creation of a new player. - Check
Will Require Beta Key
only if you enabled the allowlist feature on the World Engine backend. - Check Will Respect Countdown only if you want a time-limited game.
- Press Play to start the game.
Bootstrap.cs is the main entry point to start looking at code. It is repsonsible for instantiating all dependencies as well as setting up the major game states and their transitions so that everything is ready to go when the initial game state is started.
Each major game state receives dependencies on a need-to-know basis. An EventManager allows for communication between game states, UI, and a CommunicationsManager.
The CommunicationsManager is responsible for communicating with the backend. Non-game-specific communications are handled by the gg.argus.world-engine-client-communications-unity UPM package.
Gameplay logic is handled in Gameplay.cs.
- gg.argus.world-engine-client-communications-unity
- com.heroiclabs.nakama-unity
- com.olegknyazev.softmask
- com.smonch.cyclopsframework
Controls | Functionality |
---|---|
WASD | Pan space view camera. |
Wheel | Zoom camera in and out. |
LMB | Select a planet. |
LMB + Drag | Create an energy transfer line between planets. |
F | Focus the camera on the selected planet. |
H | Focus the camera on your home planet. |
TAB | Cycle through the various debug modes. |