Hacker News new | ask | show | jobs
by alice-i-cecile 826 days ago
Thanks (I am the aforementioned project manager) :) Docs are a high priority for me, especially beginner content, assets, and rendering for me. Rust's in-repo examples are really helpful for ensuring they stay up to date, but aren't a replacement for a guided tour.

As for the ECS, I've absolutely felt that: the flexibility of the polymorphism created by "just add another component!" can be both chaotic and freeing. Can you say more about what you're looking for with entity cleanup? I haven't heard that complaint before and want to make sure I understand what you mean.

2 comments

Most games have different states. For example, you have the main menu screen and perhaps different levels. Each of these could be a state. I think Bevy already has an abstraction for this[0] but it only records the current state. There is no other information associated with it IIUC.

What I think would be useful is essentially an arena allocator associated with a state. So any components and entities created when a state is active would be removed when that state is exited. Otherwise it seems that one must do manual GC, which is error-prone and will almost certainly lead to slow leaks over time.

[0]: https://docs.rs/bevy/latest/bevy/ecs/prelude/struct.State.ht...

Ah okay! I can see the need for this. This is a large part of why the States machinery exists, but I see your point about it being error-prone to remember to tag and then despawn everything.

I'll chew on solutions here: we might be able to get away with a nice well-documented convention in user-space code, or we may need to add a small extension to the internals to make this more robust.

Isn't the typical way to do this by using a janitor? This would typically need to be done in user space (the framework doesn't know what cleanup you want to do), but Bevy could provide an interface for it with callbacks or whatever is more idiomatic in Rust/Bevy.
Last time I was using Bevy I had a cleanup system to solve exactly that issue. It queried for entities with the AssociatedWithState component, or whatever I called it, and destroyed any where the was a mismatch.

I could see an efficient version of that being a nice thing to have built in, though. It’s definitely a very common thing.

The release notes are great btw. Usually if I’m doing something for the first time I look it up in the bevy cheat book, get something that doesn’t work (because it’s two or three versions out of date), then check the intervening release notes. Usually there’s enough direction to figure it out.
They're so, so much work. Carefully going over the log, and patiently explaining / showcasing and contextualizing them is even more work than writing docs for the same feature, since you don't have the API to help structure things.

I'm glad it pays off! Seeing them come together makes my day every time, even when I'm writing half of it.

Oh, I know! I’m a maintainer of another open source project and the release notes are such a chore. For the quality of Bevy’s I could easily see it being a full time job, albeit a mostly thankless one. So thank you for the effort you’ve put in!
And I know so many people who think you could automate them from commit messages. Hell, no!