Two weeks and roughly 100 PRs after the last release, we are pleased to announce Ark.jl v0.2.0!
This release comes with several new features, extended documentation and some performance improvements, but also with a few breaking changes.
Why ECS?
Skip this of you know it already!
Entity Component Systems (ECS) offer a clean, scalable way to build individual- and agent-based models by separating agent data from behavioral logic. Agents are simply collections of components, while systems define how those components interact, making simulations modular, extensible, and efficient even with millions of heterogeneous individuals.
Ark.jl brings this architecture to Julia with a lightweight, performance-focused implementation that empowers scientific modellers to design complex and performant simulations without the need for deep software engineering expertise.
Release highlights
Event system
The highlight of this release is Ark’s new comprehensive event system built around lightweight, composable observers. Observers allow applications to react to ECS lifecycle changes, such as entity creation, component addition or removal, and relation updates. Observers can defines filters to match relevant events as well as entities. They follow the same declarative patterns as Ark’s query system.
Beyond built-in lifecycle events like OnCreateEntity and OnAddComponents, the system supports custom event types. Custom events can be emitted manually and observed using the same filtering and callback mechanisms, making them ideal for modeling domain-specific interactions such as input handling, and other reactive game logic.
Configurable component storages
The backing storages for components can now be configured on a per-component basis. Available storages are ordinary Vectors as well as a StructArray-like data structure. StructArray-like storages have the advantage that they allow for boradcast operations on component fields instead of iteration over entities.
For a consistent and convenient API, StructArray-like field access is also possible for Vector storages, thanks to the new FieldViews.jl package.
Other features
Further new features available in v0.2.0:
reset!the World for more efficient repetitions of simulations.initial_capacityin the World constructor to avoid repeated allocations.copy_entity!for easier construction of similar entities.lengthandcount_entitiesfor queries and batches.
API improvements
The macro versions of some functions that allowed for more convenient componen type tuples were removed. Functions now support the convenient syntax directly.
Documentation
Of course, all new features were thorougly documented. But on top of that, we now also provide a number of demos that demonstrate Ark’s features and serve as stand-alone, runnable examples.
More
For a full list of all changes, see the CHANGELOG.
We highly appreciate your feedback and contributions!