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

Patch Lighting.Clocktime to serialize #315

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

Dekkonot
Copy link
Member

@Dekkonot Dekkonot commented Jul 7, 2023

Like it says on the tin.

@kennethloeffler
Copy link
Member

I'm a little lost here - did Lighting.ClockTime used to serialize? Does Roblox actually read and set this property on deserialization? Are there any related reports for e.g. Rojo or Lune?

@Dekkonot
Copy link
Member Author

Dekkonot commented Jul 7, 2023

Sorry, I was in a hurry when I made this PR and didn't provide as much background as I should have.

Rojo has gotten intermittent reports of ClockTime not being serialized (see rojo-rbx/rojo#655 for an example), so this just makes it serialize. It doesn't seem like it's ever been serialized by Roblox, but they deserialize it just fine and have since it was introduced.

Another solution would be to provide a migration of some sort for ClockTime to TimeOfDay, though I'm not sure how necessary it is. It's unlikely someone will have multiple instances of Lighting in a file so there's no compatibility concern.

@kennethloeffler
Copy link
Member

Not sure about this one, tbh.

I could totally see someone deserializing a place using Lune, (Lighting.TimeOfDay will exist in this case), then setting Lighting.ClockTime. Both properties will then exist and not be consistent with each other, similar to the concern I had in #302 with Workspace.CollisionGroups and Workspace.CollisionGroupData, except probably a lot more likely because the value formats for these lighting properties are a lot more approachable, and it's common for people to use them interchangeably. Can we test what Roblox does on deserialization when Lighting.TimeOfDay and Lighting.ClockTime are both serialized into the same file?

@Dekkonot
Copy link
Member Author

Dekkonot commented Jul 9, 2023

In what can only be described as cursed, Roblox seems to load whichever property appears first in the file. This means ClockTime when we build it ourselves.

Given this, I'm not sure what to do. A migration would probably work, though I'm not sure how Rojo would handle a file that had both if migrations were involved.

Copy link
Member

@kennethloeffler kennethloeffler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to serialize both until #277 is more fleshed out... the possible inconsistency kinda sucks, but hopefully it won't be too surprising to users

@Dekkonot Dekkonot merged commit 68d48b6 into rojo-rbx:master Jul 24, 2023
2 checks passed
@Dekkonot Dekkonot deleted the patch-clocktime branch July 24, 2023 00:13
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

Successfully merging this pull request may close these issues.

2 participants