I have a question of optimisation.
I want to write a function that picks up a random player built entity on the whole map, with a true random pattern (I mean : giving the same chance to any part of the map).
Of course, I want this function to be quicker as possible...
Complication (in a second time) : player built entity could be in other forces that the basic "player" force. So how to filter what is player built ?
We could use surface.get_chunks() and then surface.find_entities() but it always parse the chunks in the same order, and it could be quite CPU consuming on a big map...
Any ideas, my mod' brothers ?
