How would I go about making an ambient temperature that fluctuates?
Make a system where you have a min and max range of temperatures at different parts of the day.
MIDNIGHT
This is the middle of the night (00:00 hours).
MIDDAY
This is the middle of the day, also called “NOON” (12:00 hours).
MORNING
This is the time from midnight to midday.
AFTERNOON
This is the time from midday (noon) to evening.
From 12:00 hours to approximately 18:00 hours.
EVENING
This is the time from the end of the afternoon to midnight.
From approximately 18:00 hours to 00:00 hours.
DAWN
This is the time when the sun rises or comes up (sunrise).
DUSK
This is the time when the sun sets or goes down (sunset).
Then at the start of a day get the random range value for each part of the day. Then lerp through the values depending on the hour.
You could also add in a global offset for the whole range to make things less repeatable.
You can also introduce seasons that would have their own governing ranges
Ideally you would put this in a subsystem but you need c++ for that. For bp you can make an actor or blueprint library to manage the weather. This could drive a material parameter collection that in turn could drive a master material that could change how materials behave depending on the weather.
- describe it with a simple float curve - query it with TimeOfDay and get the temp back
- add a secondary curve that acts as modifier that represents TimeOfYear
- add additional ones that represent special events - Coldsnap, Heatwave…
- add some randomness per day / season as required
Multiply all 4.
The curve would always return the same value at the same time of day => no fluctuation I.e. variation.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.