Skip to content

Order written objects by path_id#359

Open
sw1tchbl4d3r wants to merge 1 commit intoK0lb3:masterfrom
sw1tchbl4d3r:order-pathids
Open

Order written objects by path_id#359
sw1tchbl4d3r wants to merge 1 commit intoK0lb3:masterfrom
sw1tchbl4d3r:order-pathids

Conversation

@sw1tchbl4d3r
Copy link

Discovered by nesrak1, from discussion on the the Discord: https://discord.com/channels/603359898507673630/1407381658151292988/1468551292400959598

Unity requires the written objects to be sorted by path_id sequentially.
Newer Unity versions seem to work with a scrambled order, but older versions like 2018.4.2f1 will refuse to load objects that are written out of order.
Since dictionaries in python maintain insertion order, if a new object is added to the dictionary, it will be appended to the very end, meaning any freshly inserted objects with a new path_id will not load correctly in older Unity versions.

I'm not sure about the performance impact here with larger bundle files, if it does become an issue there might be ways to ensure the correct order on insertion (not sure if a dictionary is the correct backing structure for that though.)

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.

1 participant