RimWorld

RimWorld

Not enough ratings
Custom Climate Cycle (Continued)
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.3, 1.4, 1.5, 1.6
File Size
Posted
Updated
49.302 KB
May 10, 2024 @ 6:38pm
Nov 20 @ 6:54pm
4 Change Notes ( view )

Subscribe to download
Custom Climate Cycle (Continued)

In 1 collection by Zaljerem
Zal's Continued Mods
571 items
Description
Original mod by dninemfive
https://steamcommunity.com/sharedfiles/filedetails/?id=1684902496
MIT License
Even so, if the original author requests it, I will remove this update.

--

Original mod notes (1.2):

Adds a new climate cycle setting allowing customization of every aspect, from period to temperature offsets, plus the ability to set up a runaway scenario. Access it through the new "Custom Climate Cycle" scenario part.


Variables

Formula:

(Mathf.Sin((GenDate.YearsPassedFloat + (float)ticksOffset / (float)GenDate.TicksPerYear) / PeriodYears * tau) * tempOffsetFactor) + tempOffsetOffset + (xCoeff * GenDate.YearsPassedFloat)

- Period offset: how many years into the cycle the game will be when it starts. Default 0, and can be randomized.
- Period: how many years the cycle takes to go through. Default 4.
- Temperature offset factor: The magnitude of the sine wave. If the temperature offset is 0, this is the maximum variation from normal temperatures. Default 20.
- Temperature offset: Lets you modify the default yearly temperature. Negative values make the whole cycle colder, positive ones make it warmer. Default 0.
- X-coefficient: a modifier which lets you set runaway warming or cooling. Negative values make temperature trend colder over time, positive ones make it trend hotter. Default 0.

Custom climate calculator/visualizer:
https://www.desmos.com/calculator/sj9ycjx97n


Notes

- You need to use the new "Custom climate cycle" scenario part; simply adding a custom climate cycle as a standard game condition will work, but it'll be the same as a normal climate cycle.
- You should be able to layer multiple Custom Climate Cycles to get non-sine behavior if you want to go through the effort, and by zeroing out the temperature offset factor, temperature offset, and x-coefficient you can do things like balance the game's overall temperature (making a warmer or cooler planet) or simply make temperature increase/decrease over time without a cycle.
- No mod compatibility issues are expected; this doesn't modify any base game code.


Thanks to 22点下 for the Chinese (Simplified and Traditional) translations.
19 Comments
Zaljerem  [author] Nov 20 @ 6:55pm 
Looks like you're right on in your analysis, I just tested it and it seems to be applying. Thanks! I've pushed an update.
Matathias Nov 20 @ 6:40pm 
I've noticed issues with this mod not properly applying temperature changes, as well. I took the liberty of looking through the code, and after some messing around, I believe I've figured out the problem: the TemperatureOffset function is never actually being called.

This appears to be because the climate cycle gameCondition is added to the World's gameConditionManager, rather than the map's. If I alter the code so that the ScenPart overrides GenerateIntoMap instead of PostWorldGenerate, and I register the condition in the map instead of the World, then the temperature changes are correctly applied. The condition will even automatically be applied to new maps (according to my brief testing, at least).

I didn't start looking at Rimworld's code until after 1.6 dropped, so I don't know why things seem to work differently from how they did in 1.5. But I guess they changed something about how gameConditions are handled with Odyssey.
smrow Aug 5 @ 7:35pm 
Thank you! No rush. I noticed there's two different climate cycle conditions I can apply in devmode - I can't tell a difference between them, it seems like both affect the temps by some identical default amount. I don't have much experience past basic XML editing but maybe that's something to investigate. Thanks again for looking into it.
Zaljerem  [author] Aug 4 @ 5:18pm 
It's not just you, I am also seeing similar issues, and I'm not sure what's going on. I'll try to work back on it soon.
smrow Aug 4 @ 5:15pm 
Hey, I love this mod! I'm struggling to get this working for 1.6 though. It's not throwing any errors and I both reinstalled and tried disabling everything back to straight vanilla. It lets me put in values and the 'climate cycle' condition is applied, but it doesn't seem like it actually alters any temperatures. Not sure if it's just me.
Yrol Akiyama Jul 30 @ 12:57pm 
Ah. okay. :o)
@Yrol Akiyama the DLC don't work with old versions, because the new versions are made with updates and features that support the DLC which older versions didn't have. It's especially true with Anomaly and Odyssey AFAIK. So it will surely break without those updates and potentially not even boot.
Yrol Akiyama Jul 12 @ 5:40am 
°grins° Zaljerem, bad idea... NOW they all EXPECT such fast updates ;o)

Slightly more serious Sidenote: if the devs roll back the update due to an issue, so must you...
Zaljerem  [author] Jul 11 @ 7:13pm 
Updated to 1.6.
wizardofmagicmemes Jul 11 @ 3:43pm 
Will this be updated to 1.6?