Hot answers tagged

3

You may be falling into a common trap. Entity component systems are very neat and useful, but they shouldn't be used for everything. Simply add an Information component to your entities that contains, among other information, their empire affiliation. This component can be utilized by lots of other systems, including the whatever Combat system you have. ...


2

Here's an example system that deletes all entities with the "Expires" component: public class DeleteEntitiesSystem extends EntitySystem { public DeleteEntitiesSystem() { super(Aspect.getAspectForAll(Expires.class)); } @Override protected void processEntities(Array<Entity> entities) { for (Entity e : entities) { ...


2

Each system in Artemis has a function called process, the process function in the RenderSystem looks like this: @Override protected void process(Entity e) { Spatial spatial = spatials.get(e.getId()); Transform transform = transformMapper.get(e); if (transform.getX() >= 0 && transform.getY() >= 0 && transform.getX() < ...


2

There is no need to separate network reading from writing. It's pretty common to have some asynchronous process that reads from sockets in a non-blocking manor and checks whether there is data to send and transmits it when there is. In fact, my network code in C++ uses a boost::asio::io_service in conjunction with a thread pool of approximately 4-5 ...


Only top voted, non community-wiki answers of a minimum length are eligible