Skip to content

Neofox: heart ... the little ECS that loves you back! โ€‹

The Entity-Component System (ECS) is an architectural pattern that champions composition over inheritance. Entities are small, unique identifiers, and Components are data attached to them. The term Systems often refers to the logic that operates on this data.

Typical ECS Concepts โ€‹

(these are what makes many ECS architectures tick)

Entities exist in a World. โ€‹

Entities can be spawned solo, or in bulk with pre-configured components.

Components can be added to / removed from Entities. โ€‹

Components can be backed by any type; Value or Reference, even empty structs.

Queries filter Entities using Match Expressions. โ€‹

This matching is done by Component types and targets (presence or absence).

Code Acts on Component data in tight, optimized loops. โ€‹

You provide logic in Runner Delegates which are executed on a single or multiple threads.

Component data is always kept contiguous* in Memory. โ€‹

Structurally similar Entities are packed into Archetypes for improved cache locality.

* per Archetype

Unique fennecs Concepts โ€‹

(weird cool stuff that gets us all wide-eyed and bushy tailed)

Streams expose fast Iteration and SIMD Operations โ€‹

Quickly & safely iterate entities, or modify Components in bulk, or process entire memory blocks.

Relations are Components with an Entity Target. โ€‹

These add expressive, powerful grouping semantics. Relations can be backed by any type.

Group Entities logically and in memory by linking them to shared data, like a physics world.

Queries expose Structural Changes (just as Entities do) โ€‹

Efficiently and safely add, remove from individual Entities or entire matched Queries.

Runners let you pass uniform data to your Workloads. โ€‹

A tiny tidbit that streamlines the process of passing data into a job or run.

Worlds, Queries, and Streams implement IEnumerable<>. โ€‹

It's amazing to be able to every now and then just LINQ it up and be done somewhere.

There are no formalized Systems. โ€‹

You have a higher degree of freedom when and how to interact with Queries and Stream Views.

There is no formalized Scheduler. โ€‹

Parallel Jobs execute synchronously, as fast as possible. Runners are invokable anytime, anywhere.

Structural Changes may be submitted* at any time. โ€‹

Worlds process them at the end of a Query Runner's scope, otherwise immediately.
* never type EndInitializationEntityCommandBufferSystem nor AddJobHandleForProducer(JobHandle) again! ๐ŸฆŠ

Neofox: boop_happy Boop the fox, and you're all done with the first page! โ€‹

"using fennecs;"

fennecs is released under the MIT License. Neofox is released under the CC BY-NC-SA 4.0 License.