To create an alternative MUD client, you need three configuration files from the original application:
mud.config.ts
worlds.json
out/IWorld.sol/IWorld.abi.json
For Sky Strife, we have open-sourced these in the sample Leaderboard client.
You can see a sample Sky Strife alternative client on github. To run it:
Clone the repository.
git clone [<https://github.com/latticexyz/skystrife-leaderboard.git>](<https://github.com/latticexyz/skystrife-leaderboard.git>)
Build and start the application.
cd skystrife-leaderboard
pnpm install
pnpm dev
Browse to http://localhost:3000. You will see a list of player addresses and their balances.
In this tutorial we use this client as template.
Here we extend the leaderboard client to also display information to the user about matches. The explanation of how we do it should help you write your own clients, for any information available on Sky Strife.
The data definitions are located in https://github.com/latticexyz/skystrife-leaderboard/blob/main/packages/client/src/mud/skystrife-config/mud.config.ts#L95-L586.
Most of the tables don’t have a keySchema
, because they use the MUD default of a single bytes32
value. The key for those tables is an entity identifier (see the MUD documentation for an explanation of entities and ECS).
For example, let’s look at the Match
table. Here is the definition:
/**
* Match ID.
* Used to tag entitities as part of a specific match.
*/
Match: "uint32",
There is a single field here, a uint32
, which identifies the match. To see the content of this table, go to the MUD Dev Tools in the right side of the application, click Components and select Match.