- the climate displayed by "tdbg" (and which is, I think, responsible for stuff like architecture and textures) is based on which is "Desert";
Code: Select all
LocalPlayerGPS.ClimateSettings.ClimateType
- whereas the weather is based on which is "Subtropical", hence the frequent rain and thunder
Code: Select all
PlayerWeather.PlayerGps.CurrentClimateIndex
Sentinel weather
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Sentinel weather
Trying to understand why it rains so often in Sentinel, I noticed that
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Sentinel weather
Sentinel should be subtropical. Does "LocalPlayerGPS.ClimateSettings.ClimateType" have a value for that?
Is it subtropical that makes it rain so much? I suspect it's during winter in particular, when instead of snowing, it rains.
Is it subtropical that makes it rain so much? I suspect it's during winter in particular, when instead of snowing, it rains.
- DigitalMonk
- Posts: 111
- Joined: Sun Nov 10, 2019 8:01 pm
Re: Sentinel weather
That would confuse me greatly as a maintenance programmer / modder. Both forms retrieve a climate based on the players position, so how would I know which to use? I'm guessing that the architecture styles and the weather system were implemented a considerable time apart? Or is there a subtle reason for these being kept separate that I don't understand because I've not been in the code?
I could see that architecture would track by general year-round climate, while local weather would track by immediate weather chosen from the surrounding climate. But both of those appear to be long-term climate values, not immediate weather values.
Would it make sense to pick one or the other as the most accurate value, remove the other one, and refactor code to always use the one that was kept?
(BTW, no judgment here -- I know my own code, and I don't have any soapbox or high horse to get up on . Just wondering if this would help clarify things for future modders.)
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Sentinel weather
I think you'll find that these are representation of classic data and that's why it may not seem logical, but Interkarma would have to confirm - I am guessing.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Sentinel weather
The ClimateType field is of ClimateBaseType enum used for climate textures. It looks like below.
These map directly to climate texture bases in TEXTURE files, e.g. TEXTURE.000 is base for Desert textures, TEXTURE.100 is base for Mountain textures, and so on. There is no such thing as a subtropical texture set for terrain and models. Rather, those four texture sets are shared across the various subclimates. That's why Sentinel is ClimateBaseType.Desert - it's the texture set Sentinel uses.
The ClimateIndex value is the subclimate read from CLIMATE.PAK for a specific map pixel. Other than determining the texture set above, it selects the sky, nature sprites, and used in weather inputs along with season. There are several subclimates with some variations between them, but they all use one of the four texture bases.
Weather was reverse engineered from classic by Allofich and functions identically as far as I know. See SetClimateWeathers() and SetWeatherFromWeatherClimateArray() in WeatherManager for this.
TLDR:
Everything climate-related ultimately hangs off ClimateIndex in some way. How that value is used depends on which system you're looking at. Texture swaps and weather are different systems.
Code: Select all
/// <summary>
/// Climate base type enumeration for climate-swapping textures.
/// </summary>
public enum ClimateBaseType
{
None = -1,
Desert = 0,
Mountain = 100,
Temperate = 300,
Swamp = 400,
}
The ClimateIndex value is the subclimate read from CLIMATE.PAK for a specific map pixel. Other than determining the texture set above, it selects the sky, nature sprites, and used in weather inputs along with season. There are several subclimates with some variations between them, but they all use one of the four texture bases.
Weather was reverse engineered from classic by Allofich and functions identically as far as I know. See SetClimateWeathers() and SetWeatherFromWeatherClimateArray() in WeatherManager for this.
TLDR:
Everything climate-related ultimately hangs off ClimateIndex in some way. How that value is used depends on which system you're looking at. Texture swaps and weather are different systems.