Releases: scellecs/morpeh
Releases · scellecs/morpeh
2024.1.0
Fixed
- Fixed archetype recreation when an archetype becomes empty in the same Commit call when the archetype has to become active again.
- Fixed
FastList<T>.RemoveAtSwap()
incorrect logic & managed pointers memory leak. - Fixed multiple IL2CPP static guards and extra setup code in different methods.
- Fixed Disposable components not being disposed when its
Stash
's World is disposed. - Fixed code formatting in multiple files.
- Fixed Incorrect
IntHashSet
enumerator implementation for positive values. - Fixed broken
IntHashSet.CopyTo()
method. - Fixed data cleanup in multiple places to avoid memory leaks if
World
/specific things are disposed. - Fixed
World.Commit()
updating metrics even in release builds. - Fixed
InitializationDefaultWorld
disposing existing worlds when it should not. - Fixed incorrect
World
id assignment - in some cases, it was possible to get two worlds with the same id. Now worlds reuse ids correctly. - Reduced GC allocation count in
FilterBuilder
. - Reduced debug builds overhead in general.
- Reduced overall generic type count to reduce IL2CPP metadata size.
- Improved performance of
Filter.First()
,Filter.FirstOrDefault()
,Filter.GetEntity()
. - Significantly improved performance of
World.Commit()
,Stash.Set()
,Stash.Add()
,Stash.Remove()
. Entity
copying is no longer performed duringfilter.AsNative()
. Entities are read directly from the archetypes.
Added
- [Breaking] Added
World
ID limit (256). - Added Entity ID and components search to the World Browser.
- Added tests for the most part of the codebase.
- Added very basic benchmarks for iterations, structural changes, etc.
- Added
Filter.Dispose()
method. - Added generations to worlds.
- Added exceptions for typical runtime errors like InvalidSetOperationException both in Debug and Release mode.
- Added meaningful exception messages for common errors with an actual component type and entity ID where applicable.
- Added
World.Has(Entity entity)
&World.IsDisposed(Entity entity)
methods as a faster alternative toEntity.IsDisposed()
. - Added
Filter.ArchetypesCount
property. - Added
Filter.Has(Entity entity)
method. - Added entity debugger proxy with component visualization during breakpoint debugging - components are now displayed directly on entities when paused.
Changed
- [Breaking]
Entity
is now a struct instead of a class and no longer haspartial
modifier. - [Breaking]
Entity.Invalid
->default(Entity)
. - [Breaking] Native API now uses
Entity
directly instead of removedEntityId
. - [Breaking]
EntityExtensions
(Entity.Add<T>()
, etc.) methods are now marked as Obsolete because of a potential removal in future versions of Morpeh. - [Breaking]
Stash<T>
initial size functionality is now a part ofComponentId
. - [Breaking]
ComponentId
andExtendedComponentId
are now split into different use cases to reduce IL2CPP metadata size.ExtendedComponentId
is now stripped out of non-UnityEditor runtimes unlessMORPEH_GENERATE_ALL_EXTENDED_IDS
is specified. - [Breaking]
bool Stash<T>.Add(Entity entity)
now throws an exception if the entity already has the component. Refer to the Migration Guide for more detailed explanation. - [Breaking] Base
Stash
class changed toIStash
interface. - [Breaking]
FilterBuilder
is now a struct instead of a class. - Reworked World Browser window to be more performant.
- Reworked the entire repo structure to allow for extra projects like tests and benchmarks.
- Reworked archetypes and filter matching to be much more efficient without recursive calls, Stash checks, etc.
- Simplified
Filter
enumeration. - Restored multiple collections' internal storage to managed arrays to make debugging memory easier.
Stash<T>
initial size functionality is now a part ofComponentId
. UseComponentId<T>.StashSize
to modify the initial size of the stash before the first call toWorld.GetStash<T>()
.IntHashMap
&LongHashMap
-GetValueByKey
andGetValueRefByKey
methods now throw exceptions when attempting to get a value using an invalid key.FastList<T>
implementation is now less error-prone and has a more consistent API.World.Default
access does not require an array access anymore.StashMap
->IntSlotMap
.Filter
chunks (used forAsNative()
calls) are now allocated only if necessary.NativeStash
usesNativeIntSlotMap
instead of removedNativeIntHashMap<T>
.- Class
HashHelpers
is now public. Archetype
class is now public, while its structure remains internal. This allows for less painful development of extensions for the internal part of Morpeh, and enables interaction with theArchetype
type in user code.- The entity's components set is now stored in its
Archetype
rather than directly in theEntity
. - internal TypeInfo typeOffset has been renamed to typeId, and what was previously typeId is now typeHash.
Removed
- [Breaking] Removed
UniversalProvider
. - [Breaking] Removed
EntityId
,World.TryGetEntity
andWorld.GetEntity
. - Removed
BitMap<T>
. - Removed
UnmanagedList<T>
. - Removed
UnmanagedArray<T>
. - Removed
Stash<T>.Empty()
. - Removed
NativeIntHashMap<T>
. - Removed
GC.Collect()
calls in the pause/focus events in Unity.
2023.1.1
Fixed
- Fixed
Stash.IsEmpty
never being true. - Fixed
Stash.RemoveAll
breaking the stash. - Fixed
World.Dispose
throwing on multiple calls. - Fixed
WorldBrowser
inability to update world view list by @skelitheprogrammer. - Fixed
MigrateTo
broken enumerator. - Fixed
World.CleanupUpdate
small allocation.
Added
- Added
IBoxedAspectFactory
to allow aspects to be created via DI by @vanifatovvlad. - Added
MORPEH_DISABLE_COMPILATION_REPORT
andMORPEH_DISABLE_COMPONENT_DISPOSE
defines. - Added
Length
property toStash
. - Added
Enumerator
forStash
.
Changed
- Devirtualize stashes.
- Changed method signature for
GetValueRefByKey
inNativeIntHashMap<TNative>
, addedref
keyword to the first parameter. - Changed methods signatures for
Get
inNativeStash<TNative>
, addedref
keyword to the first parameter.
2023.1.0
Fixed
- Fix
NativeFilter
allocations. - Calling
World.InitializeDefaultWorld()
do not create new Update Loop Runner. - Avoid defines modification by @vanifatovvlad.
- Small bugfix providers, when entity was destroyed.
Added
- Aspects API.
IAspect
,IFilterExtensions
,Filter.Extend()
. - New method for stashes
RemoveAll()
by @SH42913. - Deinitilize method for
EntityProvider
,MonoProvider
. World.JobHandle
.- Metrics for Unity Profiler.
- TriInspector Integration for replacing paid Odin Inspector.
World.IsDisposed
andWorld.IsNullOrDisposed()
MORPEH_DISABLE_SET_ICONS
define for disabling set icons in Project Window.- Safety check for
World.Commit()
inside Filter foreach loop. - New Pinned Collections.
World.DoNotDisableSystemOnException
Filter.IsNotEmpty()
Changed
- [Breaking] Filters must be initialized with
Build()
method. - Overrided Entity.ToString() will output ID by @SH42913.
- Rework types warmup for fast start of application.
- All archetypes are reworked. Performance has been significantly improved and RAM consumption has been reduced.
- All Native API changed from internal to public.
Entity
andWorld
now has partial modifier.
Removed
- Discover window.
- [Breaking] Removed
ComponentProvider
.
2022.2.3
2022.2.2
2022.2.1
2022.2.0
[2022.2.0] - 28.12.2022
Added
- Added
ICleanupSystem
suitable for cleanup logic. Called by the most recent in LateUpdate by default. - Added to
World
methodGetReflectionStash
to get stash not via generic argument, but bySystem.Type
. - Added a
MORPEH_THREAD_SAFETY
define that forces the kernel to validate that all calls come from the same thread the world was created on. The binding to a thread can be changed using theWorld.GetThreadId(), World.SetThreadId()
methods. - Added API for plugins. To use it, you need to implement
IWorldPlugin
. - Unmanaged Collections for Jobs & Burst.
Changed
- [Breaking] Minimal Unity version up to 2020.3.*
- [Breaking] Rename namespaces
Morpeh/XCrew.Morpeh
->Scellecs.Morpeh
- [Breaking] Globals placed in a separate package via the link https://github.com/scellecs/morpeh.globals
- [Breaking] Method
World.UpdateFilters()
renamed toWorld.Commit()
. - [Breaking] Class
ComponentsCache<>
renamed toStash<>
. All stash methods lost prefixComponent
, now it'sAdd, Get, Set, Has, Remove
. - [Breaking] Filters validate that there are no duplicate types in them. For example,
Filter.With<A>().With<A>()
will throw an error. - [Breaking] Removed the
Filter
property from systems, useWorld.Filter
instead. - The mechanism for cleaning components has been redesigned. Now the component must implement
IDisposable
, and it is necessary to call theAsDisposable
method of the stash once in order for the cleanup to take place. For example, the shortest version isWorld.GetStash<T>().AsDisposable()
. - For
Installer
propertyBasePair.System
now has public setter. EntityProvider
andMonoProvider
are now optimized in methodsOnEnable(), OnDisable()
Fixed
GetLengthSlow()
sometimes gave the wrong length.IconsSetter
no longer gives a warning in Unity 2021+- Cannot add validate method for menu item warning.
ComponentsCacheDisposable
doesn't work with AOT fixed by redesign.