-
Notifications
You must be signed in to change notification settings - Fork 49
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
rbx-dom should populate default properties on instances #385
Comments
The |
A few more questions:
|
I think populating all default properties is probably a bad idea since it would massively increase the memory consumption for some Instances (I'm thinking about Part, as an example). Having the parsers do it is weird because it means that they become opinionated instead of neutral. I'm thinking we may want a method or two in rbx_dom_weak to apply the default properties of an Instance when given a reflection database. That means the DOM would only need |
This sounds reasonable and would work alright, but I remain concerned about correctness, and making the pit of success as wide and easy to fall into as possible.
Considering that rbx-dom is predominantly used to read files saved by Roblox Studio - which does include all the properties - I'm not sure if this is an actual problem. As far as I know, it is not possible to get Roblox to save files that have missing properties, and you must use a tool like Rojo or Lune (or rbx-dom manually, of course). I guess we can measure the real impact, combine this with the previous observation, and go from there? |
I've ran into an instance while implementing Syncback for Rojo where information on 'correctness' would be useful. I'm curious what your thoughts would be on including properties like For syncback, I'm stripping out as many properties as possible to ease diffing two DOMs, but there's no easy metric for this. Right now I'm just using "scriptable" and "not scriptable" but I would like to differentiate between "important" and "not important" too since there are a fair few unscriptable properties that are critical to being able to build a place file correctly. |
Well, here it's looking like at least rbx-dom's serializers definitely should write all properties so they always produce correct results, but I'm not totally sure about Rojo's syncback. Based on the information in this issue, and the observations in your comment, I think excluding unscriptable properties from syncback would lead to incorrectness. Maybe the path forward there is considering all properties, while blacklisting any properties that are problematic for whatever reason?
|
My concern with that strategy is that I imagine a lot of people will want to run syncback on their game and then just use the output for serving into Studio. If there's a bunch of properties that can't be scripted, it's a bad UX, especially for services like Lighting and Workspace, which have a fair few unscriptable properties. These are important if you're using the project for I'm also trying to avoid blacklisting or whitelisting properties because it isn't sustainable and feels out of place in Rojo. I'd ideally like rbx-dom to track the information I need for this implementation instead, even if that information is written manually. |
I'm aware of the following properties which can lead to annoying, surprising, or incorrect behavior:
Terrain.ShorelinesUpgraded
When this property is missing, Roblox Studio prompts the user to upgrade their terrain shorelines.
Workspace.ExplicitAutoJoints
When this property is missing, Roblox Studio generates
Snap
instances underneath contacting parts, depending on their surfaces.Model.NeedsPivotMigration
When this property is missing, Roblox Studio does not apply model pivots.
The question is whether rbx-dom should ensure these properties get set to sensible values, or if the responsibility should be pushed off to consumers. I'm leaning towards the former - it's not obvious whatsoever that these properties even exist! I think we could set these to good defaults in rbx_dom_weak.
The text was updated successfully, but these errors were encountered: