47 m_MinTemps = {-7,-7.4,-4.1,1.5,7,11.3,20.4,19.1,18,5.3,0.8,-3.6};
56 m_MaxTemps = {-2.5,-2.1,2.3,9,15.5,19.4,25,22,21,10.5,4.2,0.1};
78 if (
g_Game.IsMultiplayer())
81 m_Weather.GetOvercast().Set(startingOvercast,0,5);
140 #ifdef WEATHER_DATA_LOGGING
143 g_Game.GetWorld().GetDate(startYear, startMonth, startDay, startHour, startMinute);
149 float phmnLength = 10;
152 int year, month, day, hour, minute;
153 g_Game.GetWorld().GetDate(year, month, day, hour, minute);
166 #ifdef WEATHER_DATA_LOGGING
167 overcastChangeCount++;
170 float windDirection, windMag;
182 if (
m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
187 if (
m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
193 if (
m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
204 if (
m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
211 if (
m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
218 if (
m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
225 if (
m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
240 #ifdef WEATHER_DATA_LOGGING
252 #ifdef WEATHER_DATA_LOGGING
253 cloudyWeatherCount++;
269 #ifdef WEATHER_DATA_LOGGING
275 #ifdef WEATHER_DATA_LOGGING
284 #ifdef WEATHER_DATA_LOGGING
300 m_Weather.GetOvercast().Set( phmnValue, phmnTime, phmnLength );
314 Debug.
WeatherLog(
string.Format(
"Enoch::Weather::Overcast:: (%1) overcast: %2",
g_Game.GetDayTime(), actual));
317 #ifdef WEATHER_DATA_LOGGING
323 g_Game.GetWorld().GetDate(testYear, testMonth, testDay, testHour, testMinute);
325 if ( testDay - startDay > currentDay && testHour - startHour >= 0 && testMinute - startMinute >= 0 )
328 FPrintln(file,
"================================================================");
329 FPrintln(file,
" ================== Day " + (currentDay + 1) +
" ================== ");
330 FPrintln(file,
"================================================================");
331 FPrintln(file,
"Overcast Change Count: " + overcastChangeCount);
332 FPrintln(file,
"Bad Weather Change Count: " + badWeatherCount);
333 FPrintln(file,
"Sudden Change Count: " + suddenChangeCount);
334 FPrintln(file,
"Storm Count: " + stormCount);
335 FPrintln(file,
"Sudden Storm Count: " + suddenStormCount);
336 FPrintln(file,
"Cloudy Weather Count: " + cloudyWeatherCount);
337 FPrintln(file,
"Clear Weather Count: " + clearWeatherCount);
341 if ( currentDay == daysToRun )
346 overcastChangeCount = 0;
347 suddenChangeCount = 0;
349 suddenStormCount = 0;
351 cloudyWeatherCount = 0;
352 clearWeatherCount = 0;
361 float actualOvercast =
m_Weather.GetOvercast().GetActual();
371 Debug.
WeatherLog (
string.Format(
"Enoch::Weather::Rain::ForceEnd:: (%1) %2 -> 0",
g_Game.GetDayTime(), actual));
390 m_Weather.GetRain().Set( phmnValue, phmnTime, phmnLength );
391 Debug.
WeatherLog(
string.Format(
"Enoch::Weather::Rain::ForceStorm:: (%1) %2 -> %3",
g_Game.GetDayTime(), actual, phmnValue));
396 if ( actualOvercast < 0.75 )
451 m_Weather.GetRain().Set( phmnValue, phmnTime, phmnLength );
459 if (( hour >= 2 ) && ( hour <= 5 ))
553 protected override void CalculateVolFog(
float lerpValue,
float windMagnitude,
float changeTime)
555 float distanceDensity, heigthDensity, heightBias;
556 int year, month, day, hour, minute;
557 g_Game.GetWorld().GetDate(year, month, day, hour, minute);
559 if ( hour < 6 && hour >= 3 )
561 heightBias =
m_Weather.GetDynVolFogHeightBias();
579 distanceDensity =
Math.
Lerp( 0.01, 0.03, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
580 heigthDensity =
Math.
Lerp( 0.9, 1, lerpValue);
584 distanceDensity =
Math.
Lerp( 0.5, 0.1, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
585 heigthDensity =
Math.
Lerp( 0.2, 1, lerpValue);
588 else if ( hour < 18 && hour >= 6 )
590 distanceDensity =
Math.
Lerp( 0.01, 0.05, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
591 heigthDensity =
Math.
Lerp( 0.9, 1, lerpValue);
596 distanceDensity =
Math.
Lerp( 0.01, 0.03, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
597 heigthDensity =
Math.
Lerp( 0.9, 1, lerpValue);
601 m_Weather.SetDynVolFogDistanceDensity(distanceDensity, changeTime);
602 m_Weather.SetDynVolFogHeightDensity(heigthDensity, changeTime);
603 m_Weather.SetDynVolFogHeightBias(heightBias, changeTime);