-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
0.13 migration: Add section for entity niche optimization #1029
Comments
If you can find all places where there is an entity ID in the scene file, you can add 2^32 to the number (4294967296) or "10000000000" if you want to make it easier to keep different entities distinct to readers. If you have an exceptionally large file or you can't identify all places where you are serializing entities... Then I think you're up a creek w/o a paddle. In any case, as we are trying to move towards better scene files, I think that having to use such huge numbers for entities is a serious step back =/ I understand using NonZeroU32 for generation helps memory optimization, and using it for generation instead of index was less difficult, I think we need to have some way to represent entities in scene files with numbers at least as low as "1," especially since these entities are intended to be mapped to real entities later. |
Also while we're updating the migration guide, the migration guide entry for updating the serialization of |
@irate-devil What did you mean by
In the issue linked above, and would you have anything to add to a migration guide entry for this PR related to that? |
That's a confusing one. Opened a separate issue: #1030 |
Talking on discord, there's some hesitancy to offer migration tools. It seems like the migration guide's entry should read something along the lines of "Recreate your scenes, sorry. You can try to manually offset the ids if you want". If one were to create an automatic tool, the easiest path is probably to patch bevy (for the tool specifically) to modify the Entity deserialize to increment the generation, deserialize the scene, reserialize, save - should cover most basic cases. There was a brief mention that we should considering looking at some alternative to Entity as an identifier in scenes/networking, since the internals of Entity are an implementation detail and inherently kinda volatile, nothing set in motion from that, but yeah. |
Migration guide generator didn't catch
bevyengine/bevy#9907
Because it's unlabeled and the formatting of the description isn't correct.
Unfortunately, the migration section in the description doesn't actually offer any advice for migration, so we'll need to write some.
I'm not actually sure how people can migrate this, other than recreating their scenes. It might be possible to create a small program/script/abuse awk to bit-twiddle entity ids in scene files.
See bevyengine/bevy#11289 for an example of fixing a scene file.
More context: https://discord.com/channels/691052431525675048/1209244908372627507
The text was updated successfully, but these errors were encountered: