Trying to arrange a pool of data accessable by multiple entities.

This is a simple question, relating to The Entity Component System.

In a nutshell, i have a use case which has ecs managing thousands of objects which are never visible to the player directly, and, as such, do not need rendering, or even to be moved every frame, so i wanted to set up a situation where i could tell a system to only process a certain number of entities of a certain type per frame.

I have succeeded in getting an entity to correctly time itself, and track being moved once every 3 seconds, however with no access to other entities timers, i am unable to stagger them.

All i need is to figure out a way to get a global int value into the burst compiled code which refuses to access a static class directly or anything similar.

Please be aware, i am new to ecs, rather than asking for my code, please answer this question…

“How can entities share a counter and react to the counter together?”

Thanks!
[Edit]
To clarify, the very specific description is, i want to process a fixed number of the objects per frame, then, next frame, process the next few objects, so i suppose its possible to set up some system to dictate and calculate just this? the only way i can think of would be to have that system iterate all these entities, count a few whose timers are over 3 seconds, then tell the rest to keep counting whether they’ve hit 3 or not… So i guess i could make that system set a bool on my moverdata and be sequenced before the mover, but that seems overcomplicated.

Any ideas would help :slight_smile:

[Edit2]
Usually, an answer with a code snippet is invaluable, but due to the nature of ecs being a new system (to me) i think an answer without code snippets might be better, as its the concepts i need, and i wont learn much if its just given to me wrapped in a bow :slight_smile:

Good night,

first I have to say I never tried it but it might an idea. I would use the chunkComponent for last update intervall or so. In your job which is probally an IChunkJob you will check on every chunk if the chunk needs to be calculated yet or not by reading the time from the chunkComponent.

The good thing is you have then a timer behavior but on chunk bases which should be way less checks and early enought to return an save a lof of process time in this frame.

I have now, a very simple system that runs first before everything else, and all it does, is iterate each chunk, finding the member with the highest timer, and skipping the rest. Then, it sets a timer component, which contains only a boolean, to true, telling it to process that ship this turn. Then, the other systems are not running every frame on every entity, but only on those which have had their timer boolean modified. So, when they are skipping, they never even enter the jobs of the later systems.

That being said… I didnt find a way to add a static data, only a way to solve the original poblem without it.