Skip to content

Commit 661169f

Browse files
Merge pull request #1414 from playmint/advanced-tut-rs
Adapting the tutorial island guide to focus on Redstone
2 parents ca87432 + d4568dc commit 661169f

File tree

11 files changed

+109
-197
lines changed

11 files changed

+109
-197
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Follow the guide to [start building on mainnet](./tutorial/README.md).
1212

1313
------------------------------------
1414

15-
# References
15+
## References
1616
__[For more information, check the reference page](/tutorial/REFERENCE.md)__
1717

1818
------------------------------------
1919

20-
# Contributors
20+
## Contributors
2121

2222
For people looking to contribute to the repository, please __[click here](./CONTRIBUTORS.md)__

contracts/src/maps/tutorial-room-1/README.md

+22-82
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,16 @@ Once complete, you will have used the core Downstream tools to create a map that
77

88
<a href="https://drive.google.com/file/d/1C6Zou1v_ad8OlvZjKmixuvBBLpVJvkRZ/view?usp=drive_link"><img src="./readme-images/screenshot.png" width=300></a>
99

10-
[Watch a video run through of this tutorial.](https://drive.google.com/file/d/1C6Zou1v_ad8OlvZjKmixuvBBLpVJvkRZ/view?usp=drive_link)
11-
12-
1310
## Prerequisites
14-
- This repository cloned to your desktop. (Instructions in the top [readme](../../../../README.md).)
15-
- [Docker Desktop](https://docs.docker.com/get-docker/)
16-
- [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) or [npm Windows](https://nodejs.org/en/download/)
17-
18-
## 1. Deploy the game
19-
20-
First, deploy an instance of Downstream locally using Docker.
21-
22-
From a terminal in the repository root run:
23-
24-
```bash
25-
docker compose up --pull=always
26-
```
27-
28-
After some time (this could take up to 5 minutes), you should see "ready" in the terminal output:
29-
30-
contracts-1 | +-------+
31-
contracts-1 | | ready |
32-
contracts-1 | +-------+
33-
34-
You can now open a web browser and navigate to [http://localhost:3000] to load the front page.
35-
36-
From here you can select a zone, select Zone 1 as it will be owned by the deployer.
37-
38-
You should see a blue world, with a single hex tile in the center and the **Welcome to Zone 1** dialogue box:
39-
40-
<img src="./readme-images/step1.png" width=200>
41-
42-
## 2. Enter the Zone and Spawn a Unit
43-
44-
First click the **Connect Wallet** button.
45-
Then, select **LocalDevAccount**.
46-
Then visit Zone 1 (Zone 1 will be owned by the LocalDevAccount)
11+
- Have set up Metamask
12+
- Have claimed a Downstream Redstone Zone
13+
Follow the [Redstone Guide](../../../../tutorial/REDSTONEGUIDE.md) for more information
4714

48-
<img src="./readme-images/step2a.png" width=200>
49-
50-
You can now click "Spawn Unit" and you should see your Unit on the center tile:
51-
52-
53-
<img src="./readme-images/step2b.png" width=200>
54-
55-
56-
## 3. Create a map
15+
## 1. Create a map
5716

5817
There is no where for the Unit to go so we will now expand the world by creating some tiles.
5918

60-
First, open the the **tile-fabricator**, by opening a web browser and navigating to [http://localhost:3000/tile-fabricator].
19+
First, open the the **tile-fabricator**, by opening a web browser and navigating to [tile-fabricator](http://redstone.downstream.game/tile-fabricator).
6120

6221
Now, draw a map design:
6322
- Left click each tile that you want on your map.
@@ -77,7 +36,7 @@ Finally, create a new folder in your desktop. This folder is your 'map' and will
7736
- Copy the exported tiles manifest into the folder.
7837
- Rename it to 'Locations.yaml'.
7938

80-
## 4. Deploy the new tiles
39+
## 2. Deploy the new tiles
8140

8241
We will use the Downstream CLI to deploy our newly created tiles to our local Downstream instance.
8342

@@ -90,43 +49,30 @@ Check it is installed from any terminal folder by running:
9049
ds help
9150
```
9251

93-
Now copy your Burner private key from Downstream:
94-
- Browse to [localhost:3000]([http://localhost:3000]).
95-
- Click the player icon at the top left.
96-
97-
<img src="./readme-images/step4a.png" width=200>
98-
99-
- Click **show**
100-
101-
<img src="./readme-images/step4b.png" width=200>
102-
103-
- Highlight and copy the key.
104-
10552
Finally, run the command to deploy your map:
106-
In a terminal at your new folder run the following, where `<private-key>` can be pasted from the one you just copied:
53+
In a terminal at your new folder run the following, where `<zone-number>` is your Zone number:
10754
```bash
108-
ds apply -n local -z 1 -k <private-key> -f Locations.yaml
55+
ds apply -n redstone -z <zone-number> -f Locations.yaml
10956
```
11057

111-
We are using Zone 1 (`-z 1`) as the LocalDevAccount already owns Zone 1 and it saves up some time!
112-
11358
Note: If using Windows you get the error "running scripts is disabled on this system", open Powershell as an Administrator and run `Set-ExecutionPolicy RemoteSigned`
11459

115-
You should see the terminal output display a series of ✅s for each tile that is deployed.
60+
Running the command will open your default broswer and ask you to sign a transaction in Metamask. This will confirm your identity and verify ownership of your zone.
61+
62+
Once you have accepted the Metamask prompts, return to your terminal and the output should display a series of ✅s for each tile that is deployed.
11663

11764
<img src="./readme-images/step4c.png" width=200>
11865

119-
Browse to [localhost:3000/zones/1](http://localhost:3000/zones/1) and you should see your newly created map and be able to move your Unit around it!
66+
Browse to your Zone on [redstone.downstream.game](redstone.downstream.game) and you should see your newly created map and be able to move your Unit around it!
12067

12168
<img src="./readme-images/step4d.png" width=200>
12269

12370

124-
125-
## 5. Create a new type of building
71+
## 3. Create a new type of building
12672

12773
The map is currently empty and there are no buildings to build. So we are going to create a new kind of 'Factory' building that crafts a new kind of item.
12874

129-
First, open the the **building-fabricator**, by opening a web browser and navigating to [http://localhost:3000/building-fabricator].
75+
First, open the the **building-fabricator**, by opening a web browser and navigating to the [building-fabricator](http://redstone.downstream.game/building-fabricator).
13076

13177
You should see a page like this:
13278

@@ -151,22 +97,20 @@ You should now have a folder that looks this:
15197

15298
<img src="./readme-images/step5c.png" width=200>
15399

154-
## 6. Deploy the new type of building
100+
## 4. Deploy the new type of building
155101

156102
We will use the Downstream CLI to deploy our newly created building to our local Downstream instance.
157103

158104
Deploying the building is the same as the tiles manifest but passing BasicFactory.yaml instead of Locations.yaml:
159105
- In a terminal in the folder with your exported building source.
160-
- (using the same `<private-key>` as above)
161-
- Still using Zone 1 (`-z 1`)
162-
- `ds apply -n local -z 1 -k <private-key> -f BasicFactory.yaml`
106+
- `ds apply -n redstone -z <zone-number> -f BasicFactory.yaml`
163107

164-
You should see the terminal output display for the building kind and item kind defined by your new factory:
108+
Again, metamask will ask you to sign a transaction and then you should see the terminal output display for the building kind and item kind defined by your new factory:
165109

166110
<img src="./readme-images/step6a.png" width=200>
167111

168112
This type of building now exists in our local instance of Downstream, which means it is available for Units to build on the map:
169-
- Browse to [http://localhost:3000/zones/1].
113+
- Browse to your zone on [https://redstone.downstream.game](redstone.downstream.game).
170114
- Select the build action.
171115
- Choose your new building type from the drop down list.
172116
- Confirm.
@@ -176,15 +120,15 @@ You should now have an instance of your building deployed to the map!
176120
<img src="./readme-images/step6b.png" width=200>
177121

178122

179-
## 7. Add some decorations
123+
## 5. Add some decorations
180124

181125
There are plenty for examples of pre-made building kinds in the ds repository that can be copy and pasted into your map folder.
182126

183127
We will add some decorative blocking buildings to your map and see how everything in the map folder can be deployed at once.
184128

185129
First copy the [blockers.yaml](./blockers.yaml) to your map folder.
186130

187-
Now, use the [tile-fabricator](http://localhost:3000/tile-fabricator) to add some blockers to your map:
131+
Now, use the [tile-fabricator](http://redstone.downstream.game/tile-fabricator) to add some blockers to your map:
188132
- Press the **import** button, navigate to your map folder, and select blockers.yaml.
189133
- New building types will now be available in the **Brush** drop done.
190134

@@ -197,17 +141,13 @@ Now, use the [tile-fabricator](http://localhost:3000/tile-fabricator) to add som
197141
- When you're happy, press the **export** button.
198142
- Replace your old Locations.yaml with the new downloaded manifest.
199143

200-
## 8. Deploy the whole map folder
144+
## 6. Deploy the whole map folder
201145

202146
To complete the tutorial, we're going to deploy your whole map folder together.
203147

204-
First, stop the Downstream instance running in Docker with **ctrl-c**, and restart it by running `docker compose up`.
205-
206-
Once you see "ready", browse to the game and check you have a single tile world.
207-
208148
Now you can `ds apply` the whole map folder by passing the `-R` flag and the folder path. At a terminal In your map folder run:
209149
```bash
210-
ds apply -n local -z 1 -k <private-key> -R -f .
150+
ds apply -n redstone -z <zone-number> -k <private-key> -R -f .
211151
```
212152

213153
Browsing back to the game, you should now see your new map.

contracts/src/maps/tutorial-room-2/README.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,14 @@ Once complete, your map should something look like this:
1313

1414

1515
# 1. Setup
16-
Follow steps 1 through 4 of `tutorial-room-1` to get started. This will walk you through:
17-
- Deploying the game
18-
- Spawning a unit
19-
- Creating a map
20-
- Deploying new tiles
2116

22-
[tutorial-room-1/README.md](../tutorial-room-1/README.md)
23-
24-
The only change we want to make to these steps is in _Creating a map_. As this is the next room in the tutorial series, we will be creating our map at a different angle so it doesn't overlap with tutorial-room-1.
17+
As this is the next room in the tutorial series, we will be creating our map at a different angle so it doesn't overlap with tutorial-room-1. One important feature of this map is a choke point to block off using a door.
2518

2619
<img src="./readme-images/step1.png" width=600>
2720

2821
We're using this particular shape to demonstrate the functionality of the gate. We will use the bottleneck to ensure there is no way around the gate.
2922

30-
Run the game and use the [tile-fabricator](http://localhost:3000/tile-fabricator) to create tiles following the shape shown in the example above.
23+
Run the game and use the [tile-fabricator](http://redstone.downstream.game/tile-fabricator) to create tiles following the shape shown in the example above.
3124

3225
Once you've painted the tiles, click export, and save the output file as `Locations.yaml` in a new project folder on your computer.
3326

@@ -57,7 +50,7 @@ spec:
5750
5851
**Note:** later, we'll be using the item ID to verify the unit has the key in their inventory. If you're following along and want to use the same ID as we do, you should use the same name. Otherwise, you can run the command `ds get items -n local` while running the game to get a list of all the items in your world with their IDs.
5952

60-
One thing here that isn't clear is the icon. The best way to pick an icon is to open the [building-fabricator](http://localhost:3000/building-fabricator) where you can easily flick through the item icons available.
53+
One thing here that isn't clear is the icon. The best way to pick an icon is to open the [building-fabricator](http://redstone.downstream.game/building-fabricator) where you can easily flick through the item icons available.
6154

6255
You can change how much goo it costs the unit to craft this item.
6356

@@ -154,7 +147,7 @@ spec:
154147
facingDirection: LEFT
155148
```
156149

157-
Before continuing, you may want to use `ds apply` ([see tutorial-room-1](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#8-deploy-the-whole-map-folder)) to check your progress!
150+
Before continuing, you may want to use `ds apply` ([see tutorial-room-1](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#6-deploy-the-whole-map-folder)) to check your progress!
158151

159152

160153
# 5. Gate
@@ -386,11 +379,11 @@ spec:
386379
location: [8, -1, -7]
387380
facingDirection: RIGHT
388381
```
389-
2. Run `ds apply` ([see tutorial-room-1](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#8-deploy-the-whole-map-folder)) and refresh!
382+
2. Run `ds apply` ([see tutorial-room-1](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#6-deploy-the-whole-map-folder)) and refresh!
390383
391384
392385
# You did it, good job! 🥳
393386
394387
At this point, everything should be working! Feel free to refer to the example files to learn more about the implementation.
395388
396-
<img src="./readme-images/step6.png" width=600>
389+
<img src="./readme-images/step6.png" width=600>

contracts/src/maps/tutorial-room-3/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
We will follow the steps below to create a series of quests which you will use to guide the player to complete various tasks.
66

77
## 1. Preparation
8-
- Before starting, ensure that you have deployed an instance of Downstream locally using Docker. You can find instructions on how to do that in [Tutorial 1 here](../tutorial-room-1/README.md).
8+
- Make sure you have followed [Tutorial 1](../tutorial-room-1/README.md) & [Tutorial 2](../tutorial-room-2/README.md).
99
- You should also copy the CastleOfTreasure .yaml, .sol and .js files out of the tutorial room 3 folder and paste them into your working folder. To save you some time drawing a map, you can also copy the Tile.yaml.
1010

1111

@@ -119,7 +119,7 @@ We will use the Downstream CLI to deploy our newly created building to our local
119119
Run the following in a terminal in the folder with your exported building source (refer to tutorial 1 for more information).
120120

121121
```
122-
ds apply -n local -z 1 -k <private-key> -R -f ./
122+
ds apply -n redstone -z <zone-number> -R -f ./
123123
```
124124
125125
You should see an output like this:

contracts/src/maps/tutorial-room-4/README.md

+15-7
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ Once complete, your map should something look like this:
1414

1515
## 1. Setup
1616

17-
Follow steps 1 through 4 of `tutorial-room-1` to get started. This will walk you through:
18-
- Deploying the game
19-
- Spawning a unit
20-
- Creating a map
21-
- Deploying new tiles
17+
Please ensure you have completed Tutorials 1-3.
18+
19+
Let's create the disco room!
2220

2321
https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md
2422

@@ -190,7 +188,7 @@ function themedRandomColour(){
190188
191189
if `disco` is false, it makes each tile (except for the one the unit is standing on) blue.
192190
193-
And for colouring the tiles, that's it! Once you've passed in the `map` array we pushed to, to the `map`, feel free to [give it a test run](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#8-deploy-the-whole-map-folder)!
191+
And for colouring the tiles, that's it! Once you've passed in the `map` array we pushed to, to the `map`, feel free to [give it a test run](https://github.com/playmint/ds/blob/main/contracts/src/maps/tutorial-room-1/README.md#6-deploy-the-whole-map-folder)!
194192
195193
```js
196194
return {
@@ -413,8 +411,18 @@ return {
413411

414412
<img src="./readme-images/step5.png" width=600>
415413

414+
## 6. Deploy your files
415+
416+
We will use the Downstream CLI to deploy our newly created building to our local Downstream instance.
417+
418+
Run the following in a terminal in the folder with your exported building source (refer to tutorial 1 for more information).
419+
420+
```
421+
ds apply -n redstone -z <zone-number> -R -f ./
422+
```
423+
416424
## You did it, good job! 🥳
417425

418426
At this point, everything should be working! Feel free to refer to the example files to learn more about the implementation.
419427

420-
<img src="./readme-images/step6.png" width=600>
428+
<img src="./readme-images/step6.png" width=600>

0 commit comments

Comments
 (0)