Releases: genaray/Arch
1.2.8
Bug fixes & Changes 🛠
- World concurrency fixes, structural change annotations, and code cleanup by @LilithSilver in #156
- Fixed Some Array Extensions Bugs by @martindevans in #157
- Fixed Some Doc Comments by @martindevans in #158
- CommandBuffer Tests And Fixes by @martindevans in #160
- Enumerator Tests by @martindevans in #164
- Fixed Chunk.Has by @RoyconSkylands in #167
- New and faster Hashing by @martindevans in #161
- Fixes a bug with the bitset hash by @RoyconSkylands in #171
- Fix typos in Edges folders by @BeanCheeseBurrito in #172
- Fix leftover nullability warnings by @DrSmugleaf in #175
- Fix bug in structural sparse array, resulting in massive performance loss due to reallocation. Affecting command buffer heavily. by @emelrad12 in #176
- Mark classes as sealed by @metalgearsloth in #183
- Fix EVENTS with PURE_ECS by @metalgearsloth in #186
- Fixing sizes by @RoyconSkylands in #189
- Fixed archetype duplication after loading a save by @richdog in #191
- Fix missing component Add event, and raise Remove event when destroying entities. by @Epicguru in #196
- Fixed issue with Unsafe.As not working in .Net 2.1 by @richdog in #198
- CommandBuffer is decoupled from the world by @genaray in #208
- Fixed .Add when a newly non registered component was added.
- Fixed bug where
World.TrimExcess
does not trim Recycled-Entities. - Fixed bug in JobScheduler which prevents a deadlock.
- Moved CommandBuffer to
Buffer
namespace, might break references.
New Features 🎉
- Allow getting and setting of recycled entity ids for persistence by @richdog in #193
- New
Dangerous
methods for setting and getting recycled ids. - Integrated the updated and improved JobScheduler 1.1.2.
- Added
ScheduleParallelInlineChunkQuery
for schedulingChunkJobs
more effectively and to determine dependencies. - Added
World.IsAlive(EntityReference);
.
New Contributors ❤
- @LilithSilver made their first contribution in #156
- @martindevans made their first contribution in #157
- @RoyconSkylands made their first contribution in #167
- @BeanCheeseBurrito made their first contribution in #172
- @emelrad12 made their first contribution in #176
- @metalgearsloth made their first contribution in #183
- @richdog made their first contribution in #191
- @Epicguru made their first contribution in #196
Full Changelog: 1.2.7...1.2.8
1.2.7
Bug fixes & Changes
- Added Archetype-Edges for faster single Remove-Component operations.
- Improved performance for Single
Add
andRemove
operations. Entity
now implementsIComparable<Entity>
- Checking a default
Entity
orEntityReference
forIsAlive
now returns false. - Archetypes with zero entities are now skipped during iteration.
BitSet
s were vectorized for faster checks (especially when there many registered components)- Query API was slightly improved, no more in modifier for entity iteration -> faster
ComponentType
is now slimmer and blittable (just pure data, no managed types in it anymore).
New Features
- Native AOT support by
ComponentRegistry
andArrayRegistry
- can now be used to register components native aot-wise. - A variety of
DangerousUtilities
to access arch internals. Used especially by Arch.Extended. - Some new scripts to build Arch directly for Unity in the scripts folder.
Arch.LowLevel
is now a dependency
Contributions
Thanks to @reeseschultz , @Hertzole, @DrSmugleaf for several contributions! <3
1.2.6
Bug fixes & Changes
- Added Archetype-Edges for faster single Add-Component operations.
- Increased performance for lookups and bulk operations due to better shift handling.
- Worlds are now recycled correctly and more efficiently due to plain array usage.
- CommandBuffer now invokes Events correctly.
New Features
- Added Entity-Events.
- Added dangerous utility methods for accessing some internals, this will be used in the serialization package.
- Better Component-Registration and methods, now also work for most structs.
Contributions
Thanks to @DrSmugleaf, @nathanrw , @mikhail-dcl , @clibequilibrium for several contributions! <3
1.2.5
Bug fixes & Changes
CommandBuffer
do now clear correctly- Added
Debug.Asserts
to several places to aid development - Fixed
World.Range
which did not set components - Fixed
World.Add(entity,cmp)
which did not set component either. ComponentTypes
insideComponentRegistry
are now offset by +1 to fix a hash related issue- MurMurHash3 used internally for Components
Query._any
now works correctly for larger bitsets > 32.- Improved performance of
TryGet
andTryGetRef
methods.
New Features
- Implicit conversion operation for
EntityReference
to `Entity´. World.AddOrGet<T>
to ensure components on entities.- Some other small utility methods.
Contributions
Huge thanks to @DrSmugleaf and @nathanrw for bug fixes and contributions! :)
1.2.4.2-beta
Bug fixes & Changes
- Fixed an issue where structural changes sometimes allocated too many chunks resulting in wasted memory and potential crashes.
- Fixed
PURE_ECS
compatibility - Fixed
EntityReference.IsAlive()
returning true in certain scenarios where the entity was clearly dead or not valid anymore. - Fixed a couple of warnings
- Fixed some tests
Contributions
Thanks to @DrSmugleaf and @nathanrw for fixing several warnings and bugs! :)
1.2.4
Bug fixes & Changes
CommandBuffer
operations were now fixed and do record Add and Sets correctly.CommandBuffer
resizes its internal arrays now correctly.- Non generic
World.Add
,World.AddRange
,World.RemoveRange
were fixed, they created wrong archetypes with doubled components in some cases. - Almost all API now uses spans, spanless alternatives can be found in
Arch.Core.Extensions
- Simplified HashCode generation in general.
- Some slight performance improvements during entity move operations.
- Removed
in
andref
modifiers for many operations because of performance reasons (most used structs are small enough to be copied and thus more efficient).
New Features
- Added Debug-Assert which is triggered by undefined structural changes to notify the user about those.
- Added non generic
World.Remove
. - Added
EntityInfoStore
which acts as an storage forEntity
meta data and offers an unified API to access those data.
Contributions
Thanks to @DrSmugleaf for the PRs and fixing the compatibility with #define pure_ecs and nullable issues :)
Thanks to @Donaut for the EntityInfoDictionary
and its integration! :)
1.2.3
Bug fixes & Changes
- Fixed a bug where frequent adding/removing components caused a messed up
EntityInfo
dictionary and a crash sooner or later. - Fixed a bug where adding components by a
QueryDescription
did not set its value correctly, this was now fixed as well. - Fixed
BitSet.None
, which now works correctly with large amounts of components. - Removed struct constraints on
EntityExtension
methods. Entity.Set
now uses default valuesCommandBuffer
methods now make use of default values.
New Features
World.Clear()
was introduced and clears the whole world.World.GetEntities(Span<Entity> ...);
was introduced as an alternative to lists, soon all the available API will make use of spans.ComponentRegistry
features a method to register aComponentType
, therefore the user can register custom types.
ComponentRegistry.Add(ComponentType);
Arch tries to support so called managed structs. However, this is not always fully possible due to compatibility with a type-based API. And the existing C# Marshal methods are not always able to recognize managed structs and determine their size.
Therefore, a method has now been added to the ComponentRegister to allow the user to register components independently. He can specify the size himself and thus it is now also possible to add all managed structs.
public struct ManagedStruct{ public List<int> SomeInts{ get; set; } }
// Register
var componentType = new ComponentType(ComponentRegistry.Size, typeof(ManagedStruct), 8, false); // 8 = Size in bytes of the managed struct.
ComponentRegistry.Add(componentType);
// Use
var entity = world.Create(new ManagedStruct());
Contributions
Thanks to @DrSmugleaf for the PRs and fixing the compatibility with #define pure_ecs
:)
1.2.0
Bug fixes
- Fixed an issue where the
QueryArchetypeEnumerator
throws an exception that was caused due to inaccurate pooling - => 32 components on an entity will not throws exceptions anymore
entity.Add(cmp)
now works exactly asworld.Add(in entity, cmp)
does
Changes
- Reworked some internals
ComponentRegistry
now features several methods to modify registered components for hot reloading- Several other small changes in documentation and API
Contributors
Thanks to @stgeorge and @clibequilibrium for discovering bugs and other small missing features :)
1.1.9
New Features
- Fixed a structural changes related memory leak occurred by calling
.Add
or.Remove
. - High-performance bulk operations for
Destroy
,Set
,Add
andRemove
operations by targeting a range of entities using QueryDescription. - Some other small performance tweaks.
Bulk Operations
Until now, destroying entities or changing their component structure has always been a costly endeavor.
This is mainly due to the Archetype and Chunk architecture itself.
Bulk operations are now changing that. By means of these you can address all entities of a certain structure, which is significantly faster.
var query = new QueryDescription().WithAll<Player>();
world.Set(in query, new Position(), new Transform()); // Sets components for all entities fitting the query.
world.Add(in query, new KillTag(), new DropItems(),..); // Every single entity fitting the queryDescription will receive those components
world.Remove<Velocity, Defence>(in query);
world.Destroy(in query);
Contributions
Many thanks to @Pheubel and @stgeorge for contributions and issues :)
1.1.5
Changes
References<...>
andEntityReferences<...>
are now calledComponents<...>
andEntityComponents<....>
- Archetypes, chunk and the world do not automatically release resources anymore. That was slow as heck.
- Entity version now works correctly.
New Features
World.TrimExcess()
can now be called regularly to release unused memory and resources.World.Reference(in entity)
orentity.Reference()
return aEntityReference
used to reference entities.World.Destroy
is now slightly faster
Entity references
using var world = World.Create();
var entity = world.Create(_entityGroup);
var reference = world.Reference(entity); // This should be stored in your component ( entity.Reference() is also available. )
// Checks if the entity is the same as before by comparing the version and its id
if(reference.IsAlive()) {
var cmps = reference.Entity.Get(...);
}
Bug fixes and contributors
Big thanks to @stgeorge , @Pheubel and @RoyAwesome for your bug discoverys and enhancements ! :)