Ludeon Forums

Ludeon Forums

  • January 29, 2023, 02:30:27 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: A question regarding seasons  (Read 1833 times)

dnks

  • Drifter
  • **
  • Posts: 33
  • Refugee
    • View Profile
A question regarding seasons
« on: February 18, 2017, 09:29:20 AM »

I've searched in the Core folder for any info on the seasons, but it seems that seasons aren't coded into the game like many other values (at least I couldn't find it). I also checked in Source but didn't see anything either, so I'm guessing it's in a .dll or .asset file or somewhere...

If I wanted to modify how seasons work (their length, temperature, visual effects...) how would I go about it? Has anyone made changes like this before?
Logged

Thirite

  • Guest
Re: A question regarding seasons
« Reply #1 on: February 18, 2017, 09:12:17 PM »

Not everything can be modified just by playing with xmls- most of the game's code is in packed up computer-readable-only compiled C#. This is a misconception commonly made about how RimWorld code works so I figure I'll elaborate.

RimWorld's 'code' is made up of two types: Compiled C# Classes and human readable XML files. The C# is what defines the game logic- it controls how everything works under the hood. Compiled C# must be decompiled using specials tools to read and modify. XML files on the other hand are like little dictionaries of variables which the C# reads the contents of and executes code based on what it says. XML files can't hold game logic unlike C#, but C# can hold game data like XML can. So not all the game data is held in the XMLs; much of it is hidden away in the compiled C# along with the game logic that uses it.

TL;DR
The values you're looking to modify are probably in the game's dlls, not xml files.
Logged

dnks

  • Drifter
  • **
  • Posts: 33
  • Refugee
    • View Profile
Re: A question regarding seasons
« Reply #2 on: February 18, 2017, 09:41:04 PM »

Not everything can be modified just by playing with xmls- most of the game's code is in packed up computer-readable-only compiled C#. This is a misconception commonly made about how RimWorld code works so I figure I'll elaborate.

RimWorld's 'code' is made up of two types: Compiled C# Classes and human readable XML files. The C# is what defines the game logic- it controls how everything works under the hood. Compiled C# must be decompiled using specials tools to read and modify. XML files on the other hand are like little dictionaries of variables which the C# reads the contents of and executes code based on what it says. XML files can't hold game logic unlike C#, but C# can hold game data like XML can. So not all the game data is held in the XMLs; much of it is hidden away in the compiled C# along with the game logic that uses it.

TL;DR
The values you're looking to modify are probably in the game's dlls, not xml files.
I also checked in Source but didn't see anything either, so I'm guessing it's in a .dll or .asset file or somewhere...
Has anyone made changes like this before?

Thanks for the heads up I guess
Logged

Thirite

  • Guest
Re: A question regarding seasons
« Reply #3 on: February 18, 2017, 10:57:53 PM »

Oh, I guess I missed that line. Duh
Logged

zeidrich

  • Drifter
  • **
  • Posts: 36
  • Refugee
    • View Profile
Re: A question regarding seasons
« Reply #4 on: February 24, 2017, 03:09:02 AM »

Weather stuff in in Verse.WeatherDef, WeatherEvent, WeatherEventHandler, WeatherEventMaker, WeatherWorker.

Season stuff is in RimWorld.SeasonUtility

You might need to look in Verse.TickManager

Temperature stuff is in RimWorld.MapCondition_ClimateCycle

Time conversion is in RimWorld.GenDate

I'm not sure when you said you looked at the source whether you mean you looked at the source whether you mean you looked at the source in the game folder, or whether you looked at the disassembly.  You'll have to do the latter to get a fuller picture. There's tutorials on the wiki.

You also don't really say what you're trying to do. Seasons aren't really a thing. The game is run on ticks. The date is calculated based on the number of ticks that have passed. The climate cycle is a sin wave that repeats each year. The only "seasons" are the result of seeing which quarter of the years' worth of ticks have passed.  There's no real definition of spring, summer, winter, fall, except for when they get triggered.

If you wanted to change that, it's certainly possible to do so, probably a fair bit of work though.  If you want to change the length of seasons displayed, maybe detour RimWorld.MonthUtility.GetSeason. If you want to change the length of the year, then look at GenDate. If you want to change how the temperature reacts to seasons, then make a new Map Condition to replace climate cycle.  You can use that map condition to change the sky color and overlay as well, look at toxicfallout.

If I were to try it myself, I'd focus on the mapconditions and not worry about trying to change the fundamentals of the year. 
Logged

dnks

  • Drifter
  • **
  • Posts: 33
  • Refugee
    • View Profile
Re: A question regarding seasons
« Reply #5 on: February 26, 2017, 09:45:08 AM »

Thank you zeidrich, that's great insight. By Source I meant the files inside the folder named like that.

And thanks for letting me know about the seasons just being abstract representations of clicks, a step in the right direction.
Logged