Skip to content
junkdog edited this page Sep 21, 2014 · 28 revisions

A system is typically an implementation that iteratively operates on a group of entities that share common components (typically EntityProcessingSystem), or just general game logic (typically VoidEntitySystem).

Available systems

Artemis provides several abstract classes to base your Systems on.

When to use entity systems

If you have an active process you need to model, or If you need to step over entities that match a certain component profile, implement it as an EntityProcessingSystem, VoidEntitySystem, or any of the other systems.

If you need to serve or organize objects and assets (components, entities, fonts, graphics, sounds) for Systems, use managers instead.

Utility methods can be implemented as either managers or void entity systems.

Initialize systems

world = new World();
world.setSystem(new MyCustomSystem1());
..
world.setSystem(new MyCustomSystemN());
world.initialize();

Update loop

Your registered systems are called in whatever order you added them to the world each time you run:

world.setDelta(float delta)
world.process()

Entity events

Systems are never immediately informed of created, altered or removed entities. Instead the change is delayed until World#process() is called, or just before the next system runs. Entity state changed performed inside EntitySystem#begin won't be reflect in the current system until the next time it's processed.

Prior to 0.7.0, a call to Entity#changedInWorld() or Entity#addToWorld() is required to update all the system entity subscription lists. In 0.7.0, calling Entity#edit() schedules this update automatically.

Inter-system communication

Systems can communicate with other systems. Retrieve other systems via @Wire. You can define whatever methods you deem necessary for inter-system communication.

Manually initialize aspects of your system by overriding the Initialize method.

Suspending processing

Override checkProcessing to return false if you want to suspend system processing.

Entity notifications

You can override added and removed methods in each system. There you will be notified about entities that were either added into or removed from the system.

Clone this wiki locally