I have VertexArray holding mapSize of 50x50 that type is sf::PrimitiveType::Quads the size is 10,000
Break your world into chunks, lets say 400x400 blocks. Each chunk/block will get one vertex array. Then you can simply draw only the chunks that are in a visible area of the current view.
Unit VertexArray is holding ~50 units that type is sf::PrimitiveType::Quads and their position is at start pretty predictable but it gets chaotic as time passes because they move randomly so i have no idea how to achieve culling on them.
For only 50 units? That is only 200 vertices. A single 3D model can easily have more than this. It is not worth implementing culling for such a small vertex array. Just keep drawing the entire array until performance becomes an issue.
ID separate units intro objects that hold those 400x400 as well so i keep collision and other interactions up to speed.
I counted of making main map 500x500size and the separation to 400x400 seams a great idea
thx!
The most units i had on screen with auto movement logic was 20,000-25,000 depends on my pc so id max it to 10k because i want to implement more complex AI for them.
That being said i do not want to loop logic for all units but maybe 2-3 regions around my player.
so one region is 400x400. I do not how to efficiently manage units intro these regions, i am thinking of having a sf::Vector<Unit*> that is in this vector when unit leaves the region it gets removed from leaving region and gets added to entering region that is the best idea i have at top of my head right now.
I was thinking and looking for some hard solution when just separating like you suggested sound so easy and perfect...
Simple is best