redbadger / crux

Cross-platform app development in Rust
https://redbadger.github.io/crux/
Apache License 2.0
1.7k stars 58 forks source link

Bevy and Crux similarities #167

Open pjankiewicz opened 9 months ago

pjankiewicz commented 9 months ago

Hi again! I see a lot of similarities between Bevy and Crux if I squint my eyes really hard.

One example are capabilities both Bevy and Crux are meant to be running in different environments. For example the Multi-platform Key Value store implementation is written by someone in the bevy community - https://github.com/johanhelsing/bevy_pkv. It depends on bevy ecs so it is not a perfect dependency for Crux but it almost can be.

Perhaps Crux can also draw inspiration from the way Bevy defines plugins. Plugins in Bevy are almost standalone apps with their own systems and data. I feel that capabilities are very similar to plugins and a capability that is defined and used in the Core can also have a bundled implementation in the Shell. So Rust can provide not only compiled Core library but also compiled capabilities implementations that live outside the Core in the Shell.

charypar commented 9 months ago

Hi! There's quite a few projects following this kind of pattern, loosely based around the idea of ports and adapters. Bevy, like most game engines, adds the open composition of the ECS architecture, useful for games with many independent entities and systems evolving over time. There are no new ideas 😄

You're absolutely right that capabilities could bundle implementations for the shell, we have that on our roadmap (not explicitly, but it's a whole lane in https://github.com/orgs/redbadger/projects/11/views/1), but there are quite a few things to work out, especially the distribution mechanism, and how to make implementations available, but not necessarily force them. Needs quite a bit of thinking.