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

Derive Reflect, MapEntities #3

Open
hankjordan opened this issue Dec 15, 2023 · 2 comments
Open

Derive Reflect, MapEntities #3

hankjordan opened this issue Dec 15, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@hankjordan
Copy link

In order to support bevy_scene or any other reflection-enabled save/load system for Bevy, you will need to derive Reflect on every Resource and Component that should be saved to disk.

This also allows real-time inspection with a tool like bevy-inspector-egui.

Any Components or Resources containing Entities should also implement MapEntities in order to properly handle unstable entity IDs.

I can put together a PR if you tell me which types should be included.

@443eb9
Copy link
Owner

443eb9 commented Dec 16, 2023

Thanks for reminding me about that! But I am not quite familiar with bevy_scene and the MapEntities and I'm afraid I can't handle them well, so please send a PR if you are willing to! I think these components will need it:

  • Tilemap Edit 2023.12.17: These three type does not contain entities.
  • PathTilemap
  • Tile
  • AnimatedTile
    (Hope I haven't miss any component)

These types will stay in scene as long as the game is running. I'm not quite sure if the components that will only exist temporarily in the scene need to be included. You can search Components in src/ and enable match case. Those I didn't mention above is components that will only exist temporarily.
And as bevy_scene can save tilemaps, I'm wondering if the save&load module in this crate is still necessary?

@443eb9 443eb9 added the enhancement New feature or request label Dec 16, 2023
@hankjordan
Copy link
Author

... And as bevy_scene can save tilemaps, I'm wondering if the save&load module in this crate is still necessary?

Probably should keep it, at least for performance reasons. Reflection can be slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants