Skip to content

N30: Edict #922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions content/news/030/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,44 @@ for expressively abstracting over user input.
Supports local multiplayer, enables input rebinding, integrates with `bevy_ui`,
and handles chords!

### [Edict]

New archetypes based ECS implementation by [@zakarumych](https://github.com/zakarumych).

The novel feature of [Edict] is entity ownership implemented via reference counting.
This optional feature allows creating owned kind of `Entity` "reference",
that ensures entity is alive and despawns it on drop.
Storing owning `Entity` in the component of another entity
creates ownership relation between those entities.
Even though `Entity` is an owning reference,
components of the entity are can be queried from `World` as usual.
Shared ownership is also available.

Optimized for both high density `World`s with thousands of entities
and also for `World`s with lower number of entities spread among many archetypes.
[Edict] is aimed for wide range of game genres and use cases outside of games.

Built-in change detection with epochs allows systems to query for components
that were updated since last run of that query,
or since any other epoch as defined by `Tracks` argument.
This opens possibility to have multiple POV on changes even in single system.
For example server-side netcode can track changes individually
for each client and query for changes since last ACK.
[Edict] optimizes iteration significantly when entities
with modified components are queried.

Although ECS abbreviation implies, [Edict] does not come
with predefined `System` trait and systems scheduler.
We can call it ECQ (Entity-Component-Query) as an alternative to ECS.

[Edict] is added to [ecs_bench_suite](https://github.com/rust-gamedev/ecs_bench_suite)
so anyone can compare performance in some trivial examples with other ECS.

Development focus for February is making more public API, including unsafe parts,
to allow writing custom queries, implement schedulers with parallel execution etc.

[Edict]: https://github.com/zakarumych/edict

### [rafx]

[![Rafx Screenshot](rafx-screenshot.jpg)][rafx-youtube-video]
Expand Down