iacobson
ECSpanse - an Entity Component System framework for Elixir
ECSpanse

Ecspanse is an Entity Component System (ECS) framework for Elixir.
Ecspanse is not a game engine, but a flexible foundation for managing state and building logic, with features like:
- flexible queries with multiple filters
- dynamic bidirectional relationships
- versatile tagging capabilities
- component templates
- system event subscriptions
- asynchronous system execution
Docs: Ecspanse — ECSpanse v0.10.1
GitHub: GitHub - iacobson/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. · GitHub
Article: https://iacobson.medium.com/elixir-for-fun-ecspanse-2852a7993ecd
Podcast: ECS / Game Development with Elixir vs. Python, JavaScript, React with Dorian Iacobescu & Daniel Luu | SmartLogic
Most Liked
stwf
OK. Finally got something I’m ready to show.
My game is an attempt at a Kriegsspiel. A 19th century wargame that emphasized realistic issues that came up in battle. Mine at least will try to take into account proper size scales, lines of supply and communication, how long orders take to arrive, and be executed, etc
I’ve got the hex map editor working and have basic movement and some commands working. Next up will be line of sight for identifying enemy units, and Scouts bringing back delayed observations of enemy units. That sort of thing. Then battle!
So it’s been fun and a good learning experience if nothing else! I’ll be happy to open up the code if there someone other than me interested in this sort of thing…
Steve
iacobson
For whoever is interested, I’m invited to this Elixir Wizards podcast episode discussing ECS and Ecspanse: ECS / Game Development with Elixir vs. Python, JavaScript, React with Dorian Iacobescu & Daniel Luu | SmartLogic
iacobson
Thanks. I think Ecspanse and ECSx try to solve the same “problem” but in different ways. I even mentioned ECSx as an alternative to Ecspanse in my Medium article.
Still, to try to answer your question, I think ECSx is more straightforward to get started with. You have generators and every component holds a single value. You can then query the individual components by their entity ID or as a list. But I think their guides section explains it better than I could.
On the other hand, Ecspanse has a bit more complicated approach, but I would say also offers more flexibility as the game becomes more complex. I would mention just a few of them:
- complex queries across multiple components, entities, and relationships
- out-of-the-box bidirectional entities relationships to make it easy to work with trees of entities, but especially with collections
- component templates and tags - to handle component collections and polymorphism.
You can find some more details and examples in the Medium article.










