ajmmertens
Building an ECS #3: Storage in Pictures
That's not how ECS works. A system has one or more queries that provide it direct access to the data. There's no passing around of queries or data.
With any kind of database - even in-memory SQLite - there is a query interface between you and the data. In ECS you access data directly, which is at least an order of magnitude faster.
Here's a bit of code from that project that generates a monster: https://github.com/tmewett/BrogueCE/blob/master/src/brogue/M...
It just allocates an object per monster, followed by initializing a long list of members that presumably just gets longer as more game systems get added.
The same code in ECS would look a lot simpler, and probably perform better/have better cache locality.
- it has tools like https://github.com/flecs-hub/explorer that work with any Flecs project
- it has builtin support for hierarchies/prefabs and more (https://ajmmertens.medium.com/building-games-in-ecs-with-ent...)
- it has optional support for systems/scheduling
- it has an optional reflection framework
- it has an optional DSL for describing assets/scenes, with an online playground to try it out: https://www.flecs.dev/explorer/?local=true&wasm=https://www....
- and a lot more: https://www.flecs.dev/flecs/md_docs_Quickstart.html#autotoc_...
For example:
- create custom components for different instruments
- create systems for specific instruments that match the necessary components
- write the result to a common component (e.g. "ChannelOutput")
You could then add components for EQ, effects, routing, ... and introduce systems that match those. The advantage of this approach would be that you end up with a bunch of loosely coupled systems (for instruments, effects, mixing, ...) and an in-memory representation that's cache & parallelization friendly.
One other datapoint would be that Unreal's animation sequencer uses an ECS design, which has a lot of things in common with a DAW.
Glossing over lots of details here, you can't of course design a DAW in one paragraph.
I actually know of quite a few projects that use ECS as the foundation for a low level rendering library precisely because it lets you iterate over a bunch of plain arrays, but with more flexibility.
The overhead of an ECS depends on many things, but if you have lots of entities with similar components, the overhead per entity can be quite small.
Existing game engines like Unity/Unreal already have builtin solutions for entity management, but if you're (for whatever reason) using something that's more custom you can avoid having to reinvent entity management by using an ECS library. Similar to how you'd use libraries like SDL/bgfx/sokol for graphics.
Things like entity relationships (https://ajmmertens.medium.com/building-games-in-ecs-with-ent...) introduced features that were already common in existing entity management systems, such as entity hierarchies.
An ECS can also come with a bunch of tools for inspecting entities, monitoring performance or changing components in realtime (https://www.flecs.dev/explorer/). Definitely not something you need to complete a game, but very handy.
Flecs 2.1 is out! A faster, easier to use ECS for C and C++
Easy C/C++ reflection library without RTTI
Why Storing State Machines in ECS is a bad idea
Show HN: Flecs 2.0, an Entity Component System for C and C++ is released
Why vanilla ECS is not enough
Show HN: What happens if you combine ECS with inheritance
Show HN: I just created a new language called Y
A FAQ for People New to ECS (Entity Component System)
A closer look at bake, a tool that makes building C/C++ code effortless
As you put so eloquently before, that should not be the prerogative of build systems like bake, but of package managers like apt-get, brew and vcpkg. Bake is blissfully agnostic to those problems (thank god).
One thing that hasn't been discussed so far and I would like to highlight is code that is not distributed through package managers, as so often is the case for commercial closed source code. Bake is a great fit for these use cases, as these projects can simply zip up the bake environment (together with miscellaneous files like HTML, JS and what have you), unzip it on a different machine, and everything just "magically" works.
> Then just use a developper package manager like Nix, Guix, Spack or EasyBuild that do the staff. Instead of converting every other project to Bake for the sake of it.
If you got the impression that I am on a quest to convert every non-bake project to bake, then let me put that concern to rest. I love using bake, it is saving me lots of time and, TBH, I think there are some neat ideas in bake that other people might like, but that's it. After the code is built, it's like every other C/C++ library, and people are free to use whatever build system they feel comfortable with to link with those libraries.
So what is the chance of this happening? Lets look at the list you provided:
- some aren't (C/C++) buildsystems (hackage::bake, bitbake, cake bake).
- some projects are dead (linuxrocks123/bake, openhub.net/bake-build, nsnam.org/bake)
- some projects are almost dead (esrlabs/bake)
That leaves one active project, which is Bakefile, which is not a build system but a makefile generator akin to premake. Bakefile (not bake) has a very different front-end (a bkl file) and different intent, so the potential for confusion is not big. IMO the internet is big enough for two different projects with a similar name :-)
Worst case the similarity in names makes it harder for me to get traction, but that's ok really. For me bake is a means to an end, and by no means the most important thing I'm working on. Would I enjoy it if people adopt it? Sure. But it's not the end of the world if that doesn't happen.