> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/contributor/contributor-es/tiempo-de-ejecucion-de-la-escena/overview.md).

# Resumen

El runtime de la escena de Decentraland es el entorno de ejecución aislado donde una [escena](https://github.com/decentraland/docs/tree/main/content/entity-types/scenes.md) ejecuta su script principal.

Cada escena se ejecuta dentro de su propio runtime aislado. Dentro de él, tiene acceso a ciertos [objetos globales](https://github.com/decentraland/docs/tree/main/contributor/globals.md) y puede importar [módulos](https://github.com/decentraland/docs/tree/main/contributor/modules.md) de la biblioteca del runtime.

```mermaid
flowchart TB
    subgraph WorldExplorer["Explorador de mundos"]
        subgraph Runtime1["Runtime 1"]
            Scene1["Escena"]
        end
        
        subgraph Runtime2["Runtime 2"]
            Scene2["Escena"]
        end
        
        subgraph Runtime3["Runtime 3"]
            Scene3["Escena"]
        end
        
        Scene1 --> Library["Biblioteca de módulos del runtime"]
        Scene2 --> Library
        Scene3 --> Library
    end
```

Al importar módulos de la biblioteca del runtime, las escenas tienen acceso a una amplia variedad de funcionalidades, incluidas:

* Crear entities y controlar su comportamiento
* Interactuar con el jugador
* Comunicarse con otros jugadores
* Inspeccionar el estado del mundo
* Conectarse a servicios externos
* Realizar pagos web3

En la práctica, las escenas incluyen el [Decentraland SDK](https://github.com/decentraland/docs/tree/main/contributor/creator/sdk7/getting-started/sdk-101.md) con su código, que encapsula la interfaz de estilo RPC de la biblioteca del runtime y proporciona una API más agradable y cómoda.

{% hint style="info" %}
Ten en cuenta que el SDK es *no* parte del protocolo de Decentraland, solo las interfaces de nivel inferior lo son. Las escenas pueden decidir si incluir el SDK o usar bibliotecas alternativas.
{% endhint %}

### Objetos globales

Dentro del entorno aislado, [escenas](https://github.com/decentraland/docs/tree/main/content/entity-types/scenes.md) se asume que ciertos objetos y funciones están disponibles globalmente. Algunos son objetos estándar de ES2020 (como `Date` o `Math`), y otros son inyectados por el runtime para implementar funcionalidades como requerir módulos, registrar mensajes y programar callbacks.

Ver [globales](https://github.com/decentraland/docs/tree/main/contributor/globals.md) para más detalles.

### Módulos

El [`require`](https://github.com/decentraland/docs/tree/main/contributor/globals.md#module) la función global puede importar módulos proporcionados por la [biblioteca del runtime](https://github.com/decentraland/docs/tree/main/contributor/execution.md). Estos módulos permiten importar selectivamente utilidades como los sistemas ECS o Communications.

Consulta la sección de módulos del runtime para obtener una lista completa.

### Ejecución

El runtime requiere que las escenas implementen un conjunto específico de métodos y garantiza que se llamarán según ciertas reglas.

Ver [ejecución](https://github.com/decentraland/docs/tree/main/contributor/execution.md) para más información sobre esto.

### Permisos

La funcionalidad sensible, como realizar solicitudes HTTP a servicios de terceros, está restringida por el runtime a menos que ciertos permisos sean solicitados por la [escena](https://github.com/decentraland/docs/tree/main/content/entity-types/scenes.md), y concedidos por el jugador.

Ver [permisos](https://github.com/decentraland/docs/tree/main/contributor/permissions.md) para saber más.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/contributor/contributor-es/tiempo-de-ejecucion-de-la-escena/overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
