Computing model explanation
This document explains the Aether Engine computing model.
An Aether Engine simulation consists of one or more processes that handle simulation occurring in a particular region of physical space. Entities simulated within this space possess a position and state defined by the Aether Engine library user.
Each region of space is defined as a cell and managed by an Aether Engine process, also referred as a worker. It is not required that cells being simulated are physically adjacent.
Should an entity move into a region not currently assigned to an Aether Engine worker, a new one will be created. Similarly, Aether Engine workers will be deallocated if they no longer have any entities to simulate. Should a worker contain too many entities to simulate effectively, it will split its region of authority, enabling entity computations to be handled by a different worker.
Entities require visibility of each other if they are to interact. While those in the same worker are immediately aware of one another, they cannot see any further. To solve this, during a handover, they are mirrored from other cells into the worker. We refer to these mirrored entities as ghost entities
It is only possible for an Aether Engine worker to modify the state of entities located in the region of space it manages.
During a handover, each entity is assigned a bounding box, determining which workers will be made aware of it. The bounding boxes differ on a case by case basis; for example, larger entities may need to be seen or interacted with at further ranges than smaller ones.
Currently in Aether, an entity a can see an entity b if either of the following two conditions are met:
- Entities a and b are located within the same cell.
- Entity b's bounding box covers any region of the cell in which entity a is located.
In future, these conditions will be defined to correspond to a more intuitive notion of visibility that does not depend upon cell size.
In the diagram above, bounding boxes are denoted by dashed lines. The large red entity is visible to entities in all four cells but can only see the entities located in the cells managed by workers 1-3.
Every tick, a function is executed to update the state of all entities within each cell. This function may update the state of each entity, including its position. Should an entity be moved outside its current cell, it will be transferred to the appropriate cell (creating a new cell if necessary) by the next tick.
The only requirements Aether Engine places on an entity is that it has a physical position. This requirement is necessary to enable Aether Engine to decide which cell contains each entity. Aether Engine only requires that an entity is capable of providing its position using integer co-ordinates. Using integer co-ordinates ensures that Aether Engine is capable of deciding in which cell an entity is located reliably, since floating point arithmetic is avoided. This does not constrain entities using floating point arithmetic for their position representation (and all existing Aether Engine demos do this). Since Aether Engine only partitions a simulation on integer co-ordinate boundaries, it does not require knowledge of fractional co-ordinates.
Aether Engine does not require that an entity have a given size, mass or other physical properties. Such properties can be added by the Aether Engine user to the entity state, and behaviour added for entities that take account of these properties.