Hello everyone, I'm getting into bevy recently, planning on seriously adopting it as my main engine of choice, and also plan on maybe contributing for it in the future. But in the process of learning it's I'm getting kinda lost, I'm one of those people who needs to understand deeply how something works in order to properly use it, so I spent this week searching for ECS/Data-Oriented resources, and also some Bevy ones, but I came to the conclusion that I'll grasp it better if I just read the code and API docs. Right now I fell like I'm running in circles, currently reading the bevy_ecs code, so I would appreciate if someone pointed me to a direction, where could I find good resources on ECS design, and also what's a beginning path for grasping the bevy implementation of it. Sorry for my poor English, and thanks to everyone replying this or not, you're awesome!!
#Orientation on Learning Bevy
64 messages ยท Page 1 of 1 (latest)
https://taintedcoders.com/, start here or https://bevy-cheatbook.github.io/ then try reading migrations guides.
cheatbook is a bit out of date now so some examples won't hold up, and both don't really talk much about obseververs and hooks
Reading the bevy_ecs code is likely a misplay ๐
It's very complex, and not very relevant to actually using the engine
The core idioms are very simple: components, resources, commands, events
Something like bevy_input or bevy_input_focus is better for figuring out what the "normal" parts are ๐
https://promethia-27.github.io/dependency_injection_like_bevy_from_scratch/introductions.html is informative to understand the tricks in the heart of the ECS though
I appreciate both your responses, but I think I did not express myself well. I'm thinking about contributing to the engine and using it, I think, from my experience, that I would be useful on the ECS and maybe networking code, therefore I'm taking a look at the engine's code. I've been searching for resources on the topic of ECS patterns, DSs and algorithms, and read all I could find (mainly THE book of DOD, the ECS Back and Forth series, bevy unofficial book, and the Sander Mertens series on medium, bit I think it's yet not enough, I'm at this moment trying to follow the PRs and Discussions of bevy while reading the code, trying to find other ECS approaches that where discarded and how the engine develops. I think that's the best path for me. But once again, thanks a lot for the replies
Aha, that's a very different goal than I had in mind ๐
Speaking for myself (SME-ECS and maintainer), I'm very user-oriented in my approach to developing the ECS
Users have problems, we try and solve them, adding the least complexity possible ๐
A lot of my work comes down to explaining and unifying and simplifying concepts
@warped adder and @crystal flume are more theoretically oriented, and love stealing things from e.g. Prolog and relational DBs though
So they may have suggestions for reading
I'm always happy to talk theory / discussion history though: just ping me!
I protest! I'm also a user of my own ECS, and I've never built a feature that wasn't actually used by me :p
True~! You're just a somewhat atypical user ๐
I think you'd feel differently after seeing some of the questions on the flecs discord ๐ the advanced query features are used by lots of users
Also, hytale has released a blog post where they talk about how those features made it easier for them to build combat systems, amongst others
Really nice ๐
I do think the advanced query features are useful
It's just a matter of learning curves
And trying to discourage the enthusiastic juniors from galaxy braining themselves
Hm, that's overplaying how complex they really are
Like, all of the prolog-like features are summarized in this query:
// find all spaceships that are docked to a planet
SpaceShip, (DockedTo, $object), Planet($object)
Is also a bit of a strange thing to say, considering how many features bevy has copied/is looking to copy from flecs ๐ค
Sorry, I don't mean to be rude. I really admire flecs, and genuinely think that its features are good and useful
The point was more that my approach to designing and iterating on the ECS is to focus on user pain, not the sort of written resources that OP is looking for
This is still very new and exploratory: there's no "just do X"
flecs (and to a lesser extent Bevy) is really on the bleeding edge of this paradigm
Sure, but there's no need to put yourself on a pedestal for that, and suggesting that other library maintainers aren't doing that
If anything that's the #1 thing I'm focused on
nod
Just a bit weary of people putting a spin on things where IMO it's really not warranted
Yeah, valid
I've... been frustrated of late at folks coming into the ECS space with beautiful theoretical designs or "just copy flecs"
With no consideration of how it fits together or how users will benefit or if it's actually the best design
You have very much not been part of that problem
That's fair. From my POV it sometimes feels like things are being copied/adapted without attribution, like, the things bevy has copied:
- archetype graph
- observers
- hooks
- component index
- deferred world
the things that bevy is looking to copy/adapt:
- ecs reactivity
- command batching
- relationships
- components as entities
- systems as entities
- archetype level change detection
Not saying that each time these things are being discussed flecs has to be mentioned (that'd be silly), but recently I've seen people pushing back on mentioning flecs, even though the thing that is being discussed is very clearly based on a flecs design
I don't think there's a need for that. Flecs is really not a competitor for bevy ๐ and vice versa. The rust barrier is a large one to cross
Yeah, I don't think there's serious competition there ๐ Bevy and flecs have very different niches, and each will really struggle to attract users from each other
Very fair. The pattern that I particularly hate is "flecs has already solved this!" or "I can't be bothered to explain this; read the flecs docs lol". We should be looking at your implementations, providing credit and reading your docs though ๐
I think that for future work command batching, reactivity, and archetype level change detection are some combination of obvious and independently re-invented ๐ค I actually had no idea you had the last one
And the reactivity and relations stuff seems liable to diverge a fair bit
I think it's more obvious in hindsight. Nobody was talking about command batching until I implemented it. People were initially very skeptical about how much of a benefit it would actually provide
The same is true to a much larger degree for relationships. It took years for the bevy community to come around to the idea that relationships could be a feature that's natively supported by the ECS
Interesting ๐ค The .insert(Foo).insert(Bar) batching at least seems really valuable
Yeah, agreed here
A lot of the early wisdom kind of centered around the "ECS is for tabular data" perspective
Wasn't until after I showed that you can actually build large scenes with fragmenting relationships that people started coming around
relations are a massive game changer
Yeah, the perf characteristics in particular are very surprising
For reactivity, that's obviously not something that I invented. But you're looking to build it on top of observers/hooks (just like flecs), and those do come from flecs
dreamertalin's initial approach was much more inspired by JS frameworks
wasn't until a bunch discussions that things switched to a more native ECS approach
Neither here nor there I guess, just venting. Wish things were a bit more like they used to be
I've always had faith in the native ECS approach, don't worry ๐
Wow guys this was wild haha. I find this so strange, ECS and DOD aren't the most obscure things that only 2 human beings know about, therefore why so scarse resources on these topics haha. But your discussion and my readings gave me some directions, Relational Databases and reading docs / code from a lot of ECSs (mainly bevy, flecs, entt). Maybe some other day I would make my obsidian notes public on GitHub pages, idk.
@old zinc I'm new to discord, what is a ping ? ๐ค
What kind of resources are you looking for specifically? The DoD book is exhaustive, and between the blog posts of flecs/EnTT, framework documentation, DOTS videos and source code you should have a lot of material ๐
The "@" mention that you just did ๐
Yes, Fim not saying there aren't good ones, I'm saying they are kinda hard to find, until you train Google's search algorithm haha
Ow yes, thanks.
Ah, you said scarce but you meant hard to find. Gotcha ๐