amethyst
amethyst copied to clipboard
Have some method of creating global systems that can work on collections of entities with attributes
More akin to classic ECS systems like Global Actors, good for things like Field of View as it means you don't have to have a special case for the player, because you can loop through everything that has a Vision attribute.
Right now FOW in Caves of Zircon has a World Entity that deals with FOW. Having some kind of Global System would be more representative of reality.
Additionally, the FOW Entity also has to use a reference to a player Entity in order to get its Vision attribute. This means the player is being special cased vs other things with a Vision attribute. It would be better for FOW to be a global system that had access to all entities of a given type.
A possible solution would be for the Engine to use commands to send AddEntity and RemoveEntity. Then have global systems like FOW respond to those commands in order to keep a list of what entities have the attributes they care about.
Two potential ways to do this is to keep a list of systems, and pass the AddEntity and remove entity commands to those systems.
Alternatively those commands could be passed to every Entity. Which is more flexible but now adding entities would get more expensive the more entities there are regardless of how many listeners there are. This could be adjusted by only calling entities that care about a given message. Not sure how the engine would know which entities have which Facets though.
@BobG1983 can you elaborate on this issue? I'm planning to code the next release of Amethyst (for the refurbished Caves of Zircon tutorial) and I'm not sure I understand this issue properly.