iacobson

iacobson

ECSpanse - an Entity Component System framework for Elixir

ECSpanse

logo_small

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

First Post!

iacobson

iacobson

New release v0.2.0

Introduces Component and Event Templates for simplifying the creation of related components and events.

Adds a new query Ecspanse.Query.fetch_tagged_component/2 that returns an entity’s component by a list of tags. Attention, it is the logic implementation duty to ensure that no more than one component is returned, or it will raise an error.

Introduces also some small breaking changes: the Timer Component and Event are now Templates.
use Ecspanse.Component.Timer and use Ecspanse.Event.Timer should be replaced with use Ecspanse.Template.Component.Timer and use Ecspanse.Template.Event.Timer.

Most Liked

stwf

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

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

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:

You can find some more details and examples in the Medium article.

Last Post!

stryderjzw

stryderjzw

Doh! That makes more sense. ID should be on the Entity, not the Component.

Much appreciated. :smile:

Where Next?

Popular in Announcing Top

kelvinst
Hey everyone! Well, we made this lib a while ago and now we decided to finally go out and public with it! It’s a tool for creating and m...
New
danschultzer
In short Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
bryanjos
Hi, I wanted share a small library we at Revelry Labs made for rendering react components from the server side. There are instructions fo...
New
josevalim
Hi everyone, We would like to announce that Plataformatec is working on a new MySQL driver called MyXQL. Our goal is to eventually integ...
New
devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: GitHub - devonestes/assertions: Helpful a...
New
mathieuprog
Hello :waving_hand: Allow me to introduce you to Tz, an alternative time zone database support to Tzdata. Why another library? First a...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42576 114
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement