RustyDO
RustyDO copied to clipboard
Implement an efficient ECS
Currently, our ECS is poorly implemented: no parallelism, no systems (handlers), and no cache efficiency. That is because what I wanted was just to imitate a data-oriented structure on a large scale (e.g. an entity with multiple components being added or removed).
Instead of inventing the wheel, we can make use of the existing ECS libraries in rust:
- legion: https://github.com/amethyst/legion
- specs: https://github.com/amethyst/specs
- bevy: https://bevyengine.org/.
Especially, bevy is actively in development, and a popular rust-written Minecraft server uses it (https://github.com/valence-rs/valence). It would be a decent choice to apply bevy to our project.
I have recently found a new ecs library, evenio
(https://github.com/rj00a/evenio). This library seems to be introduced by one of the maintainers of valence-rs
.
One of the key ideas in evenio
is that it is based on an event mechanism that provides event-handling even for each entity, whereas bevy
does not. And the other benefits of using bevy
, such as parallelism with rayon
and efficient querying system, are still supported in the library. The library is relatively immature compared to bevy
but I like the ideas of it.
Our ECS engine is currently built on evenio
, and we may refer to the rewriting process of valence-rs
: https://github.com/valence-rs/valence/issues/596