Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StaticEntities #219

Open
menduz opened this issue Apr 19, 2023 · 0 comments
Open

StaticEntities #219

menduz opened this issue Apr 19, 2023 · 0 comments

Comments

@menduz
Copy link
Member

menduz commented Apr 19, 2023

Context

In order to facilitate communication between the renderer and the scenes, a special number of reserved entities are needed. These entities hold no special logic compared to other entities, but they have static IDs that systems can use to share information about the renderer, player, camera, etc.
Decision

We will reserve 512 static entities numbers, starting at 0. The "0" entity will be the root entity of the scenes, and all other entities will be parented to it by default.
List of static entities per scene

  • RootEntity = 0: It is the root of the scene.

    • The SceneInformation component (READ ONLY) of the root entity has the scene metadata (scene.json), the content mappings, and the scene id.
    • TBD: The ForeignEntitiesFrom { names: string[] } component is set from the scene itself and is used to signal the renderer about Foreign entity replication policies.
    • TBD: The ForeignEntitiesReservation { name: string, from: Entity, to: Entity } component is used to signal the renderer (or other actors) that this scene CAN share its entities as ForeignEntities.
    • The LoadingState { status = LOADING/RUNNING/PAUSED } component is set by the renderer.
    • TBD: The CommsState component is set by the kernel and used to query information about the current Comms connection (including realm).
  • PlayerEntity = 1: Represents the current player avatar.

    • The Transform component is READ/WRITE from the scene.
    • TBD: The PlayerPortableExperiences component (READ ONLY) contains information about the current portable experiences run by the user.
    • TBD: The PlayerIdentity component (READ ONLY) contains information about the Ethereum address, guest mode, and names of the player.
    • TBD: The (internal) AvatarShape component (READ ONLY) contains information about the wearables, hair, eyes and skin colors, and the equipped wearables.
  • CameraEntity = 2:

    • The Transform component is READ ONLY from the scene.
    • The PointerLocked component (READ ONLY) presence signals the status of the pointer-locking of the renderer.
    • The `WindowIdle`` component (READ ONLY) presence signals if the renderer is in background-mode or it is actively rendering.
    • The CameraMode { mode = ThirdPerson/FirstPerson } component is used to get the current camera mode; it is only set from the Renderer.

Consequences

By reserving a fixed number of static entities and assigning specific roles to them, we simplify the renderer-scene communication. This decision will make it easier for systems to share information about the renderer, player, camera, etc.

However, it is important to note that some of the components mentioned above are still TBD and may be subject to future revisions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant