ecspanse

Entity Component System (ECS) library for Elixir, offering a suite of features including: flexible queries with multiple filters, dynamic bidirectional relationships, versatile tagging capabilities, system event subscriptions, or asynchronous system execution.

APACHE-2.0 License

Downloads
1.2K
Stars
62
ecspanse - v0.9.0 Latest Release

Published by iacobson 7 months ago

Breaking

  • removes Ecspanse.Resource.State in favor of Ecspanse.State functionality.

Features

  • allows inserting resources at startup with Ecspanse.insert_resource/2
  • allows state init at startup with Ecspanse.init_state/2
  • introduces Ecspanse.State state functionalities. See the breaking changes for more details.
  • new library built-in Ecspanse.Event.StateTransition event
  • new library built-in Ecspanse.Component.Name component

Improvements

  • Ecspanse.Query.entity_exists?/1 to check if an entity still exists
  • Ecspanse.Command.add_and_fetch_component!/2 wrapper to return a component after creation
  • Ecspanse.Command.update_and_fetch_component!/2 wrapper to return a component after update
ecspanse - v0.8.1

Published by iacobson 10 months ago

Improvements

  • returns an explicit error message when trying to run queries or create events and the Ecspanse server is not running.
  • documentation improvements.
ecspanse - v0.8.0

Published by iacobson 11 months ago

Improvements

  • refactor the Ecspanse.Projection to include the state of the projection
    • the projection result is now wraped in a Ecspanse.Projection{} struct, together with the projection state.
    • the c:Ecspanse.Projection.project/1 callback returns now the projection state as well as the projection result.

Breaking

  • the Projection.run?/2 callback has been removed. The functionality is now handled by the c:Ecspanse.Projection.project/1 callback, by returning :halt.
  • the c:Ecspanse.Projection.project/1 callback should now return also the state of the projection. See the documentation for more details.
  • the c:Ecspanse.Projection.on_change/3 callback takes as second and third argument the t:Ecspanse.Projection.t/0.
  • the c:Ecspanse.Projection.get!/1 callback now returns a t:Ecspanse.Projection.t/0.
ecspanse - v0.7.3

Published by iacobson 11 months ago

Improvements

  • implement the c:Ecspanse.Projection.run?/2 optional callback to run projections conditionally.
ecspanse - v0.7.2

Published by iacobson 12 months ago

Improvements

  • c:Ecspanse.Projection.on_change/3 is called on Projection server initialization.
ecspanse - v0.7.1

Published by iacobson about 1 year ago

Improvements

  • Ecspanse.Command.clone_entity!/2 and Ecspanse.Command.deep_clone_entity!/2 now accept an :id option to set the id of the cloned entity.
ecspanse - v0.7.0

Published by iacobson about 1 year ago

Breaking

  • Ecspanse.Projection.on_change/3 replaces the on_change/2callback and now takes both the new projection as well as the previous projection as arguments.

Improvements

  • updating projections after all frame systems have run to return a consistent state.
ecspanse - v0.6.0

Published by iacobson about 1 year ago

Features

  • introduces Ecspanse.Projection to build state projections across entities and components.
ecspanse - v0.5.0

Published by iacobson about 1 year ago

Features

  • introducing ancestors queries to query for parents of an entity, the parents of parents, and so on:
    • Ecspanse.Query.select/2 new option: :for_ancestors_of
    • Ecspanse.Query.list_ancestors/1
    • Ecspanse.Query.list_tagged_components_for_ancestors/2
ecspanse - v0.4.0

Published by iacobson about 1 year ago

Breaking

  • removed the automatically generated events: Ecspanse.Event.{ComponentCreated, ComponentUpdated, ComponentDeleted, ResourceCreated, ResourceUpdated, ResourceDeleted}. Use custom emitted events or short-lived components instead.

Improvements

  • improved performance for tagged components. The system loop now runs faster when dealing with tagged components.
ecspanse - v0.3.1

Published by iacobson about 1 year ago

Fixes

  • fixes a bug where events could be scheduled after they were batched for the current frame, and before the current events are cleared, causing some events to be lost. Thanks to @andzdroid for identifying and documenting the issue.
  • fixes a bug where temporary timers would crash. Thanks to @holykol for finding and fixing the issue.

Features

  • imports Ecspanse.Query and Ecspanse.Command in all systems, so all the queries and commands are available without needing the respective module prefix.
  • imports Ecspanse in the setup module that use Ecspanse so the system scheduling functions are available without needing the module prefix.
ecspanse - v0.3.0

Published by iacobson about 1 year ago

Features

  • add a new query Ecspanse.Query.list_tags/1 to list a component's tags.
  • add a new query Ecspanse.Query.list_components/1 to list all components of an entity.
  • add a new command Ecspanse.Command.clone_entity/1 to clone an entity without its relationships.
  • add a new command Ecspanse.Command.deep_clone_entity/1 to clone an entity with its descendants.
ecspanse - v0.2.1

Published by iacobson about 1 year ago

Fixes

  • batch all events only by batch_key to avoid race conditions for different events processed by the same system.
ecspanse - v0.2.0

Published by iacobson about 1 year ago

Breaking

  • use Ecspanse.Component.Timer and use Ecspanse.Event.Timer are now deprecated.
    Use use Ecspanse.Template.Component.Timer and use Ecspanse.Template.Event.Timer instead.

Features

  • introducing Ecspanse.Template.Component and Ecspanse.Template.Event to simplify the creation of related components and events.
  • add a new function Ecspanse.Query.fetch_component/2 to fetch a system's component by a list of tags.
ecspanse - v0.1.2

Published by iacobson about 1 year ago

Fixes

  • remove unneeded dependency plug_crypto
  • upgrade dependencies: credo, ex_doc, jason
  • fix documentation
ecspanse - v0.1.1

Published by iacobson about 1 year ago

  • adds missing :package to the mix file
ecspanse - v0.1.0

Published by iacobson about 1 year ago

The initial release