Skip to content

v0.6.0 - Mattison's Independence

Choose a tag to compare

@krispya krispya released this 14 Dec 21:48
· 100 commits to main since this release

With this update the relations code has been entirely rewritten to be more efficient in every way, but especially with adds and removes.

A relation is made up of a pair of two entities, with the first being a subject and the second being the target. For example, entity A is a target of entity B is expressed as entityA.add(TargetOf(entityB). With the previous code, every pair would generate a new trait which made the internals simpler but much less performant. Basically, as the number of traits increased, the longer hot paths would take. Short lived relations would destroy performance after a few thousand ticks.

The new strategy only creates one trait per relation and the pairs are instead data stored on the trait. For the purposes of Koota, this is much more efficient. Both strategies are actually viable, and I may revisit the old one at some point in the future, but for now this has allowed us to greatly improve performance while keep internals extensible.

There are some breaking changes:

  • Reverse wildcard searches have been removed. It created a lot of overhead and was rarely, if ever, used. If you need to do a reverse search I suggest adding a relation in both directions. For example, ChildOf(parent) and ParentOf(child).
  • Modifiers like Changed, Removed and Added only work with the base relation ChildOf now and will not work with particular relation pairs like ChildOf(parent). This can be worked around in the future.

Stay tuned, more coming soon!

Features

feat: Optimize relations by @krispya in #178
feat: Boids relation bench by @krispya in #139
feat: Add a sim for testing relation traversal by @krispya in #179

Fixes

bug(react): useHas and useTag now return only booleans by @krispya in #184
fix: Function inlining is enabled again by @krispya in #185
fix: Relations work with modifiers by @krispya in #192
fix: Fix typo in cleanup function return statement by @pomle in #182

Chores

chore: Make the build logging more concise by @krispya in #186
chore: Use explicit type imports by @krispya in #187

Docs

chore: Remove world arg from destroyAllShips function in readme by @pomle in #181

New Contributors

Full Changelog: v0.5.3...v0.6.0