I am trying to use an ECS for my 2d game at the moment. Up until now I had my world subdivided into chunks (as minecraft does) of size 64x64. They are loaded and drawn when they come onto screen. I did this to reduce the drawing calls.
How would something like this work in an ECS?
I would say my Chunks have the following properties at the moment: tile_is_water[64,64], humidity[64,64], sprite_batch
(the thing that is drawn)
At some intervals I will need to call some kind of updatefunction which uses tile_is_water and humidity to generate a new sprite_batch (but not very often, these change rarely). On every frame I need to draw the sprite_batch. On every (or maybe every few) frame I need to check which areas are visible and set some kind of flag s.t. I only draw the visible ones.
It would help me a lot of someone could explain to me what the components, the entities and systems would be in this case.
Edit: To clarify. I don't have this modelled as an ECS yet and I have problems modelling this particular issue. What I have until now is just seperated everything into components: Components: Is_Water_Area, HumidityArea, SpriteBatch Is_Water_Area and HumidityArea just contain the corresponding 64x64 arrays and sprite_batch contains the drawable spritebatch. I also have a BatchDrawer system that draws everything that has a SpriteBatch. But where do I do the updating of the SpriteBatch for example? Where do I check which areas are drawn?
For example I could just check this every frame or I could keep a list of drawable Areas and update that. But where would I keep such a list of the drawable areas?