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