News for hackers. Stuff that matters.
Re:Show HN: A Clojure game library by willismichael on Monday January 20, 2014 @01:35PM (#7091035)
One way that I prototyped a component-entity system that worked well for quick lookups was more like this:

  {:health   {entity-id-1 32
              entity-id-2 23}
   :location {entity-id-1 [32 16 7]
              entity-id-2 [33 13 7]}
   ... more stuff ...}
So the entity data structure is organized first by component tag, then by entity id. I've heard this referred to as "inside-out objects". That way functions can quickly query things like "find all entities that have a location" or "find all entities that are poisoned". The downside is that there isn't a convenient way to atomically update multiple components of a single entity.
Re:Show HN: A Clojure game library by Morgawr on Monday January 20, 2014 @01:40PM (#7091058)
Yes, that's exactly how my ClojureScript prototype worked, the problem is that it wouldn't allow me to use concurrent entities. (Although you could use refs for tag-types instead of individual entitites... an interesting approach nonetheless)