mirror of
https://github.com/Ukendio/jecs.git
synced 2025-11-18 17:22:52 +00:00
10 KiB
10 KiB
Jecs Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
[world]:- Changed
world:clearto also look through the component record for the clearedID- Removes the cleared ID from every entity that has it
- Changed entity ID layouts by putting the index in the lower bits, which should make every world function 1-5 nanoseconds faster
- Fixed
world:deletenot removing every pair with an unalive target- Specifically happened when you had at least two pairs of different relations with multiple targets each
- Changed
[hooks]:- Replaced
OnSetwithOnChange- The former was used to detect emplace/move actions. Now the behaviour for
OnChangeis that it will run only when the value has changed
- The former was used to detect emplace/move actions. Now the behaviour for
- Changed
OnAddto specifically run after the data has been set for non-zero-sized components. Also returns the value that the component was set to- This should allow a more lenient window for modifying data
- Changed
OnRemoveto lazily lookup which archetype the entity will move to- Can now have interior structural changes within
OnRemovehooks
- Can now have interior structural changes within
- Optimized
world:hasfor both single component and multiple component presence.- This comes at the cost that it cannot check the component presence for more than 4 components at a time. If this is important, consider calling to this function multiple times.
- Replaced
[0.5.0] - 2024-12-26
[world]:- Fixed
world:targetnot giving adjacent pairs - Added
world:eachto find entities with a specific Tag - Added
world:childrento find children of entity
- Fixed
[query]:- Added
query:cached- Adds query cache that updates itself when an archetype matching the query gets created or deleted.
- Added
[luau]:- Changed how entities' types are inferred with user-defined type functions
- Changed
Pair<First, Second>to returnSecondifFirstis aTag; otherwise, returnsFirst.
[0.4.0] - 2024-11-17
[world]:- Added recycling to
world:entity- If you see much larger entity ids, that is because its generation has been incremented
- Added recycling to
[query]:- Removed
query:drain- The default behaviour is simply to drain the iterator
- Removed
query:next- Just call the iterator function returned by
query:iterdirectly if you want to get the next results
- Just call the iterator function returned by
- Removed
query:replace
- Removed
[luau]:- Fixed
query:archetypesnot takingself - Changed so that the
jecs.Pairtype now returns the first element's type so you won't need to typecast anymore.
- Fixed
[0.3.2] - 2024-10-01
[world]:- Changed
world:cleanupto traverse a header type for graph edges. (Edit) - Fixed a regression that occurred when you call
world:setfollowing aworld:removeusing the same component - Remove explicit error in JECS_DEBUG for
world:targetwhen not applying an index parameter
- Changed
[typescript]:- Fixed
world.setwith NoInfer
- Fixed
[0.3.1] - 2024-10-01
[world]:- Added an index parameter to
world:target - Added a way to change the components limit via
_G.JECS_HI_COMPONENT_ID- Set it to whatever number you want but try to make it as close to the number of components you will use as possible
- Make sure to set this before importing jecs or else it will not work
- Added debug mode, enable via setting
_G.JECS_DEBUGto true- Make sure to set this before importing jecs or else it will not work
- Added
world:cleanupwhich is called to cleanup empty archetypes manually - Changed
world:deleteto delete archetypes that are dependent on the passed entity - Changed
world:deleteto delete entity's children before the entity to prevent cycles
- Added an index parameter to
[query]:- Fixed the iterator to not drain by default
[typescript]- Fixed entry point of the package.json file to be
srcrather thansrc/init - Fixed
query.nextreturning a query object whereas it would be expected to return a tuple containing the entity and the corresponding component values - Exported
query.archetypes - Changed
pairto return a number instead of an entity- Preventing direct usage of a pair as an entity while still allowing it to be used as a component
- Exported built-in components
ChildOfandName - Exported
world.parent
- Fixed entry point of the package.json file to be
[0.2.10] - 2024-09-07
[world]:- Improved performance for hooks
- Changed
world:setto be idempotent when setting tags
[traits]:- Added cleanup condition
jecs.OnDeletefor when the entity or component is deleted - Added cleanup action
jecs.Removewhich removes instances of the specified (component) id from all entities- This is the default cleanup action
- Added component trait
jecs.Tagwhich allows for zero-cost components used as tags- Setting data to a component with this trait will do nothing
- Added cleanup condition
[luau]:- Exported
world:contains() - Exported
query:drain() - Exported
Query - Improved types for the hook
OnAdd,OnSet,OnRemove - Changed functions to accept any ID including pairs in type parameters
- Applies to
world:add(),world:set(),world:remove(),world:get(),world:has()andworld:query() - New exported type
Id<T = nil> = Entity<T> | Pair
- Applies to
- Changed
world:contains()to return abooleaninstead of an entity which may or may not exist - Fixed
world:has()to take the correct parameters
- Exported
0.2.2 - 2024-07-07
Added
- Added
query:replace(function(...T) return ...U end)for replacing components in place- Method is fast pathed to replace the data to the components for each corresponding entity
Changed
- Iterator now goes backwards instead to prevent common cases of iterator invalidation
0.2.1 - 2024-07-06
Added
- Added
jecs.Componentbuilt-in component which will be added to ids created withworld:component().- Used to find every component id with `query(jecs.Component)
0.2.0 - 2024-07-03
Added
- Added
world:parent(entity)andjecs.ChildOfrespectively as first class citizen for building parent-child relationships.- Give a parent to an entity with
world:add($source, pair(ChildOf, $target)) - Use
world:parent(entity)to find the target of the relationship
- Give a parent to an entity with
- Added user-facing Luau types
Changed
- Improved iteration speeds 20-40% by manually indexing rather than using
next()😱
0.1.1 - 2024-05-19
Added
- Added
world:clear(entity)for removing the components to the corresponding entity - Added Typescript Types
0.1.0 - 2024-05-13
Changed
- Optimized iterator
0.1.0-rc.6 - 2024-05-13
Added
- Added a
jecs.Wildcardterm- it lets you query any partially matched pairs
0.1.0-rc.5 - 2024-05-10
Added
- Added Entity relationships for creating logical connections between entities
- Added
world:__iter methodwhich allows for iteration over the whole world to get every entity- used for reconciling whole worlds such as via replication, saving/loading, etc
- Added
world:add(entity, component)which adds a component to the entity- it is an idempotent function, so calling it twice and in any order should be fine
Fixed
- Fixed component overriding when in disorder
- Previously setting the components in different order results in it overriding component data because it incorrectly mapped the index of the column. So it took the index from the source archetype rather than the destination archetype
[0.0.0-prototype.rc.3] - 2024-05-01
Added
- Added observers
- Added an arm to query
query:without()for chaining invariants.
Changed
-
Separates ranges for components and entity IDs.
- IDs created with
world:component()will promote array lookups rather than map lookups in thecomponent_indexwhich is a significant boost
- IDs created with
-
No longer caches the column pointers directly and instead the column indices which stay persistent even when data is reallocated during swap-removals
- This was an issue with the iterator being invalidated when you move an entity to a different archetype.
Fixedhttps://github.com/Ukendio/jecs/releases/tag/v0.0.0-prototype.rc.3
- Fixed a bug where changing an existing component would be slow because it was always appending changing the row of the entity record
- The fix dramatically improves times where it is basically down to just the speed of setting a field in a table
0.0.0-prototype.rc.2 - 2024-04-26
Changed
-
Optimized the creation of the query
- It will now finds the smallest archetype map to iterate over
-
Optimized the query iterator
- It will now populates iterator with columns for faster indexing
-
Renamed the insertion method from world:add to world:set to better reflect what it does.
0.0.0-prototype.rc.2 - 2024-04-23
- Initial release