After 2.5 years of using it from git master, I’m now finally committed enough to publish an update for the venerable ECS package.
The major highlights are:
- Internals simplified to just being a ReaderT over the generated World record, shedding some dependencies in the process.
- Storage initialization may use arbitrary constraints/contexts besides MonadIO. They’re collected and fed automatically into the resulting initWorld function.
- An answer for the most frequent newcomer question: “How do I really, really delete an Entity so that absolutely nothing remains? And no, I can’t be bothered with making archetype aliases.”
- With the new TH helper:
makeWorldDestructible, thendestroy ety @WorldDestructible. - (It’s a type alias generator that gives you a tuple-of-tuples that just visits every store one by one and asks them to remove the data for that entity.)
- With the new TH helper:
- An entirely new facility that goes against all the core
apecsprinciples
: component tags and component-tagged values.
- Another TH helper:
makeWorldEnumerablethat, when used with the new explMemberSet method, will give you anIntSetof all entities in the world. - Now you can make a generic world editor UI or derive one from the components you use.
- Or run component population and “archetype-like” census to spot optimizations.
- Or run a diff on what’s changed in the current tick.
- Or dump the whole dumpable world to console or a file.
- Another TH helper:
apecs-stm is back on track. After many experiments to find its niche, it has been reduced to the 3 STM-capable stm-container-backed stores. Bespoke EntityCounter and makeWorld are gone, and the stores are renamed to avoid clashing with IO-bound originals. That means you can deploy the atomic/transactional stores only where it matters and keep the rest in IO for performance.