-
Notifications
You must be signed in to change notification settings - Fork 45
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
Workspace.CollisionGroups
doesn't serialize anymore, and other collision group woes
#302
Comments
Workspace.CollisionGroups
doesn't serialize anymore, and other collision group problemsWorkspace.CollisionGroups
doesn't serialize anymore, and other collision group woes
So, I've done some digging and have discovered that this is not actually I've verified the other patches all applied to the current ( This patch file has been present for at least 3 years, so we've ended up insulated from the switch to The solution to this should be to add a patch that changes serialization, because that restores the old behavior, which is probably fine; I don't imagine that anyone will be loading files with two For posterity, here is the old patch for Lines 1 to 9 in 82e636e
As an addendum, I know that I should have caught this because the serialization was changed with my PR. However, going forward I will be more careful with database updates and hopefully everyone else will be too. |
To be clear, the format of Anyway, the solution seems straightforward: we should patch |
Yes, I'm aware. But what I'm saying is it changing was invisible to us as a fluke. It could have (and did) happened at any point and we wouldn't have noticed until now since it was being corrected anyway. It is a consequence of swapping to I agree though. We should prioritize giving first class support to collision groups but that's out of scope for fixing this problem. A quick fix is to repatch |
Fixes #302's main issue, where `Workspace.CollisionGroups` no longer serializes. Also updates the database to 582, which includes the changed serialization. Relevant diff is at lines 57299-57316 in the JSON database, if you want to check.
This is a bit of a multilayered issue, so bear with me....
Changes to the collision group API
The potential for problems with collision groups seems to begin in September 2022, when Roblox made changes to the collision groups API. As part of this change, it looks like
Workspace.CollisionGroups
was superseded byWorkspace.CollisionGroupData
.User reports of problems with collision groups
I can find reports of problems in the Rojo ecosystem involving
Workspace.CollisionGroupData
going back to January 2023. I'll provide an illuminating excerpt from a conversation in the Roblox OSS Discord server:"Default^0^-1\\Bullet^1^-1"
User1 wanted to use collision groups in their Rojo project, learned about the
Workspace.CollisionGroups
format, and also discoveredWorkspace.CollisionGroupData
.Just for more background, I attempted a special representation for collision groups for rbx-dom (in the same vein as Attributes) a while ago (before the collision group API changes) in #206. Some of the tests show the format of
Workspace.CollisionGroups
. The format is different thanWorkspace.CollisionGroupData
!Introduction of rbx_reflector, and continued reports
Fast forward to now: we started using rbx_reflector. We had another user report a problem while using
Workspace.CollisionGroups
(with the correct format and everything), in their Rojo project, Rojo building, then using Lune 0.7.2 (which uses a rbx_reflector database) to do some additional processing and serialize the place back out.Workspace.CollisionGroups
did not serialize, when it did before. What gives?rbx_reflector uses Roblox Studio's
-FullAPI
option to obtain a reflection metadata dump, whereas the older generate_reflection used-API
. I bet thatWorkspace.CollisionGroupData
was not present in the normal dump, but is present in the full dump. Using this hypothesis, it looks like #276 was the first time we committed rbx_reflector results to the repo. In this PR, we can see from the changes inrbx_dom_lua/src/database.json
thatWorkspace.CollisionGroupData
was added, and thatWorkspace.CollisionGroups
no longer serializes, which ultimately explains the problem.Conclusions
The only question left is what rbx-dom is supposed to do about all this. I think an easy fix is to patch
Workspace.CollisionGroups
so that it serializes again (I'm certain Roblox still supports reading this property, and maybe they will indefinitely). If we do this, I don't think there will be problems unless a user does something really weird like insertCollisionGroups
andCollisionGroupData
properties into the sameWorkspace
, but I'm open to being proven wrong!Beyond that, I'm not sure; a special
CollisionGroups
property + representation forWorkspace.CollisionGroupData
(likeTags
orAttributes
) is not out of the question, but there are compat concerns for users who already useCollisionGroups
with the old format, and it's out of scope for this issue anyway. We could also think about migratingWorkspace.CollisionGroups
toWorkspace.CollisionGroupData
.As for for what lessons can be learned from this? We should probably scrutinize changes to the database more closely, and take special note of when we start using new tech.
The text was updated successfully, but these errors were encountered: