42 m_MinTemps = {-3,-2,0,4,9,14,18,17,13,11,9,0};
51 m_MaxTemps = {3,5,7,14,19,24,26,25,18,14,10,5};
73 if (
g_Game.IsMultiplayer())
76 m_Weather.GetOvercast().Set(startingOvercast,0,5);
94 #ifdef WEATHER_DATA_LOGGING
97 g_Game.GetWorld().GetDate(startYear, startMonth, startDay, startHour, startMinute);
103 float phmnLength = 10;
122 #ifdef WEATHER_DATA_LOGGING
123 overcastChangeCount++;
126 float windDirection, windMag;
138 if (
m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
143 if (
m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
148 if (
m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
158 if (
m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
164 if (
m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
170 if (
m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
185 #ifdef WEATHER_DATA_LOGGING
197 #ifdef WEATHER_DATA_LOGGING
198 cloudyWeatherCount++;
209 #ifdef WEATHER_DATA_LOGGING
218 m_Weather.GetOvercast().Set( phmnValue, phmnTime, phmnLength );
226 Debug.
WeatherLog(
string.Format(
"Chernarus::Weather::Overcast:: (%1) overcast: %2",
g_Game.GetDayTime(), actual));
229 #ifdef WEATHER_DATA_LOGGING
235 g_Game.GetWorld().GetDate(testYear, testMonth, testDay, testHour, testMinute);
237 if ( testDay - startDay > currentDay && testHour - startHour >= 0 && testMinute - startMinute >= 0 )
240 FPrintln(file,
"================================================================");
241 FPrintln(file,
" ================== Day " + (currentDay + 1) +
" ================== ");
242 FPrintln(file,
"================================================================");
243 FPrintln(file,
"Overcast Change Count: " + overcastChangeCount);
244 FPrintln(file,
"Bad Weather Change Count: " + badWeatherCount);
245 FPrintln(file,
"Cloudy Weather Count: " + cloudyWeatherCount);
246 FPrintln(file,
"Clear Weather Count: " + clearWeatherCount);
250 if ( currentDay == daysToRun )
255 overcastChangeCount = 0;
257 cloudyWeatherCount = 0;
258 clearWeatherCount = 0;
267 float actualOvercast =
m_Weather.GetOvercast().GetActual();
277 Debug.
WeatherLog(
string.Format(
"Chernarus::Weather::Rain::ForceEnd:: (%1) %2 -> 0",
g_Game.GetDayTime(), actual));
287 m_Weather.GetRain().Set( phmnValue, phmnTime, phmnLength );
288 Debug.
WeatherLog(
string.Format(
"Chernarus::Weather::Rain::ForceStorm:: (%1) %2 -> %3",
g_Game.GetDayTime(), actual, phmnValue));
293 if ( actualOvercast < 0.75 )
348 m_Weather.GetRain().Set( phmnValue, phmnTime, phmnLength );
359 float fogTime = 1800.0;
363 if ( fogyMorning > 0.85 )
365 if ( (
g_Game.GetDayTime() > 4 &&
g_Game.GetDayTime() < 7 ) )
373 if (
m_Weather.GetOvercast().GetActual() < 0.3 )
468 protected override void CalculateVolFog(
float lerpValue,
float windMagnitude,
float changeTime)
470 float distanceDensity, heigthDensity, heightBias;
471 int year, month, day, hour, minute;
472 g_Game.GetWorld().GetDate(year, month, day, hour, minute);
474 if ( hour < 9 && hour >= 5 )
476 distanceDensity =
Math.
Lerp( 0.015, 0.05, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
477 heigthDensity =
Math.
Lerp( 0.8, 1, lerpValue);
479 heightBias =
m_Weather.GetDynVolFogHeightBias();
489 else if (diceRoll < 85)
499 else if ( hour < 18 && hour >= 9 )
501 distanceDensity =
Math.
Lerp( 0.01, 0.05, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
502 heigthDensity =
Math.
Lerp( 0.9, 1, lerpValue);
507 distanceDensity =
Math.
Lerp( 0.01, 0.03, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
508 heigthDensity =
Math.
Lerp( 0.9, 1, lerpValue);
512 m_Weather.SetDynVolFogDistanceDensity(distanceDensity, changeTime);
513 m_Weather.SetDynVolFogHeightDensity(heigthDensity, changeTime);
514 m_Weather.SetDynVolFogHeightBias(heightBias, changeTime);