mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Wind & Turbulence updates from Liberation
Tune turbulence values. Modify the range of values used to choose a wind speed. Wind speed at high elevation IRL can range from 20 to 160 knots around the globe. You may see wind speed generated here up to 100+ knots, but generally around 40 or so. IRL wind speed appears to depend on the latitude of the sun, not in this implementation. Note increased wind speeds in the changelog. Limit wind speed to 97 knots. Made minor adjustments to wind speed calculation. Calculate turbulance. Turbulance is based off time of day, and day of year. Each theatre may adjust their turbulance parameters. Spell turbulence correctly.
This commit is contained in:
@@ -45,4 +45,9 @@ class SeasonalConditions:
|
||||
winter_avg_temperature: float
|
||||
temperature_day_night_difference: float
|
||||
|
||||
high_avg_yearly_turbulence_per_10cm: float
|
||||
low_avg_yearly_turbulence_per_10cm: float
|
||||
solar_noon_turbulence_per_10cm: float
|
||||
midnight_turbulence_per_10cm: float
|
||||
|
||||
weather_type_chances: dict[Season, WeatherTypeChances]
|
||||
|
||||
@@ -57,6 +57,23 @@ class SeasonData:
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TurbulenceData:
|
||||
high_avg_yearly_turbulence_per_10cm: float | None
|
||||
low_avg_yearly_turbulence_per_10cm: float | None
|
||||
solar_noon_turbulence_per_10cm: float | None
|
||||
midnight_turbulence_per_10cm: float | None
|
||||
|
||||
@staticmethod
|
||||
def from_yaml(data: dict[str, Any]) -> TurbulenceData:
|
||||
return TurbulenceData(
|
||||
data.get("high_avg_yearly_turbulence_per_10cm"),
|
||||
data.get("low_avg_yearly_turbulence_per_10cm"),
|
||||
data.get("solar_noon_turbulence_per_10cm"),
|
||||
data.get("midnight_turbulence_per_10cm"),
|
||||
)
|
||||
|
||||
|
||||
class TheaterLoader:
|
||||
THEATER_RESOURCE_DIR = Path("resources/theaters")
|
||||
|
||||
@@ -113,6 +130,7 @@ class TheaterLoader:
|
||||
spring = SeasonData.from_yaml(climate_data["seasons"]["spring"])
|
||||
summer = SeasonData.from_yaml(climate_data["seasons"]["summer"])
|
||||
fall = SeasonData.from_yaml(climate_data["seasons"]["fall"])
|
||||
turbulence = TurbulenceData.from_yaml(climate_data["turbulence"])
|
||||
if summer.average_pressure is None:
|
||||
raise RuntimeError(
|
||||
f"{self.descriptor_path} does not define a summer average pressure"
|
||||
@@ -129,12 +147,32 @@ class TheaterLoader:
|
||||
raise RuntimeError(
|
||||
f"{self.descriptor_path} does not define a winter average temperature"
|
||||
)
|
||||
if turbulence.high_avg_yearly_turbulence_per_10cm is None:
|
||||
raise RuntimeError(
|
||||
f"{self.descriptor_path} does not define a yearly average high turbulence"
|
||||
)
|
||||
if turbulence.low_avg_yearly_turbulence_per_10cm is None:
|
||||
raise RuntimeError(
|
||||
f"{self.descriptor_path} does not define a yearly average low turbulence"
|
||||
)
|
||||
if turbulence.solar_noon_turbulence_per_10cm is None:
|
||||
raise RuntimeError(
|
||||
f"{self.descriptor_path} does not define a solar noon turbulence"
|
||||
)
|
||||
if turbulence.midnight_turbulence_per_10cm is None:
|
||||
raise RuntimeError(
|
||||
f"{self.descriptor_path} does not define a midnight turbulence"
|
||||
)
|
||||
return SeasonalConditions(
|
||||
summer.average_pressure,
|
||||
winter.average_pressure,
|
||||
summer.average_temperature,
|
||||
winter.average_temperature,
|
||||
climate_data["day_night_temperature_difference"],
|
||||
turbulence.high_avg_yearly_turbulence_per_10cm,
|
||||
turbulence.low_avg_yearly_turbulence_per_10cm,
|
||||
turbulence.solar_noon_turbulence_per_10cm,
|
||||
turbulence.midnight_turbulence_per_10cm,
|
||||
{
|
||||
Season.Winter: winter.weather,
|
||||
Season.Spring: spring.weather,
|
||||
|
||||
Reference in New Issue
Block a user