-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
LD49 Post-Mortem -- First use of Bevy & learnings #2914
Comments
Awesome feedback, thank you! I'll respond more fully below. @cart can you convert this to a discussion? I seem to have lost my ability to do so. |
Bevy bookYep, this is very much on the radar! https://github.com/bevyengine/bevy-website has some open PRs to implement https://github.com/bevyengine/rfcs/blob/main/rfcs/23-quick_start_book.md. I am personally working to complete at least the first two chapters (hopefully the first three) in time for 0.6's launch. Doc strings#2365 was recently merged and greatly improves on this. We agreed! UIYep, that was my experience working with it as well. I am optimistic that we can make some improvements to it (especially on the docs side) before we have a full rework ready to reduce the pain. AudioThis rings true. @NiklasEi, perhaps you or another contributor can help improve the setup instructions? |
Question time! I'm going to answer all of them here; these should be spun out into their own simple issues where possible.
Use
https://css-tricks.com/snippets/css/a-guide-to-flexbox/ is a guide to the spec we followed that is very useful. The remaining questions are all well addressed in bevyengine/bevy-website#182, which will be part of the Bevy book in.
fn despawn_all_entities_system(query: Query<Entity>, mut commands: Commands){
for entity in query.iter(){
commands.despawn(entity);
}
} Alternatively: fn despawn_all_entities_system(entity: Entities, mut commands: Commands){
for entity in entities {
commands.despawn(entity);
}
}
See above. Entities::contains is a dedicated method for this.
Add fn who_am_i_system(query: Query<(Entity, &A), With<B>>){
for (entity, a) in query.iter(){
dbg!(entity);
dbg!(a);
}
}
Use an exclusive system, created by calling |
This is very valuable feedback, thank you!
There is intent to improve the built-in Audio module, it just has not been a priority yet. Apart from that, it is still an open question which audio library we want to use. This is why
I created NiklasEi/bevy_kira_audio#24 to improve the documentation on how to set up and get started. |
Some more/alternative answers:
The reason you're getting those errors is because you are despawning an entity which still has 'in-flight' commands. The easiest way to avoid this is to make a custom stage to handle this despawning everything. We added an error message for this in #2581 Please note though, in general despawning all entities is a bad idea, because in future we expect certain resources to become entities, e.g. each Window would be an entity instead, so despawning all entities would also close all windows (and thus the app, at least by default)
I see that we do give access to
The most pure pattern to see whether an entity exists would be: fn check_whether_entity_exists(q: Query<()>){
let maybe_entity = ..;
let entity_exists = q.get(maybe_entity).is_ok();
} Of course, knowing whether an entity exists isn't too useful on its own, so you can use any other kind of query, which will then make this detect whether the entity exists and matches the given query. |
Thanks a lot everyone for the amazingly detailed answers and help on my questions! A few comments and answers in turn.
Ah, well, I didn't even know the UI followed the CSS spec, otherwise that would have helped. Did I miss it or is it not documented? Already calling that out would put new users in familiar territory as there's a huge amount of resources on CSS layout (and huge amount of pain centering a text; now that all makes sense! 😂).
I didn't realize
That sounds a bit contradictory to me maybe, or I misunderstood something. I totally get the "try as plugin" approach, which is common and good practice. But if you plan to use an external library instead of writing your own, why not just remove the default built-in one, and document that audio is at least for now only available via
Well, unless that "third party" is actually the closest there is to an official implementation, with a concrete plan to merge back if the experiment goes well, no? But again, I'd rather I think have no built-in audio, with a warning if I try to use it redirecting to a GitHub issue (like the rustc compiler does) or official docs explaining why and what are the alternatives. I don't see the value in having the current built-in default (with all due respect to whoever wrote that code, which at least served to demonstrate feasibility).
Yes; I was trying to work around some UI issue, some old UI elements affecting the layout of the ones in my next screen.
Makes good sense. As said above I didn't realize this was at all possible. Many thanks again everyone! ❤ |
Not documented. If you'd like to make a very quick PR to add basic docstrings to |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi everyone,
I wanted to do a post-mortem of my participation to Ludum Dare LDJam 49 which just finished, and my first-time use of Bevy Engine. I originally planned to do some blog-style or Twitter post somewhere, but I realized many of the comments and learnings from this first use could be used to improve Bevy.
I don't want this post to be seen as any kind of attack or anything like that, so first let me say that this project is quite frankly amazing, and got me started with a game in a matter of minutes. Congrats to all contributors, this is an awesome achievement!
However I believe in constructive criticism and the value of a fresh set of eyes, which provide an insight on the barrier to entry and any friction to adoption that daily contributors might not have anymore. I hope this post will be that.
Long story short, the tech is amazing, but the documentation very unequal in amount and quality. In some areas everything is quick and intuitive, while in others I lost hours trying to do a simple thing.
What went right
Examples
Overall some of the examples helped boostrap the project. Having a working reference from where to copy/paste code proved invaluable. The examples are still missing some things, but digging through them covers most of the basic things one would want to do. I wish I'd have read them earlier, I would have saved a lot more time.
Rendering, GLTF, ECS
I didn't try anything fancy, but rendering for me just worked, which is not something that often happens. GLTF support was best explained I think from this blog post, although I struggled with the
#Mesh0/Primitive0
part, as it seems object names exported from Blender didn't work (that's what I tried first). ECS finally was pretty much painless, much easier to grok than e.g. Unity's game objects and components, with an immediate intuitive idea of what to use for which purpose. There were some learnings along the way, but it was mostly OK.What didn't
I've read a large parts of the discussions on the lack of Editor, so I'll ignore that part. I'll just note that I spent 1 hour trying to place a plane on top of a cube ;) Sometimes something incomplete/imperfect is better than nothing.
Bevy book
The Bevy book is a nice introduction, but falls very short as it's missing so many elementary things. I ended up relying mainly on the Unofficial Bevy Cheat Book which contains a lot of things I'd have expected to see in the official book. Is there any possibility to integrate this work into the official one?
UI
Every single use in the game of UI was a major pain. It took me hours to find (or, hack together) how to display a single word of text on the screen. The UI system looks very powerful at first, but in practice falls short due to the lack of documentation and higher-level explanation of how the layout model works. I appreciate that the UI system seems marked for redesign for next version IIRC, but still, this is such a pain at the minute that a little bit of documentation would be greatly appreciated (unless I missed it, in which case I apologize in advance).
Code comments
There is a very large amount of code published in 0.5 without any comment, rendering docs.rs close to useless. With the otherwise lack of learning resources, this makes examples the only real source of information. This is a real missed opportunity here, given how well code comments are integrated in Rust. A few lines of explanation over the most comment types (
Query
,Commands
, ...) would go a long way I think.Audio
Audio is too limited to be of any use (no audio looping for example). I eventually found bevy_kira_audio but its setup is not trivial (need to undo default features, then re-add a bunch of them; this is not really detailed in any of the two projects). If there is no intent to improve the built-in Audio module, which is fine, then I suggest Kira integration (or others) should probably be more prominently pushed forward and explained.
Some questions
A few questions I asked myself, which either took a long time to get answered, or I'm still wondering about:
button.rs
examples shows hot-swapping a material handle, which did the trick in showing me a pattern. I don't know though if there's a way to truly change those items dynamically, instead of switching between multiple instances.Vec<Entity>
and despawn them on state exit resulted in many crashes with "entity doesn't exist". I believe this is a race condition between systems, which made me realize they all work in parallel on those entities.Query
component is attached to? No idea.World
that I think is implicitly created if using onlyApp::build().add_system(...)
? No idea.Thanks for reading, and thanks again to all contributors for the hard work! :)
Let me know if there's anything I can help with on the above points.
The text was updated successfully, but these errors were encountered: