I may have misunderstood the code but it seems to me that the new way of generating wind direction and power is very strange or even simply wrong and changes dramatically how wind works ingame.
With the old formula the wind power generated was uniformly distributed between minWind nad maxWind.
Now with the new formula I see a few issues:
Code: Select all
do {
newWind.x -= (gs->randFloat() - 0.5f) * maxWind;
newWind.z -= (gs->randFloat() - 0.5f) * maxWind;
len = newWind.Length();
} while (len == 0.f);
There seems to be "*2" missing in the formula.
Now the length generated is NOT in range of [minWind, maxWind] which I assume it should be, but instead it is in range [0, maxWind*sqrt(2)].
Now look at the code below:
Code: Select all
len = Clamp(len, minWind, maxWind);
This all seems quite wrong to me and I figured that is probably unintented so I decided to post this.
This is quite a huge issue since it may affect balance of mods with wind focused economy quite a lot.