Michi_cc wrote:In fgw_05_checkconflictindustry-for-large-maps.patch, is the 14 in your addition the same 14 as in the existing code below or just coincidental? How did you determine dmax * dmax * 2, empirically or something else? (Also applies to closest town.) A few more comments might be nice

In the case where nr towns = very low and nr industries = high, there is too
much industry conflicts, thus industry generation time is very long. I think it
could be prevented right from the World Generation interface but it would be a
new patch. If nr towns = very low, nr industries should not be more than normal.
That being said, dmax*dmax*2 is an error since I initially wanted the number of
tiles in the considered zone. It should have been dmax*dmax*4. But the average
time for 1 iteration in zone check is shorter in such a way that the *2 error
somehow balances things out.
In CheckIfFarEnoughFromConflictingIndustry(), the value of 14 is indeed the same
one specified for DistanceMax().
In CalcClosestTownFromTile(), I chose 50 from observation. But observation only
with nr towns = normal. So I reworked this part to be more context relevant and
it seems to work well on the few maps I tested (not all square maps).
The 2 "radius*radius*2" thresholds could certainly be refined but I don't think
there is much to gain though (it's 4am, I admit a bit of laziness on this one).