-
Notifications
You must be signed in to change notification settings - Fork 10
ADR 259: skybox time #293
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
Open
nearnshaw
wants to merge
4
commits into
main
Choose a base branch
from
skybox-time
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ADR 259: skybox time #293
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,79 @@ | ||||||
| --- | ||||||
| layout: adr | ||||||
| adr: 259 | ||||||
| title: Skybox Time | ||||||
| date: 2025-03-13 | ||||||
| status: Draft | ||||||
| type: RFC | ||||||
| spdx-license: CC0-1.0 | ||||||
| authors: | ||||||
| - nearnshaw | ||||||
| --- | ||||||
|
|
||||||
| ## Abstract | ||||||
|
|
||||||
| The current protocol supports allowing a scene to have a fixed time of day, but it doesn't allow the creators to change it on the fly. | ||||||
|
|
||||||
| This is a problem if we want to make time of day feel more dynamic and alive. It could be used as a narrative element, or to enhance the experience of a scene, ie: have the sun come up on queue at the end of a dj set. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| This ADR proposes a new component that will allow creators to change the time of day on the fly. | ||||||
|
|
||||||
|
|
||||||
| ## Skybox Time Component | ||||||
|
|
||||||
| The new component will be called `SkyboxTime`. It's meant to be added to the root entity of the scene. It will have the following properties: | ||||||
|
|
||||||
| - `time`: The time of day, represented as a number of seconds since the start of the day (in Decentraland time). | ||||||
|
|
||||||
| - `transitionMode` (optional): Allows to specify the direction of the transition. It can be `forward` or `backward`. It should be `forward` by default. | ||||||
|
|
||||||
| Tip: To interpret to this value, divide the seconds value by 60 to obtain minutes, and by 60 again to obtain the hours since the start of the day. For example, if the seconds value is 36000, it corresponds to 10:00 am. | ||||||
|
|
||||||
| This form of expressing the time of day is consistent with the way we express the `fixedTime` on the scene.json file. | ||||||
|
|
||||||
| If this component is not present, the scene will follow the same day/night cycle as Genesis City. If the component is present, the scene will have a fixed time of day, using the time value specified by the component. | ||||||
|
|
||||||
|
|
||||||
| ## Transitioning time | ||||||
|
|
||||||
| Whenever the `time` property changes, the scene will transition to the new time of day over a period of time to avoid abrupt changes. The details about this transition are to be defined by each engine. We're intentionally not exposing a `transitionTime` property in this component, as we want to provide that control to the engine. | ||||||
|
nearnshaw marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| If the component is removed, the scene will transition back to the prior day/night time. | ||||||
|
|
||||||
| ## Hierarchy of day/night definitions | ||||||
|
|
||||||
| Since day/night settings can be defined at various levels, we need to define the hierarchy of these settings. From highest to lowest priority, the weight of the settings are: | ||||||
|
|
||||||
| 1. The `SkyboxTime` component. | ||||||
| 2. The `fixedTime` property in the scene.json file. | ||||||
| 3. The fixed time of day defined by the player via the UI. | ||||||
| 4. The time of day as defined globally in Decentraland. | ||||||
|
|
||||||
| This component will take hierarchy over any other day/night definitions. While this component is present, players will not be able to force the day/night cycle to change from their UI. | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
| ### Code helpers | ||||||
|
|
||||||
| Since the form of expressing time is not entirely intuitive, we'll explore providing a helper function on the component, to allow expressing the time of day in a more natural way. The exact details are yet to be defined. | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
| ## Serialization | ||||||
|
|
||||||
| ```yaml | ||||||
|
|
||||||
| ``` | ||||||
|
|
||||||
| ```protobuf | ||||||
|
|
||||||
| ``` | ||||||
|
|
||||||
| ## Semantics | ||||||
|
|
||||||
| ### Example | ||||||
|
|
||||||
|
|
||||||
| ```ts | ||||||
| SkyboxTime.create(engine.rootEntity, {time: 36000}) | ||||||
| ``` | ||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.