Releases: mlange-42/ark
Ark v0.7.1
Ark v0.7.0
Ark v0.7.0
Ark is an archetype-based Entity Component System (ECS) for Go.
Changelog
Breaking changes
- World constructor
NewWorldreturns a pointer instead of a value (#448)
Features
- Provides binary serialization and de-serialization of entities for networking (#453)
Performance
- Optimizes removal of relation target entities from archetypes (#461)
Bugfixes
- Fixes resetting relation target tracking on entity creation (#459)
- Fixes resetting relations in archetype cleanup (#460)
- Fixes missing
OnAddRelationsevent onCopyEntity(#463)
Migration guide
For migration from pre-v0.7.0 versions, simply remove the pointer operator & in function calls that take a *World as argument. When a World is stored in an explicitly typed variable or struct field, use *ecs.World instead of ecs.World for the type.
Ark v0.6.4
Ark v0.6.4
Ark is an archetype-based Entity Component System (ECS) for Go.
Changelog
Bugfixes
- Prevents emitting custom events with components for the zero entity (#444)
Ark v0.6.3
Ark v0.6.3
Ark is an archetype-based Entity Component System (ECS) for Go.
Changelog
Other
- Merges
observerManagerDataback intoobserverManager(#438)
Ark v0.6.2
Ark v0.6.1
Ark v0.6.0
Ark v0.6.0
Ark is an archetype-based Entity Component System (ECS) for Go.
Release highlights
🎉 This is probably the biggest release since v0.1.0. 🎉
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.
Concurrency-safe queries
As a new performance-related feature, filters and queries are now concurrency-safe and can be executed in parallel. There is a new section on this in the user guide, as well as a new stand-alone example.
Performance improvements
This release also includes a load of small performance improvements. Among other, archetype switching is now ~20% faster thanks to mask inlining. Query creation, table memory allocation, and bit-mask operations have been optimized. The new World.Shrink method allows developers to reclaim memory that exceeds current usage, which is particularly useful in long-running or dynamic environments.
Documentation
Documentation has been expanded with a new chapter on the event system, stand-alone examples for both built-in and custom events, and a dedicated example showing how to integrate Ark with the Ebiten game engine. A cheat sheet for common perations has been added and the API references have been improved in several areas.
Other
Additional improvements include better error messages, JSON (de)serialization for world stats, and enhanced IDE autocomplete via refined callback signatures. And finally, Ark has reached 100% test coverage.
Changelog
Breaking changed
- Converts interface
Relationto a concrete struct type (#306) - Removes
RelationID, useRelationinstead (#306) FilterX.Batchreturns a value instead of a pointer, and all using methods change accordingly (#378)
Features
- Adds an event system for ECS operations like entity creation/removal, component addition/removal and relation target changes (#330, #331, #333, #342, #344, #352, #358, #364, #410)
- Adds custom event support for the event system (#340, #348)
- Adds method
World.Shrinkfor freeing memory that exceeds current requirements (#323, #417) - World lock and filters are concurrency-safe, allowing for concurrent query execution (#360. #405)
- Adds methods
ObserverX.New,Map.NewandResource.Newas shortcuts to avoid repeated parameter listing (#393, #394. #395) - Adds method
World.CopyEntityfor entity duplication (#415, #418, #420)
Performance
- Speeds up relation handling by making
Relationinterface a concrete type (#306) - Skips
Filter.WithoutandFilterX.Withoutwhen called with zero arguments (#309) - Resets archetype tables in bulk, avoiding table ID lookup (#313)
- Speeds up freeing tables when removing relation targets, by adding an index lookup (#314)
- Optimizes dumping and loading entities for serialization by pre-allocating memory (#315)
- Speeds up archetype switching by 20% by inlining the mask (#317, #375)
- Speeds up query creation by optimized world locking (#318, #360)
- Optimizes bit mask methods by using less math and more bit-wise operations (#319, #372)
- Speeds up memory allocation for archetype tables and bulk copying by avoiding reflection (#321)
- Reuses internal slices to avoid allocations (#362, #363, #388)
- Optimizes
World.Resetby skipping where possible (#366) - Optimizes adding/removing components by improved archetype graph indexing (#369)
- Optimizes adding/removing components by improved method inlining (#369, #376)
- Speeds up archetype graph by 30% by removing indirections in neighbors mapping (#386)
- Speeds up component addition and removal by separating logic for add/remove/replace (#387)
- Optimizes entity creation by method inlining (#416)
Documentation
- More explicit API reference docs for
Filter.ExclusiveandFilterX.Exclusive(#322) - Adds a stand-alone example for using Ark with the Ebiten game engine (#329)
- Adds a user guide chapter on the new event system (#334, #345, #346, #347, #353, #355, #413)
- Adds stand-alone examples for built-in and custom events (#354)
- Adds a user guide section and a stand-alone example for running queries concurrently (#360, #391)
- Allows inlining in user guide benchmarks for more realistic measurements (#382)
- Adds a cheat sheet for quick lookup to the user guide (#397, #399, #402)
- Adds a section on storing filters an mappers to the performance tips chapter (#411)
Bugfixes
- Zeroes memory of non-trivial component types using reflection to inform GC about invalidated pointers (#324)
- Filters are un-registered when removed from cache by
World.Reset(#366) - Fixes panic when trying to get a resource that does not exist (#374)
Other
- Adds benchmarks for
World.Stats(#310) - World stats are now JSON (de)serializable (#311)
- Improves the error message on attempt to modify a locked world (#312)
- Changes callback signatures for better IDE autocomplete (#343)
- Finally, increases test coverage to 100% \o/ (#356)
- Includes the total number of registered observers in World statistics (#365)
Ark v0.5.2
Ark v0.5.2
Ark is an archetype-based Entity Component System (ECS) for Go.
Changelog
Performance
- Simplifies calculation of item sizes by considering Go's memory alignment rules (#301)
Documentation
- Excludes code generation from the API reference by moving it to an internal package (#300)
- Clarifies the use of entity relations with filters and maps in the API reference (#305)
Bugfixes
Ark v0.5.1
Ark v0.5.0
Ark v0.5.0
Ark is an archetype-based Entity Component System (ECS) for Go.
Release highlights
Ark v0.5.0 brings a mix of performance improvements, usability upgrades, and documentation enhancements. Queries are now faster thanks to smarter indexing, and new methods make it easier to sample random entities. The documentation has been expanded with a new chapter on design philosophy and limitations. You’ll also find new stand-alone examples covering advanced topics like entity relations, world locking, spatial indexing, and parallel simulations.
Changelog
Breaking changes
- Renames build tags to
ark_tinyandark_debugto avoid conflicts (#284)
Features
- Adds methods
QueryX.EntityAtandQuery.EntityAtfor drawing random entities (#280)
Performance
- Uses component index to speed up
QueryX.CountandQueryX.EntityAt(#278) - Includes
FilterX.Withargs in component index optimization (#282)
Documentation
- Adds more examples for queries to API reference (#283)
- Adds a user guide chapter on design philosophy and limitations (#285)
- Adds stand-alone examples for world lock, kd-tree, entity relations and parallel simulations (#288)
- Removes line numbers in user guide code blocks to fix copy button functionality (#291)
Bugfixes
- Prevents relations specified when querying from getting registered in cache later (#292)
Other
- Adds debug and non-debug versions for unsafe queries (#279)