Quickstart
Start developing your first World Engine game in under 5 minutes
Install dependencies and World CLI
Learn how to install World Engine dependencies and the World CLI.
Note: This quickstart assumes that you are using Linux or MacOS. If you are using Windows, we recommend you use WSL to run World Engine.
Install Go
Install Go
World Engine (WE) is built using Go, a performant, easy-to-learn, and expressive programming language that is widely used in distributed systems.
To install Go, follow the instructions on the Go website.
To verify that Go is installed, run the following command in your terminal:
Go beginner tip: World Engine, combined with the simplicity of Go, makes it easy to get started with your game with little to no experience in Go. If this is your first time writing a program in Go, we recommend you follow the Go tour to familiarize yourself with the language. However, you don’t need to know any Go to complete this quickstart
Install Docker
Install Docker
World Engine uses Docker to make it easier to develop and deploy your rollup and game in any operating system.
Docker is a containerization tool that allows you to run applications in a sandboxed environment; it ensures that the World Engine stack will run the same way on your machine as it will on production deployments.
To install Docker, follow the instructions on the Docker website.
To verify that Docker is installed, run the following command in your terminal:
Install World CLI
Install World CLI
World CLI is a swiss army knife command-line tool for creating, managing, and deploying World Engine projects.
Important: World CLI will not work properly without Go and Docker
To install World CLI, run the following command in your terminal:
Advanced tip: If you want to install a specific version of World CLI, you can run the following command:
Important: If you have previously installed World CLI using the install script, you need to remove it first by running the following command:
Install OrbStack (Optional — MacOS only)
Install OrbStack (Optional — MacOS only)
OrbStack is a tool that makes it easier to run Docker containers on MacOS. It is not required to run World Engine, but it is recommended for MacOS users as it provides a better performance and user experience than Docker Desktop.
The Argus Labs team uses OrbStack to develop and build on top of World Engine, and we recommend it for MacOS users.
To install OrbStack, follow the instructions on the OrbStack website.
Create your first World Engine project
Scaffold a boilerplate project
Once you have World CLI installed, you can scaffold your first World Engine game by running the following command in your terminal:
Troubleshooting
If you encountered Error: dependency check "Docker daemon is running" failed
, make sure that you have
installed Docker and have Docker Desktop or OrbStack running.
Start Cardinal in development mode
Once you have scaffolded your project, you can start World Engine’s game shard (Cardinal) in development mode by running the following command from your project directory in your terminal:
The development mode is the easiest way to quickly iterate on your game shard code. In contrast to
world cardinal start
it skips the Docker image builds process which can take a while.
Additionally, dev mode provides you with pretty logging that makes it easier to debug your game shard. In production, pretty logging is disabled due to its performance drawback at high tickrate configuration where every millisecond counts.
Submit a game transaction
Now that you have Cardinal running in development mode, you can submit a game transaction to your game shard.
A Cardinal transaction is a simple REST POST request to Cardinal to perform an action in your game shard. For example, in the boilerplate project, you can submit a transaction to create a new player in your game.
To submit this transaction, run the following command in your terminal:
Tip: You can also use Cardinal Editor or a REST API tool such as Insomnia or Postman to make it easier submit transactions to Cardinal.
Notice that we don’t provide a namespace
, nonce
, and signature
for this transaction.
This is because the boilerplate plate runs with DisableSignatureVerification()
option declared in main.go
, which
means that it will accept any transaction without verifying its signature and relevant fields. In production, you
should never use this.
Inspect game state using Cardinal Editor
Once you have started your game shard in development mode, you can inspect your game state using Cardinal Editor.
To open Cardinal Editor, navigate to http://localhost:3000 in your browser.
You should now be able to see the player you created in the previous step. If you submit another transaction, you can see more player entity appear automatically in the Cardinal Editor in real-time.
Congratulations! 🥳🥳🥳
You have successfully created your first World Engine project, ran a boilerplate Cardinal game shard, and submitted your first game transaction. Now you can start exploring the World Engine and build your own game!
Next Steps
Ready to build your game using the World Engine stack? Here are some resources.