Skip to content

EnTT v3.0.0

Compare
Choose a tag to compare
@skypjack skypjack released this 16 May 14:19
· 5561 commits to master since this release

A major release that represents an important improvement for EnTT, both in terms of performance and functionalities.

To begin with, this is the first official release that requires and fully supports C++17.
This is the root cause of some of the API changes that made it no longer backward compatible. However, the API itself has been greatly improved in some of its parts (such as the connect function of the delegate class).
Moreover, the library has been converted to snake case, leaving behind the misleading coding style of the previous version.

Below there is a perhaps incomplete list of features and more or less important updates:

  • Added support for named types as an alternative to the family class.
    • As a consequence, EnTT can now work across boundaries (welcome DLLs).
  • Introduced a full featured runtime reflection system.
  • Introduced a few new utilities: as_view, as_group, label.
  • Removed persistent view, it's no longer available (see groups for further details).
  • Removed raw view, it's no longer available (single component view serves the same purpose now).
  • Support for context variables (sort of registry-wise singletons).
  • Removed support for single instance components.
  • Empty type optimization to reduce memory usage.
  • Improved the registry class in all its parts:
    • Added registry::try_get.
    • Added registry::get_or_assign.
    • Added registry::create overload to generate multiple entities at once.
    • Support for component lists to initialize entities when invoking registry::create.
    • Renamed registry::accommodate to registry::assign_or_replace for consistency.
    • Support for const and non-const types of components (eg registry.view<T>() vs registry.view<const T>()).
    • Support for const overload of registry::view.
    • Support for groups (see below).
    • Added registry::clone functionality.
    • Bulk operations are now available.
  • Extended the delegate class and therefore sigh and dispatcher as a consequence:
    • Support for invocable types that doesn't strictly respect the signature of the delegate.
    • Support for curried functions (available for free functions, they can now accept a payload).
  • Extended the view class:
    • Added view::find to search for specific entities.
    • view::each support lambdas that either accept or not the entity as a first argument (performance improvement).
  • Improved and extended hashed_string:
    • Added hashed_string::to_value static member function.
    • Added possibility to use either int32 or int64 for the value.
  • Slightly improved the resource part, in particular cache and handle classes.
  • Slightly improved the snapshot stuff in all its parts.
  • Slightly improved the monostate class.
  • Added Conan support.
  • Added fwd.hpp headers.
  • Introduced new grouping functionalities: the groups are an extremely powerful tool that allows up to perfect SoA during iterations. They support also exclusion lists. Please, refer to the official documentation for all the details.
  • Introduced pagination for the pools to reduce memory usage on sparse components.
  • Introduced ENTT_DISABLE_ASSERT/ENTT_ASSERT macros to speed up EnTT in debug (see the FAQ from the wiki for more details).
  • Added signal on replace, renamed and extended signals on construction/destruction.
  • Added default aliases for most common cases (eg entt::entity and entt::registry).

The most important feature both in terms of functionalities and performance are the so-called groups. Let me go a little more in detail. They are divided into three parts and refer to different access patterns, being therefore indicated for different paths, from the most critical to the least relevant:

  • Full-owning groups: they allow what is called perfect SoA. Iterating this type of groups is reduced to iterating a bunch of packed arrays of the same size, all ordered in the same way. Probably we are close to the best that can be achieved in terms of performance.
  • Partial-owning groups: they allow what is called almost-perfect SoA. These groups go with perfect SoA on the types of components they manage to indecently increase performance during iterations and rely on indirection to access the other types of components.
  • Non-owning groups: they know in advance what are the entities that respect a given pattern and take advantage of this to iterate them quickly. However, they don't own any component and therefore rely on direction to retrieve their instances.

In general, the more types a group owns, the faster it will be to iterate entities and components. Refer to the wiki for all the details.

I didn't mention all the improvements made to further increase performance, but I want to let you know that there have been many.
To sum up, EnTT is now faster than ever, more flexible and offers even more features.

EnTT is still and as always battle-tested with 100% coverage. This doesn't mean that it's bug-free, but gives enough guarantees about its stability for use in production environments.
The documentation has been updated, as well as the wiki and both reflect the latest version available.

If I've forgotten anything, do not hesitate to contact me, so as to integrate this section.