All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
- Method
View:patch()
. - Method
Registry:find()
. - Method
Registry:insert()
- Overload
ecr.queue()
to accept a function connector. - Function
ecr.buffer_to_buffer()
.
- Method
Registry:patch()
will return the new value. - Methods
Observer:iter()
andQueue:iter()
will no longer clear on completion. Iteration by__iter
will still clear.
- Method
Observer:persist()
. - Method
View:use()
.
- Single type view not excluding properly with multiple exclude types.
Connection:disconnect()
disconnecting the wrong listener
- Constant
ecr.context
. - Constant
id_size
. - Function
ecr.array_to_buffer()
. - Function
ecr.buffer_to_array()
. - Overload for
Registry:storage()
to get an iterator for all storages.
-
All components must be defined before the registry using them is created.
-
The context entity does not exist until
Registry:context()
is first called. -
The context entity can now be destroyed.
-
Observers are now empty when first created.
-
Entity id size reduced from 8 bytes to 4 bytes.
- Max entities that can exist at once is now
2^16-1
(65,535
).
- Max entities that can exist at once is now
-
Renamed
ecr.Entity
type alias toecr.entity
. -
Renamed
Registry:added()
toRegistry:on_add()
. -
Renamed
Registry:changed()
toRegistry:on_change()
-
Renamed
Registry:removing()
toRegistry:on_remove()
. -
Renamed
Registry:orphaned()
toRegistry:has_none()
. -
Property
Pool.entities
type is now abuffer
. -
Method
Registry:set()
can now also add tags. -
Method
Observer:disconnect()
can only be called on empty observers. -
Signal
Registry:on_change()
now fires before the component is changed.- New value still given as argument, but now can retrieve old value with
Registry:get()
.
- New value still given as argument, but now can retrieve old value with
- Method
Registry:version()
. - Method
Registry:current()
.
Large refactor to use the new Luau buffer
datatype. Up to 2x faster and 2-4x
less memory usage across the board.
Connection:reconnect()
.ecr.entity
which is a built-in component that can be used to access a dedicated entity pool:- Exclude-only views
registry:view(ecr.entity):exclude(...)
. - Signals for creation and destruction of entities
registry:on_add(ecr.entity):connect()
. - Direct access to array of all entities in the registry
registry:storage(ecr.entity)
.
- Exclude-only views
ecr.is_tag()
to check if a given component is a tag type.Registry:context()
to store components not specific to an entity.- Methods for lower level access to pools.
- Using
Registry:set()
to setnil
values will now error.- Use
Registry:remove()
instead.
- Use
Registry:handle()
calls are now memoized, passing the same ids will return the same handle objects.
- Operations
#Registry
andfor id in Registry do
.- Replaced by entity storage.
Registry:patch()
will invoke the component constructor if the entity does not have the given component.
Registry:orphaned()
not erroring with destroyed id.ecr.queue()
clearing early.
- Check for iterator invalidation occuring with group misusage.
- Function
ecr.tag()
to create valueless components. - Function
ecr.queue()
and theQueue
class. - Function
ecr.name()
for associating names with component types. - Method
Registry:handle()
and theHandle
class. - Method
Registry:try_get()
. - Method
Observer:persist()
. - Length operator for registry
#Registry
. - Iteration over registry
for id in Registry do
.
- Observers will automatically clear themselves after iteration by default.
- Call
Observer:persist()
to stop this.
- Call
Registry:get()
will now error if the entity does not have every component.
- Method
Registry:version()
. - Method
Registry:current()
. - Method
Registry:entities()
. - Method
Registry:size()
.
- Connecting or disconnecting an already connected or disconnected observer will no longer error.
- Excluding an already excluded component with
View:exclude()
andObserver:exclude()
no longer errors. - Method
Registry:add()
will do nothing if the entity already has the component. - Method
Registry:orphan()
renamed toRegistry:orphaned()
. - Method
Registry:valid()
renamed toRegistry:contains()
. - Method
Registry:create()
is now guaranteed to always return unique identifiers. - Using invalid entities no longer causes undefined behavior in any method and instead errors.
Registry:track()
will now track all components passed, not just the first one.
- Methods:
View:each()
Observer:each()
Group:each()
- Undefined behavior sometimes occuring when removing grouped components.
- Observers not returning up-to-date values when changing a component while it is disconnected.
- Component grouping and
Registry:group()
. - Method
View:use()
. - Constant
ecr.null
.
- Method
View:include()
andObserver:include()
.
Registry:add()
not firingRegistry:on_add()
signals.- Mismatch between argument list and values returned in multi-typed observers.
- Observers not garbage collecting after calling
Observer:disconnect()
.
- Connection firing speed by ~70%.
- Overload for
Registry:create()
to create an entity with a given identifier.
- Registry signals no longer pass the registry as the first argument to listeners.
- Observers no longer track entities with removed components.
- Method
Registry:entities()
now creates and returns an array of only valid entities. - Function
ecr.registry()
can no longer pre-allocate memory.
- Method
Registry:capacity()
.
- Double-type view iteration speed by ~100%.
- Method
View:include()
andObserver:include()
. - Method
Registry:patch()
. - Method
Registry:add()
and optional default parameter forecr.component()
.
- Behavior
for ... in View do
now behaves the same asfor ... in View:each() do
. - Signal diconnect API (Signal now returns a connection object to call disconnect on).
- Entity creation and release speed by ~100%.
- Multi-type view iteration speed by ~60%.
- Initial release.