Skip to content

Releases: mlange-42/ark

Ark v0.7.1

20 Jan 10:31
13f826d

Choose a tag to compare

Ark v0.7.1

Ark is an archetype-based Entity Component System (ECS) for Go.

Changelog

Bugfixes

  • Fixes non-nil component retrieved from mapper (#472, fixes #470, rolls back #430)

Other

  • Closed/finished queries don't panic when closed again (#469)

Ark v0.7.0

22 Dec 13:51
306b3a2

Choose a tag to compare

Ark v0.7.0

Ark is an archetype-based Entity Component System (ECS) for Go.

Changelog

Breaking changes

  • World constructor NewWorld returns 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 OnAddRelations event on CopyEntity (#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

02 Nov 20:12
fbf486d

Choose a tag to compare

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

20 Oct 20:15
b148181

Choose a tag to compare

Ark v0.6.3

Ark is an archetype-based Entity Component System (ECS) for Go.

Changelog

Other

  • Merges observerManagerData back into observerManager (#438)

Ark v0.6.2

20 Oct 19:16
37c1155

Choose a tag to compare

Ark v0.6.2

Ark is an archetype-based Entity Component System (ECS) for Go.

Changelog

Performance

  • Stores column layouts separately, speeding up MapX.Get by ≈15% (#430)
  • Splits out hot archetype data, stores less frequently used data separately (#433)
  • Optimizes emitting events if no observers for the event type are registered (#435)

Ark v0.6.1

15 Oct 12:39
a716ac7

Choose a tag to compare

Ark v0.6.1

Ark is an archetype-based Entity Component System (ECS) for Go.

Changelog

Performance

  • Undo slice pooling in query creation (#405) to avoid weird query performance degradation (#422)
  • Reduce memory size of the central storage by allocating slice pool and observer manager on the heap (#425)
  • Pre-fetch column pointers to speed up queries by 20-30% (#426)

Ark v0.6.0

13 Oct 16:08
680d74c

Choose a tag to compare

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 Relation to a concrete struct type (#306)
  • Removes RelationID, use Relation instead (#306)
  • FilterX.Batch returns 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.Shrink for 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.New and Resource.New as shortcuts to avoid repeated parameter listing (#393, #394. #395)
  • Adds method World.CopyEntity for entity duplication (#415, #418, #420)

Performance

  • Speeds up relation handling by making Relation interface a concrete type (#306)
  • Skips Filter.Without and FilterX.Without when 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.Reset by 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.Exclusive and FilterX.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

16 Sep 12:59
89fda8f

Choose a tag to compare

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

  • Checks that queried/used relation components are actually part of filters and maps (#305, fixes #304)

Ark v0.5.1

10 Sep 15:43
a52a5db

Choose a tag to compare

Ark v0.5.1

Ark is an archetype-based Entity Component System (ECS) for Go.

Changelog

Bugfixes

  • Fixes crash on table creation when removing a relation component (#297, fixes #295)

Ark v0.5.0

10 Sep 13:58
db84b37

Choose a tag to compare

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_tiny and ark_debug to avoid conflicts (#284)

Features

  • Adds methods QueryX.EntityAt and Query.EntityAt for drawing random entities (#280)

Performance

  • Uses component index to speed up QueryX.Count and QueryX.EntityAt (#278)
  • Includes FilterX.With args 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)