Skip to content

Commit ab889a0

Browse files
committed
Adds paragraph about Edict 0.2
1 parent 8cd2ec3 commit ab889a0

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

content/news/037/index.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,82 @@ users to define their own dynamic assets.
185185
[bevy_asset_loader]: https://github.com/NiklasEi/bevy_asset_loader/
186186
[Bevy]: https://bevyengine.org/
187187

188+
### [Edict]
189+
190+
[Edict] by [@zakarumych] is powerful Rust ECS crate
191+
that expands traditional ECS feature set.
192+
193+
New version 0.2 is getting [ready for release].
194+
195+
This ECS is based on archetypes (aka SOA storage) to allow fast cache-friendly
196+
iteration. And there are quite a few novel features:
197+
198+
[Edict] allows users to express relations between entities using [`Relation`]
199+
trait. Conceptually they are components that gets attached to a pair of
200+
entities - origin and target. Relation is automatically removed when one of the entity
201+
is despawned. Additionally relation may be "owned", automatically triggering
202+
despawn for "owned" entities when last owner is despawned. Relation may be
203+
declared as "exclusive" so that it is replaces old relation on origin entity.
204+
Provided out of the box relation [`ChildOf`] is exactly this - "exclusive" and
205+
"owned" - and can be used to define entity hierarchies.
206+
207+
User may define hooks for components and relations to trigger arbitrary actions
208+
when component is dropped or replaced, or if relation target is dropped.
209+
Hooks can be defined in [`Component`] trait implementation.
210+
Also [`WorldBuilder`] allows to dynamically override hooks for the component
211+
type.
212+
213+
Unlike most ECS with [`Component`] trait [Edict] allows using component types
214+
that do not implement [`Component`]. Component inserting methods
215+
(spawn, insert etc) can be used only with components that implement
216+
[`Component`].
217+
Each such method has [`*_external`] counterpart that allows for [`!Component`]
218+
types but require explicit registration.
219+
220+
Built-in change tracking with fast and flexible queries for modified components
221+
can be used to implement complex use cases. For example incremental saves can
222+
fetch all components modified since previous save. For netcode components
223+
modified since last ACK can be fetched as efficiently.
224+
225+
Another novel feature is type-agnostic component borrowing.
226+
Component type may define list of types that can be borrowed from it. Important
227+
use case is borrowing [`dyn Traits`].
228+
Editor implementation may borrow some `dyn EditorComponent` and use it to show
229+
widget for recognized components. Borrowing can be used with runtime-known
230+
[`TypeId`] as well as without one.
231+
232+
[Edict] supports parallel execution.
233+
There's [`System`] trait that works with built-in [`Scheduler`].
234+
Functions with certain argument types can be transformed into [`System`]s
235+
similarly to [`bevy_ecs`].
236+
The [`Scheduler`] is very easy to configure and use. Any conflicting pair of
237+
system define implicit dependency from system that was added earlier to a system
238+
that was added later. This way multi-threaded execution runs the same way as
239+
single-threaded would.
240+
[`Scheduler`] uses external executor using [`ScopedExecutor`] trait. Implemented
241+
for [`std::thread::Scope`] and [`rayon::Scope`] under "rayon" feature.
242+
[`Scheduler::run`] returns an iterator or [`ActionEncoder`]s that should be
243+
executed with mutable access to [`World`].
244+
245+
[Edict]: https://github.com/zakarumych/edict
246+
[@zakarumych]: https://github.com/zakarumych
247+
[ready for release]: https://docs.rs/edict/0.2.0-rc.3/edict/
248+
[`Relation`]: https://docs.rs/edict/0.2.0-rc.3/edict/relation/trait.Relation.html
249+
[`ChildOf`]: https://docs.rs/edict/0.2.0-rc.3/edict/relation/struct.ChildOf.html
250+
[`Component`]: https://docs.rs/edict/0.2.0-rc.3/edict/component/trait.Component.html
251+
[`*_external`]: https://docs.rs/edict/0.2.0-rc.3/edict/world/struct.World.html#method.spawn_external
252+
[`dyn Traits`]: https://doc.rust-lang.org/book/ch17-02-trait-objects.html
253+
[`TypeId`]: https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html
254+
[`System`]: https://docs.rs/edict/0.2.0-rc.3/edict/system/trait.System.html
255+
[`Scheduler`]: https://docs.rs/edict/0.2.0-rc.3/edict/scheduler/struct.Scheduler.html
256+
[`bevy_ecs`]: https://crates.io/crates/bevy_ecs
257+
[`ScopedExecutor`]: https://docs.rs/edict/0.2.0-rc.3/edict/executor/trait.ScopedExecutor.html
258+
[`std::thread::Scope`]: https://doc.rust-lang.org/stable/std/thread/struct.Scope.html
259+
[`rayon::Scope`]: https://docs.rs/rayon/1.5.3/rayon/struct.Scope.html
260+
[`Scheduler::run`]: https://docs.rs/edict/0.2.0-rc.3/edict/scheduler/struct.Scheduler.html#method.run
261+
[`ActionEncoder`]: https://docs.rs/edict/0.2.0-rc.3/edict/action/struct.ActionEncoder.html
262+
[`World`]: https://docs.rs/edict/0.2.0-rc.3/edict/world/struct.World.html
263+
188264
## Popular Workgroup Issues in Github
189265

190266
<!-- Up to 10 links to interesting issues -->

0 commit comments

Comments
 (0)