Coming from web development (this is my daytime job), I try to build a simple 4X game prototype as a hobby. It appears to be harder as I thought...
I want to use Entity-Component-System architecture for this. Never worked with such a paradigme, it seemed great.
I've quicly built a CLI interface game with planets graviting on sun. The player can build factories on those planets and from factories they build vessels that they can move around the star system.
For now, it works. The problem is that all entities belongs to a global entityManager and I can't find a way to split them between several players entity (think of "empires", "races" or whatever). I have a gameInput system that gives order ("build a factory on this planet", "move this vessel"). But I can't see a clean way to restrict those order to a set of entities that would represent a player side. Thus, I have no way of telling if an entity belongs to a given empire.
I though I could have several entityManager, each one handling an empire's entities. Or having an "empire" component that would hold a list of entities belonging to this empire. But none of these solution appeals me.
How would you do that ?
Thanks.