Skip to content

Releases: iiYese/aery

0.7

05 Jul 00:08
Compare
Choose a tag to compare
  • Updated to bevy 0.14
  • Aery can now be reflect thanks to hooks allowing for serialization & use in scenes.
  • Removed TargetEvent & CleanupEvent: Superseded by hooks & observers. Added SetEvent & UnsetEvent triggers.
  • Remove checked_despawn cleanup now uses hooks & regular despawn meaning:
    • You don't have to remember to call a different function.
    • Better compatibility with hierarchy (despawn_recursive also triggers arey cleanup).
    • You don't have to worry about reminding users to call a different function if you're crate author looking to use arey as a dependency.

0.6.0

18 Feb 16:00
Compare
Choose a tag to compare

Support bevy 0.13

0.5.2

17 Dec 21:19
Compare
Choose a tag to compare
  • Fix missing RelationCommands impl for EntityCommands
  • Fix missing trait impls for RelationId conversion.
  • Add set & scope examples to API tour.
  • Add basic examples.
  • Add change detection filter for edges.
  • Tidy up scope docs.

0.5.1

09 Nov 13:04
Compare
Choose a tag to compare
  • Use only required deps to better support projects that only use a subset of bevy crates.

0.5

08 Nov 17:09
a088820
Compare
Choose a tag to compare
0.5
  • Update to bevy 0.12.
  • Add missing docs for Scope.
  • Scope now works with Commands and does not require a &mut World.
  • Added partial bevy_hierarchy compatibility. All of the query APIs can be used to perform operations with bevy_hierarchy edges.
fn sys(
    query: Query<(&C, Relations<Hierarchy>)>,
    roots: Query<Entity, (With<Children>, Without<Parent>)>
) {
    query.traverse::<Hierarchy>(roots.iter()).for_each(|c, _| {
        // ..
    })
}

0.4

09 Oct 17:02
82d79fb
Compare
Choose a tag to compare
0.4
  • New filters for relations: Abstains, Branch, Leaf.
  • Internals completely reworked for better performance & memory footprint (SmallVecs like bevy_hierarchy now).
  • New Track API to track the last seen item from a query when traversing an edge.
    fn sys(
        mut foos: Query<&mut Foo>,
        tree: Query<(Option<&Bar>, Relations<R>)>,
        roots: Query<Entity, Root<R>>
    ) {
        tree.traverse::<R>(roots.iter()).track(&mut foos).for_each(|foo, bar, _| {
            // ..
        });
    }
  • Derive macro can handle generic types now.
  • Fold breadth API for multi pass algorithms.
    fn sys(
        tree: Query<(Foo, Relations<R>)>,
        roots: Query<Entity, Root<R>>
    ) {
        tree.traverse::<R>(roots.iter())
            .track_self()
            .fold_breadth(|foo, _| /*init*/, |accum, foo, _| /*fold*/)
            .for_each(|accum, parent_foo,  _, child_foo, _| {
                // ..
            });
    }

Breaking:

  • Yeet cursed option hack for relation commands + scope APIs.
  • Completely reworked Scope API to be more declarative. Not all previous functionality will be possible.
    world.spawn(bundle).scope::<ChildOf>(|scope| {
        // x, y, z are implicitly `ChildOf` the last spawned entity 
        scope.add(x)
             .add(y)
             .add(z)
             .scope::<ChildOf>(|scope| {
                  // a, b are implicitly `ChildOf` the last spawned entity (z) 
                 scope.add(a)
                      .add(b);
             });
    });
  • Improved macro hygiene. All property overrides are done through the aery attribute.
    • Available attributes: Counted, Recursive, Total, Poly (previously multi), Symmetric.
    #[derive(Relation)]
    #[aery(Recursive)]
    struct R;
  • Edge direction changes for all operations is now done through the Up modifier. All opereations use hosts by default. To use targets use Up.
    fn sys(foos: Query<(&Foo, Relation<R>)>, starts: Query<Entity, Root<R>>) {
        // descent
        foos.traverse::<R>(starts.iter()).for_each(|foo, _| {
            // ..
        });
        
        // ascent
        foos.traverse::<Up<R>>(starts.iter()).for_each(|foo, _| {
            // ..
        });
    }
  • Traversal are reworked to make sense with new operations. By default traversal visits each node & to get the old 2 arity ancestor descendant permutations use .track_self().
  • Rework how Joins work for consistent defaults + better composability:
    • Join on hosts not targets by default which is more common and makes for a consistent edge default direction. Use Up for targets.
    • Separate Joins from Traversals. Joins must be done through the Relations<R> world query Item. This adds some rightward drift but significantly reduces API complexity & allows joins to work on tracked query items.
    • Split ControlFlow into JCF and TCF.

0.3.1

15 Jul 17:03
d0d2250
Compare
Choose a tag to compare

Doc fix

0.3

14 Jul 20:06
c0266f2
Compare
Choose a tag to compare
0.3

Bevy version

  • Bump to bevy 0.11

New in 0.3

This is decently sized release with quite a few new things.

  • New ControlFlow variant: Probe.
  • ZSTs for relations are now enforced at compile time.
    ---- src/lib.rs - (line 20) stdout ----
    error[E0080]: evaluation of `<Likes as aery::relation::ZstOrPanic>::ZST_OR_PANIC` failed
       --> /home/yogii/Repos/aery/src/relation.rs:142:13
        |
    142 |             panic!("Not a ZST")
        |             ^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Not a ZST', /home/yogii/Repos/aery/src/relation.rs:142:13
        |
        = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
    
    note: erroneous constant used
      --> src/lib.rs:47:10
       |
    29 | #[derive(Relation)]
       |          ^^^^^^^^
       |
  • New Scope API to spawn and manipulate hierarchies.
    wrld.spawn(A)
        .scope::<R>(|_, mut ent| {
            ent.insert(B);
            ent.scope::<R>(|_, mut ent| {
                ent.insert(C);
            });
        });
  • Symmetric Relations.
    #[derive(Relation)]
    #[symmetric]
    struct R;
  • Relation events for target changes and entity cleanup.
    fn sys(mut events: EventReader<TargetEvent>) {
        for e in events.iter() {
            // Did some entity set an `R` to some other entity?
            if e.matches(Wc, TargetOp::Set, R, Wc) {
                // ..
            }
        }
    }
  • Hierarchy ascent is now supported along side the existing descent.
    fn sys(query: Query<(A, Relations<R>)>, roots: Query<Entity, Root<R>>) {
        query.ops().traverse_targets::<R>().for_each(|a, a_ancestor| {
            // ..
        })
    }

Breaking

  • Module restructures if you're not using prelude.
  • .breadth_first::<R>(roots) -> .traverse::<R>(roots)
  • Recursive cleanup no longer triggers when unsetting. This never made sense.
  • RelationCommands reworked and no longer implemented for Commands and World. New implementation is for EntityMut<'_> with a new API.

Misc

  • Many doc improvements & with illustrations in documentation with aquamarine.
    image

0.2

14 Jun 18:49
0c2ee91
Compare
Choose a tag to compare
0.2

New in 0.2

  • Logging for Set command.
  • Derive macros for Relation.
// Change cleanup behavior
#[derive(Relation)]
#[cleanup(policy = "Recursive")]
struct R;
// Change arity
#[derive(Relation)]
#[multi]
struct R;
  • Ancestors now provided when traversing a hierarchy.
fn sys(a: Query<(&A, Relations<R>)>, roots: Query<Entity, Root<R>>) {
    q.ops().breadth_first::<R>(roots.iter()).for_each(|a_ancestor, a| {
        // ..
    })
}
  • UnsetAll command to remove all relation targets of a given type from an entity.
  • Withdraw command for entities to remove themselves as targets from relations of a given type.
  • More granular ControlFlow options
    • ControlFlow::FastForward(n): Advance the nth join to the next valid permutation skipping any permutations in between.
    • ControlFlow::Walk: Walk to the next entity in a traversal, skipping any remaining permutations to iterate for the current entity.

Breaking changes

  • For each arity changes.
  • Various type and module name changes.

Other

  • License is now dual MIT + Apache 2.0.
  • Various doc improvements.