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

Editable level data #2

Open
idanarye opened this issue Jun 1, 2022 · 3 comments
Open

Editable level data #2

idanarye opened this issue Jun 1, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@idanarye
Copy link
Owner

idanarye commented Jun 1, 2022

No description provided.

@idanarye idanarye added the enhancement New feature or request label Jun 1, 2022
@idanarye
Copy link
Owner Author

idanarye commented Nov 8, 2023

This probably warrens the addition of "level types", that decide which components go on the level (similar to entity types)

@charlieamer
Copy link

Hello. Is this an issue about being able to edit level-specific data? For example, I would like to have a different value for gravity in a different level.

I need that in my game. Has this part of editor been started by anyone else? If there is no progress, I might be interested in editing yoleck to support this feature.

@idanarye
Copy link
Owner Author

idanarye commented Jan 9, 2025

I haven't really been working on Yoleck for a long while now - since about the time the announcements about the Bevy Editor. I believe that once the official editor is out I'll want to either refactor Yoleck to work with it (and also evaluate the Bevy UI and see if I can use it instead of egui), or - if I see that the new editor makes Yoleck redundant - abandon the project.

There is also Blenvy, which the community seem to converge around (even though it's still in alpha)

And I don't think anyone else is working on it. This plugin is not that popular to get many contributes. If you want to work on it - go ahead.

I did have some design in my head about this feature:

ECS

In #25 I've made the levels into entities, and part of the reasoning was that level data can be placed on these entities as components - just like regular entity data is components on the entities.

I think level data can share the YoleckComponent trait with regular entity data. I see no reason to make a special component and duplicate everything.

As for how that level data will be used:

  • You can add a system to YoleckSchedule::LevelLoaded and have it modify things before the populate systems get to work on the entities.
  • You can use YoleckBelongsToLevel to get the level entity a Yoleck entity belongs to, and then use another query to get the data from the level entity..
  • You can just query entities with the YoleckKeepLevel marker component (or maybe we should another component to mark levels? YoleckKeepLevel's main job is to tell Yoleck to unload the level when you remove it)

File Format

I already saved a slot for this in YoleckRawLevel - its second field, which is currently private and nothing uses it. It should work like the data field (the second field) of YoleckRawEntry - the keys will be the component types' names and the values will be the deserialized into components that get placed on the level entity.

Editing UI

This is the tough part - I'm not really sure how to do this. Several things I considered:

  1. Have a list similar to YoleckEditSystems but put level editing systems in it instead. Have folding header in the egui window that runs all these systems.
  2. When no entity is selected, select the level entity. Then use regular edit systems.
  3. Similar, but instead of auto-selecting the level have a button to select it.

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