Skip to content

Commit

Permalink
Dev exp improvements (#371)
Browse files Browse the repository at this point in the history
* several fixes

* scene from example

* cross links
  • Loading branch information
nearnshaw committed Mar 26, 2024
1 parent 480e55e commit 0e7a28d
Show file tree
Hide file tree
Showing 18 changed files with 226 additions and 220 deletions.
42 changes: 17 additions & 25 deletions content/creator/scenes/getting-started/preview-scene.md
Expand Up @@ -23,18 +23,15 @@ To run a scene preview using the Decentraland Editor:

Make sure you've [installed the Decentraland editor]({{< ref "/content/creator/scenes/getting-started/installation-guide.md#the-decentraland-editor" >}}).

1. Open your scene's folder using Visual Studio Code.

1) Open your scene's folder using Visual Studio Code.
> Note: The Visual Studio window must be at the root folder of the scene project.
> Note: The Visual Studio window must be at the root folder of the scene project.
2. Open the Decentraland Editor tab on Visual Studio. Note that the bottom section lists all of your project's currently installed dependencies.

2) Open the Decentraland Editor tab on Visual Studio. Note that the bottom section lists all of your project's currently installed dependencies.
3. Click the **Run Scene** button.

3) Click the **Run Scene** button.

This opens a new tab in Visual Studio Code, running the Decentraland scene, just like in a web browser tab.

Optionally click **Open in browser**, over the top margin of the tab to run the preview in a web browser window.
This opens a new browser tab running the Decentraland scene.

## Using the CLI

Expand All @@ -61,7 +58,7 @@ Any dependencies that are missing are installed and then the CLI opens the scene
Every time you make changes to the scene, the preview reloads and updates automatically, so there's no need to run the command again.

{{< hint warning >}}
**📔 Note**: Some scenes depend on an external server to store a shared state for all players in the scene. When previewing one of these scenes, you'll likely have to also run the server locally on another port. Check the scene's readme for instructions on how to launch the server as well as the scene.
**📔 Note**: Some scenes depend on an external server to store a shared state for all players in the scene. When previewing one of these scenes, you'll likely have to also run the server locally on another port. Check the scene's readme for instructions on how to launch the server as well as the scene.
{{< /hint >}}

### Parameters of the preview command
Expand All @@ -78,17 +75,15 @@ You can add the following flags to the `dcl start` command to change its behavio
- `--desktop-client` Runs the preview in the Decentraland Desktop client

{{< hint warning >}}
**📔 Note**: To preview old scenes that were built for older versions of the SDK, you must set the corresponding version of `decentraland-ecs` in your project's `package.json` file.
**📔 Note**: To preview old scenes that were built for older versions of the SDK, you must set the corresponding version of `decentraland-ecs` in your project's `package.json` file.
{{< /hint >}}


## Upload a scene to decentraland

Once you're happy with your scene, you can upload it and publish it to Decentraland, see [publishing]({{< ref "/content/creator/scenes/publishing/publishing.md" >}}) ) for instructions on how to do that.

You can also upload a preview to a free 3rd party server, [see instructions here]({{< ref "/content/creator/scenes/publishing/deploy-third-party.md" >}}).


## Preview scene size

The scene size shown in the preview is based on the scene's configuration. By default, the scene occupies a single parcel (16 x 16 meters).
Expand All @@ -110,28 +105,25 @@ If you're building a scene to be uploaded to several adjacent parcels, you can e
You can also change the coordinates by running the `dcl coords` command from the command line, this is especially useful on large scenes with many parcels. See [set parcels via the command line]({{< ref "/content/creator/sdk7/projects/scene-metadata.md#set-parcels-via-the-command-line">}}) for more details.

{{< hint info >}}
**💡 Tip**: While running the preview, the parcel coordinates don't need to match those that your scene will really use, as long as they're adjacent and are arranged into the same shape. You will have to replace these with the actual coordinates later when you [deploy the scene](#upload-a-scene-to-decentraland).
**💡 Tip**: While running the preview, the parcel coordinates don't need to match those that your scene will really use, as long as they're adjacent and are arranged into the same shape. You will have to replace these with the actual coordinates later when you [deploy the scene](#upload-a-scene-to-decentraland).
{{< /hint >}}

## Run preview in Desktop

To run a preview scene in the Desktop native client, instead of in the web browser:


1) Make sure you have downloaded and installed the [Windows](https://decentraland.org/download/) or [Mac](https://github.com/decentraland/explorer-desktop-launcher/releases/latest/download/Decentraland.dmg) desktop client.
To run a preview scene in the Desktop native client, instead of in the web browser:

2) Run the preview with:
1. Make sure you have downloaded and installed the [Windows](https://decentraland.org/download/) or [Mac](https://github.com/decentraland/explorer-desktop-launcher/releases/latest/download/Decentraland.dmg) desktop client.

`dcl start --desktop-client`
2. Run the preview with:

3) Copy the URL provided by the console output under **Desktop Client** and paste in your browser.
`dcl start --desktop-client`

> Note: The Browser might ask you for permission to open an external executable: Decentraland. Select **Open**.
3. Copy the URL provided by the console output under **Desktop Client** and paste in your browser.

4) You'll see the following screen. Check that the URL is correct, then click **Continue** to launch the preview.
> Note: The Browser might ask you for permission to open an external executable: Decentraland. Select **Open**.
![](/images/media/desktop-preview.png)
4. You'll see the following screen. Check that the URL is correct, then click **Continue** to launch the preview.

If you need to manually add anything to the URL, to change the default way the scene runs, tick the box **Add custom URL parameters** and write those in the dialog below.
![](/images/media/desktop-preview.png)


If you need to manually add anything to the URL, to change the default way the scene runs, tick the box **Add custom URL parameters** and write those in the dialog below.
82 changes: 36 additions & 46 deletions content/creator/scenes/publishing/publishing.md
Expand Up @@ -24,10 +24,10 @@ Make sure of the following:

- You own or have permissions to the necessary amount of adjacent LAND parcels. Otherwise you can purchase LAND in the [Market](https://market.decentraland.org).

- You may also choose to publish your scene to a Decentraland [World]({{< ref "/content/creator/worlds/about.md" >}}), in this case, you must own a NAME which you can mint on the [Builder](https://builder.decentraland.zone/names) and your scene must comply with the World limits.
- You may also choose to publish your scene to a Decentraland [World]({{< ref "/content/creator/worlds/about.md" >}}), in this case, you must own a NAME which you can mint on the [Builder](https://builder.decentraland.zone/names) and your scene must comply with the World limits.

{{< hint warning >}}
**📔 Note**: Multi-parcel scenes can only be deployed to adjacent parcels.
**📔 Note**: Multi-parcel scenes can only be deployed to adjacent parcels.
{{< /hint >}}

## Check scene data
Expand All @@ -52,56 +52,53 @@ Open your scene's _scene.json_ file and complete the following data:

- **rating**: This is used to classify the content of your scene based on its appropriateness for different age groups (`T` for Teens or `A` for Adults). It helps in filtering content for players.


{{< hint warning >}}
**📔 Note**: See [scene metadata]({{< ref "/content/creator/scenes/projects/scene-metadata.md" >}}) for more details on how to set these parameters.
**📔 Note**: See [scene metadata]({{< ref "/content/creator/scenes/projects/scene-metadata.md" >}}) for more details on how to set these parameters.
{{< /hint >}}

## To publish the scene

### Via the Decentraland Editor

Make sure you've [installed the Decentraland editor]({{< ref "/content/creator/scenes/getting-started/installation-guide.md#the-decentraland-editor" >}}).
Make sure you've [installed the Decentraland editor]({{< ref "/content/creator/scenes/getting-started/installation-guide.md#the-decentraland-editor" >}}).

{{< hint warning >}}
**📔 Note**: Deployment to Worlds is not yet supported from the Editor.
**📔 Note**: Deployment to Worlds is not yet supported from the Editor.
{{< /hint >}}

1) Open your scene's folder using Visual Studio Code.
1. Open your scene's folder using Visual Studio Code.

{{< hint warning >}}
**📔 Note**: The Visual Studio window must be at the root folder of the scene project.
**📔 Note**: The Visual Studio window must be at the root folder of the scene project.
{{< /hint >}}

2) Open the Editor's menu, by clicking the Decentraland logo on the tabs on the left. Then click **Publish scene**.

This opens a new tab in Visual Studio, showing what parcels you're deploying to.
2. Open the Editor's menu, by clicking the Decentraland logo on the tabs on the left. Then click **Publish scene**.

3) Approve the transaction
This opens a new tab in Visual Studio, showing what parcels you're deploying to.

- If the LAND tokens you own or have permissions are linked to a wallet you can use via Wallet Connect, click **Connect wallet**, then scan the QR code with your mobile device and follow the steps on Wallet Connect.
- If you need to use Metamask on the browser, click **Open in Browser** to open this same window on a browser tab. Then approve the transaction on the Metamask browser extension.
3. Approve the transaction

- For LAND on a Metamask browser extension, click **Approve**. Then approve the transaction on the Metamask browser extension.
- For LAND linked to a wallet you can use via Wallet Connect, click **Connect wallet**, then scan the QR code with your mobile device and follow the steps on Wallet Connect.

### Via the CLI


1. Log into your Metamask account with the same public address associated with your parcels in Decentraland.
2. Run `dcl deploy` from the scene's folder.
{{< hint info >}}
**💡 Tip**: If there are files in your project folder that you don't want to deploy, list them in the _.dclignore_ file before deploying.
{{< /hint >}}
3. Optionally, you can also use the `--target-content` parameter with a World server URL in order to upload the scene to a World instead of to the Genesis City, for example `dcl deploy --target-content https://worlds-content-server.decentraland.org`.
{{< hint info >}}
**💡 Tip**: If there are files in your project folder that you don't want to deploy, list them in the _.dclignore_ file before deploying.
{{< /hint >}}
3. Optionally, you can also use the `--target-content` parameter with a World server URL in order to upload the scene to a World instead of to the Genesis City, for example `dcl deploy --target-content https://worlds-content-server.decentraland.org`.

4. A browser tab will open, showing what parcels you're deploying to. Click **Sign and Deploy**.
5. Metamask opens, notifying you that your signature is requested. Click **Sign** to confirm this action.

{{< hint info >}}
**💡 Tip**: If you're implementing a continuous integration flow, where changes to your scene are deployed automatically, then you can set the `export DCL_PRIVATE_KEY` environment variable to the private key of an account that has deploy permissions.
**💡 Tip**: If you're implementing a continuous integration flow, where changes to your scene are deployed automatically, then you can set the `export DCL_PRIVATE_KEY` environment variable to the private key of an account that has deploy permissions.
{{< /hint >}}

{{< hint info >}}
**💡 Tip**: `dcl deploy` runs a `dcl build`, which checks the scene for type errors more strictly than running `dcl start`. If these errors can't be avoided (eg: they happen in an external library) and they don't impact the scene, you can use `dcl deploy --skip-build` to skip the `dcl build` step and deploy the scene as it is.
**💡 Tip**: `dcl deploy` runs a `dcl build`, which checks the scene for type errors more strictly than running `dcl start`. If these errors can't be avoided (eg: they happen in an external library) and they don't impact the scene, you can use `dcl deploy --skip-build` to skip the `dcl build` step and deploy the scene as it is.
{{< /hint >}}

## Publish from a hardware wallet
Expand Down Expand Up @@ -138,58 +135,52 @@ The information on each copy of the server is verifiable, as each scene is signe
You can deploy content to the test catalyst server to run full tests with multiple users, the sourrounding scenes, and an environment that is identical to production. The test server is identical to all other catalyst servers, the difference is that the content that is deployed to this server isn't propagated to the others. Content deployed to other servers on the other hand does get propagated to this server, so surrounding scenes should look as they will in production.

{{< hint warning >}}
**📔 Note**: To deploy to parcels in the test server, you must have the same permissions required to deploy to those parcels in the main network.
**📔 Note**: To deploy to parcels in the test server, you must have the same permissions required to deploy to those parcels in the main network.
{{< /hint >}}

Players are never directed to this server, the only way to access it is to explicitly provide a URL parameter to connect to it.
Players are never directed to this server, the only way to access it is to explicitly provide a URL parameter to connect to it.

If you're working in a confidential project that you don't want to unveil until launch, note that the test server is relatively hidden from players, but anyone explicitly using the test server's URL could potentially run into it.


### Via the Decentraland Editor

To deploy a scene to the test server:

1. Open VSCode in a Decentraland scene project.
2. Click on the Decentraland icon on the left sidebar.
4. Click on the three dot menu at the top right of the sidebar, next to the green reload arrow button, select `Publish scene to test server`
5. Approve the transaction

- If the LAND tokens you own or have permissions are linked to a wallet you can use via Wallet Connect, click **Connect wallet**, then scan the QR code with your mobile device and follow the steps on Wallet Connect.
- If you need to use Metamask on the browser, click **Open in Browser** to open this same window on a browser tab. Then approve the transaction on the Metamask browser extension.
3. Click on the three dot menu at the top right of the sidebar, next to the green reload arrow button, select `Publish scene to test server`
4. Approve the transaction
- For LAND on a Metamask browser account, confirm the deployment. Then approve the transaction on the Metamask browser extension.
- For LAND linked to a wallet you can use via Wallet Connect, click **Connect wallet**, then scan the QR code with your mobile device and follow the steps on Wallet Connect.

To enter the content server, add `&CATALYST=peer-testing.decentraland.org` to the Decentraland URL

_play.decentraland.org/?&CATALYST=peer-testing.decentraland.org_


### Via the CLI

To deploy to the test server, run:

`dcl deploy --target peer-testing.decentraland.org`


To enter the content server, add `&CATALYST=peer-testing.decentraland.org` to the Decentraland URL

_https://play.decentraland.org/?CATALYST=peer-testing.decentraland.org_


## Verify deployment success

Once you deployed your scene, these changes will take a few minutes to be propagated throughout the various content servers in the network. If you enter Decentraland right after deploying, you might still see the previous version of your content, depending of what realm you enter.

After you sign to authorize the deployment of your scene, the signing dapp will start displaying confirmations that the new version of your content has been propagated throughout all of the servers in the network,
After you sign to authorize the deployment of your scene, the signing dapp will start displaying confirmations that the new version of your content has been propagated throughout all of the servers in the network,

You'll see a list of each of the servers that make up Decentraland's content network. For each server, it specifies the timestamp of the last uploaded change on that parcel. Each one of these servers refers to a different realm, you can reference how these server names map to realm names in the [catalyst monitor screen](https://decentraland.github.io/catalyst-monitor/).


You can also obtain this information at any time by running the following command on the command line console:

`npx @dcl/opscli pointer-consistency --pointer '0,0'`

{{< hint warning >}}
**📔 Note**: Use the coordinates of your scene instead of `0,0`. If your scene has multiple parcels, any one of its parcels will produce the same output. If the coordinates start with a negative number, add a `\` at the start of the coordinates to prevent the `-` character from being misinterpreted by the command line.
**📔 Note**: Use the coordinates of your scene instead of `0,0`. If your scene has multiple parcels, any one of its parcels will produce the same output. If the coordinates start with a negative number, add a `\` at the start of the coordinates to prevent the `-` character from being misinterpreted by the command line.
{{< /hint >}}

## Automatic deployments
Expand All @@ -210,21 +201,20 @@ env:
DCL_PRIVATE_KEY: ${{ secrets.DCL_PRIVATE_KEY }}

jobs:

deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install npm packages
run: |
npm install
- name: Build scene
run: |
npm run build:ci
- name: Deploy scene
run: |
npm run deploy:prod
- uses: actions/checkout@v2
- name: Install npm packages
run: |
npm install
- name: Build scene
run: |
npm run build:ci
- name: Deploy scene
run: |
npm run deploy:prod
```

> Important: For this process to run, you must set a wallet's private key as an environment variable in GitHub, this is used to sign the deployment. As always, be very careful with keeping the private keys secure. Do NOT use the private key of the account that actually owns the land tokens, as that would have very big risks. Instead, delegate operator rights to a disposable wallet that owns no valuable tokens. If this private key is ever leaked somehow, you can easily revoke those operator rights from the account and set up a new wallet.
2 changes: 1 addition & 1 deletion content/creator/sdk7/3d-essentials/entity-positioning.md
Expand Up @@ -13,7 +13,7 @@ You can set the _position_, _rotation_ and _scale_ of any entity by using the `T

## Editor UI

When dragging entities via the Inspector, in the [Decentraland Editor]({{< ref "/content/creator/scenes/getting-started/installation-guide.md#the-decentraland-editor" >}}), you are changing the values in the entity's Transform implicitly. By changing the position, rotation or scale of an entity, this changes the data in that entity's Transform component.
When dragging entities via the Visual Editor, in the [Decentraland Editor]({{< ref "/content/creator/scenes/getting-started/installation-guide.md#the-decentraland-editor" >}}), you are changing the values in the entity's Transform implicitly. By changing the position, rotation or scale of an entity, this changes the data in that entity's Transform component.

## Code essentials

Expand Down

0 comments on commit 0e7a28d

Please sign in to comment.