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

Document and rename bevy::scene::Entity #3233

Closed
alice-i-cecile opened this issue Dec 2, 2021 · 3 comments
Closed

Document and rename bevy::scene::Entity #3233

alice-i-cecile opened this issue Dec 2, 2021 · 3 comments
Labels
A-Scenes Serialized ECS data stored on the disk C-Code-Quality A section of code that is hard to understand or change C-Docs An addition or correction to our documentation C-Usability A simple quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@alice-i-cecile
Copy link
Member

How can Bevy's documentation be improved?

This type (docs, source) appears to be used to store reflected entities, along with their components in scenes. However, it is a) completely lacking documentation b) very confusingly named: Entity is one of our most important types, and this is closely-related but distinct in important ways.

At a glance, this seems to be a reflection-powered serializable representation of an entity and its components. The entity: u32 field is likely for use with Entity::new() (the standard Entity type), and the entire DynamicScene type is used to spawn groups of entities which contain a number of entities, each with their own run-time defined set of components. These DynamicScenes can be written to file, but not read from.

Later in the same file, EntityMap is used, which contains a map between entities, in the standard bevy_ecs sense. This naming convention seems to be fine.

My first impulse would be to call this DynamicEntity, but please, bikeshed me if you disagree.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation C-Code-Quality A section of code that is hard to understand or change C-Usability A simple quality-of-life change that makes Bevy easier to use A-Scenes Serialized ECS data stored on the disk labels Dec 2, 2021
@alice-i-cecile alice-i-cecile changed the title Document and rename bevy::Scene::Entity Document and rename bevy::scene::Entity Dec 2, 2021
@cart
Copy link
Member

cart commented Dec 2, 2021

Yup I generally try to treat Bevy as a "global namespace" and this very clearly breaks that rule of thumb.

@Davier
Copy link
Contributor

Davier commented Dec 2, 2021

DynamicEntity seems very appropriate.

These DynamicScenes can be written to file, but not read from.

We get a Handle<DynamicScene>> when loading a serialized scene from file:

let scene_handle: Handle<DynamicScene> = asset_server.load("scenes/load_scene_example.scn.ron");

(However, we get a Handle<Scene> type when loading a glTF scene, which might be confusing).

@alice-i-cecile alice-i-cecile added the D-Trivial Nice and easy! A great choice to get started with Bevy label Dec 2, 2021
@alice-i-cecile
Copy link
Member Author

I've added the good-first-issue tag to this: if you're picking this up; feel free to add very basic docs in your PR. We can help amend them in the process, or expand them in future work and even basic docs are dramatically better than nothing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Scenes Serialized ECS data stored on the disk C-Code-Quality A section of code that is hard to understand or change C-Docs An addition or correction to our documentation C-Usability A simple quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants