entity system questions
If i make a separate system, My understanding is a scan would be performed on all entities with sensors, but not every entity may require information about what's around them every tick
The sensor component could contain the frequency at which the sensor update should be processed for that entity.
then there's also the requirement of giving this info to other systems like AI.
Your sensor scan system could look at the sensor data for each component, "process it", and place any results back in the sensor component (e.g. the other entities that it sees).
Or, other systems could have a reference to the sensor scan system in order to perform queries on it. But, if you're caching the results of that data, it's got to go somewhere. It could be contained in the sensor scan system, or... may as well just put it in the sensor component.
I'm having similar problems with figuring out how to implement special game events such as entering a specific sector playing a cut scene, or having gates bringing players to a completely new sector; should these 2 things be represented as an entity?
I'm having similar problems with figuring out how to implement special game events such as entering a specific sector playing a cut scene, or having gates bringing players to a completely new sector; should these 2 things be represented as an entity?
If your sector has a collider component, when new entities collide with it (aka enters the sector), the collision system informs other systems of said event. Your CutSceneSystem may be interested in collisions between Sectors and Entities and if such a collision event is raised, it gets the current sector id/name, locates the cutscene files and begins their playback for the user experience. In this case, its a combination of the Physics System and a Game System interacting by way of events/messages/callbacks.
As for gates taking players to new sectors, this again is basically a collider component in the ECS that raises a collision event that causes your SectorTeleportSystem to fire. It begins by playing a wormhole warp cutscene sequence while the new sector is loaded from disk. After loading is complete the cutscene sequence ends and you find yourself in the new sector.
As phil_t said, some systems can respond to game world events/triggers but are not necessarily manipulating entities. The events/triggers they do react to however can very much be something that the entity component system triggered based on some component system that manages a particular game aspect.
… then there's also the requirement of giving this info to other systems like AI. ...
Notice please that systems need not to be active. Sensors are a good example for a passive system. Reasons are (a) that the AI state determines whether and which sensor data is needed in the current run, and (b) that computing sensor data is often a relatively costly process. So instead of letting the sensor system run on its own, implement it as interface where other systems can send queries to.
Example: Attaching a VisualSensor component to an entity defines that the entity is able "to look". The component's data specify the view volume (e.g. a cone with diameter at its base, its heigh, and a direction). Another component, say the VisualStimulus component, specifies the volume and visibility (in the meaning of cloaking and such) of an entity if attached. These data are managed by a VisualSense system. The interface of the system allows to query for all entities belonging to a VisualStimulus that intersects the VisualSensor volume of a given entity.