Releases: skypjack/entt
EnTT v3.2.0
Changelog:
- Added
EnTTto the GitHub Sponsors program (link in the README file). - Added the try online badge to the README file.
- Moved CI to GH Actions.
- Use
codecovinstead ofcoveralls. - Relaxed constraints on the order of types in the group definition.
- The runtime reflection system finally works across boundaries.
- In-depth review of the runtime reflection system, backward compatibility not guaranteed.
- Key/Value pairs, key-only properties, tuples and annotations (invocable) are allowed as meta properties.
meta_anyusesstd::reference_wrapperinstead ofas_alias_tfor aliasing.- Added
meta_type::compare,meta_anyno longer has to store aside comparison functions. - New
meta_anyconstructor for unmanaged objects taken from ameta_handle. meta_handleno longer exposesdata/try_cast.- All meta functions take their arguments by alias and can edit objects in the outer context.
- Introduced
meta_type::remove_extentto get the meta type of the elements of an array. - A static assertion forbids using non-copyable types with
meta_any. - Added
dispatcher::discardto clear pools of events. - Invocation order guaranteed for signals (
sigh,registry,dispatcher, ...). - Overloaded
sink::beforefunction to insert listeners at specific locations in the signal. sink::disconnectandsink::beforesupport also pointers as instances or payload.delegatesupports also pointers as instances or payload.sparse_set::swapandstorage::swapaccept entities, no longer positions.- Sorting pools doesn't require to allocate anymore and is much faster.
stomp& spawn work also with const source registries now.- Make empty components eat arguments on construction.
- Multi-component version of
registry::reserve,registry::shrink_to_fit,registry::empty. - Added
registry::prepareto force-create component pools within the registry. - Views support exclusion lists (eg
registry.view<T>(exclude<U>)). view::getfor single component views accepts an optional template parameter for consistency.- Multi-component version of
view::empty. - Multi-component version of
group:empty. - Sorting groups doesn't require to allocate anymore and is much faster.
- Nested groups: perfect SoA to the rescue.
- Allow
processto work with delta types other than fundamental ones. - Utilities:
overloadedandy_combinator. - Added
is_equality_comparable[_v]trait. - Added what is needed for the choice trick, see
choice_t/choicefromtype_traits.hpp. named_type_traits_v<Type>utility/shortcut fornamed_type_traits<Type>::value.ENTT_DISABLE_ETOmacro to disable empty type optimization for components.- Macros (for example
ENTT_NAMED_TYPE) always require a trailing semicolon. resource_handle,resource_loaderandresource_cacheare nowhandle,loaderandcache.cacheexports bothresource_typeandid_type.basic_continuous_loadersupport for map-like containers.- Fixed a bug on groups when dependencies between components were set.
- Fixed a bug of
collector::wherewhen multiple rules were declared at once. - Marked cmake project explicitly as C++, language C is required only if
BUILD_MODis set toON. - Added cmake support for clang users on Windows.
- Added namespace qualifier in CMake.
- Performance improvements here and there (eg groups lookup, stomp & spawn utilities).
Be aware that this release contains some non-backward compatible changes.
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I've also updated the FAQs and the section EnTT in Action with more and more examples.
EnTT v3.1.1
Changelog:
- Small perf improvements here and there.
- Fixed a major bug on the batch creation of entities.
- Added a few more tests for the batch creation of entities.
- The runtime reflection system compiles fine with VS2019 when C++20 is in use (
latest).
This release is mainly due to the resolution of the bug on the batch creation of entities.
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
EnTT v3.1.0
Changelog:
- Added
radix_sortalgorithm. - Resource handles are now mutable.
- Small enhancement to the
actorclass. entt::nullno longer takes the version into account.- Updated the codebase so as to remove direct dependencies on hashed strings (eg runtime reflection system).
- Added support for
std::wstrings to hashed string (see thehashed_wstringclass and the_hwsliteral). - Entity identifiers are enum classes, user defined types are allowed (see
entt::entityandENTT_OPAQUE_TYPE). entt::registry::component_typehas been replaced by the opaque identifierentt::component.- Batch creation returns iterators and no longer raw pointers.
- Added two overloads of
registry::createto spawn (literally clone) entities from a prototype. - Added
registry::stompto clone/overwrite entities locally or between different registries. - Added
registry::ctx_or_setto get or create context variables at once (similar toregistry::get_or_assignfor components). - Easy set up for short circuits on the
registryclass and cross events between different registries. - The arguments of the signals emitted by the
registryclass are entity/registry/component and no longer registry/entity/component. registry::cloneaccepts also an exclusion list to opt-out from the cloning functionality.- Added
view::lessandgroup::less. They work likeeachbut they don't return empty types. - Added the possibility to sort free instances for owned types (see
registry::sort). - It's now possible to sort non-owning groups using a custom comparison function.
- Added excluded components to the list of template parameters of a group.
- Full featured
as_grouphelper, it supports also observed and excluded components. - Added
cache::eachto allow iteration of all resources in a cache. - A more flexible
delegateclass that accepts also functions with a list of parameters that is shorter than that of the delegate itself. delegateworks also with move only types and non-const references.delegate::operator==anddelegate::operator!=test the instance as a whole.- Removed collector from
sightype, turnedsig::collectin a function template. - Reviewed
sink::disconnect(and added another overload to remove all the listeners at once based on instances or payload). - Added
connectionandscoped_connection, the former is now the return value ofsink::connect. delegateandsinkaccept only references for instances and values, no longer naked pointers.- Curried functions return their values as references, no longer as naked pointers.
- Introduced the
observerclass to ease the definition of reactive systems. - Greatly improved the runtime reflection system and reduced to a minimum the number of copies when
meta_anyis involved. - Added support for
voidtometa_any, it's treated as a normal type but it contains no values. - Added
meta_any::try_cast(extended-if-friendly function), assignment operators, in-place constructors and so on. meta_anycan finally be used to work also with unmanaged objects.- Return values for
meta_funcarevoid-friendly and convert to false only in case of errors. - Setters and getters for
meta_datareceive instances as references, no longer as pointers. - Added the possibility to set free/member functions as conversion functions on
meta_conv. - Introduced policies (
as_is,as_void,as_alias) in the runtime reflection system. - Defined
type_list_sizeandtype_list_size_vto get the size of a type list. - Fixed a major bug in the clone functionality of the registry class.
- Fixed a major bug in the range destroy of the registry class.
- Fixed
group::sortwith components. Bazelas an alternative build system.- Added Conan support in editable mode.
- Added support for VS2019 through appveyor (CI).
- Performance improvements here and there (eg construction/destruction of components).
Classes and features that are no longer available starting from this version:
prototype:registry::stompmakes it easier to use a prototype-registry for the same purpose.dependency(and thereforeconnect,disconnect): new signatures for callbacks allow for short circuits.invokerand basic collectors (null and void ones): added an explicitcollectfunction tosigh.maybe_atomic_t: no longer required.
The documentation is up-to-date and the library is battle-tested with 100% coverage as usual.
I've also updated the FAQs and the section EnTT in Action with more and more examples.
EnTT v3.0.0
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
familyclass.- As a consequence,
EnTTcan now work across boundaries (welcome DLLs).
- As a consequence,
- 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
registryclass in all its parts:- Added
registry::try_get. - Added
registry::get_or_assign. - Added
registry::createoverload to generate multiple entities at once. - Support for component lists to initialize entities when invoking
registry::create. - Renamed
registry::accommodatetoregistry::assign_or_replacefor consistency. - Support for const and non-const types of components (eg
registry.view<T>()vsregistry.view<const T>()). - Support for const overload of
registry::view. - Support for groups (see below).
- Added
registry::clonefunctionality. - Bulk operations are now available.
- Added
- Extended the
delegateclass and thereforesighanddispatcheras 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
viewclass:- Added
view::findto search for specific entities. view::eachsupport lambdas that either accept or not the entity as a first argument (performance improvement).
- Added
- Improved and extended
hashed_string:- Added
hashed_string::to_valuestatic member function. - Added possibility to use either int32 or int64 for the value.
- Added
- Slightly improved the resource part, in particular
cacheandhandleclasses. - Slightly improved the snapshot stuff in all its parts.
- Slightly improved the
monostateclass. - Added Conan support.
- Added
fwd.hppheaders. - 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_ASSERTmacros to speed upEnTTin 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::entityandentt::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.
EnTT v2.7.3
Mainly due to some important bugs:
- Fixed
Snapshot::destroyed, it could lead to undefined behavior under certain circumstances (see #128) - Fixed
Registry::accommodate, it didn't trigger events in any case (see #133) break_tdoesn't exist anymore,dependencyis nowconnect/disconnectDelegate/SigHsupport also const member functions now- Suppressed warnings within
SparseSeton x86 platforms - Updated entt-in-action list
- Review of the internals
- Updated build system
- More tests
Moreover, ports that have been created/updated:
- Added unofficial/unsupported port to/branch
vs2015(help is appreciated, otherwise it will get old soon) - Updated branch
c++17.draft, an up-to-date port ofEnTTto C++17 that will replacemastersooner or later
Finally, the documentation has been completely reviewed. The README file is now shorter than ever and I created a set of wiki pages with all the information and crash courses written so far. The wiki pages are also part of the online documentation prepared via doxygen (see menu, related pages) and therefore of the project, dir docs.
EnTT v2.7.2
EnTT v2.7.1
Bug fixing:
- Runtime views were inherently bugged and they could result in undefined behavior under certain circumstances. They work as expected now.