Does anybody know what the season length setting is doing?

I had Duane Mixon of Hartwick County, an old winter-start character sitting around in my save files and recently decided to start playing him again. Everything was going great and I was just starting to dig the whole winter vibe when I noticed it was warming up a little on day 12 and it occurred to me that this was made back when seasons were really short.
I’ve previously altered the season length on an existing save game once, and doing so switched the season around, but that had been a long-running game and I assumed it was just altering when the seasons started versus day 1 of the game.
I figured Duane being 12 days in on a winter start, it should continue to be winter if I set it to 30 days, 91 days, or 365 day seasons or whatever. I mean, stands to reason if day one is the start of winter and the seasons are more than 11 days long, day 12 is always gonna be winter, right?
But that’s not what happened. Instead it shifted me to mid spring. In fact, when I turned the setting back to what it was originally, it was still spring. Changing the starting season seems to have no effect at all, though one would think it would rotate the seasons when you changed that setting.
Shifting the season length around some more (in hopes of getting something close to what I wanted originally) dropped me into spring many times, end of winter four or five times, summer three times, and autumn once, seemingly at random.
It’s like the code that handles this is non-deterministic or something! Now it’s telling me it’s day 56 of spring. What? This character hasn’t even existed for 56 days of game time!
Does anybody have any clue what this crazy thing is doing, and maybe even how I might get my winter extended?

Not sure why you’re messing with your worlds’ seasons so much after it’s already been created. But the best I can think of is choose a season setting and stick with it, then you’ll less likely run into anomalies.

I’m messing with it because I wanted to switch to longer seasons, like I said. Also because I expected that if it was screwy I could just put the settings back the way they were and continue, but that just makes it even more screwy.

So, figuring it was already screwy, I kept on fiddling with them for a while hoping to randomly roll the dice and end up with at least a midwinter date by accident, but that didn’t happen, now it thinks I’m 56 days in on my 12 day game.

I’m just really baffled at how this thing works, it does not in the least resemble the output of a sane calendar implementation. I’m tempted to go through the code when I have the time to see if I can figure out what to do to fix this, but I’m scared of what horrible spaghetti nonsense I’ll find.

Spaghetti monsters lingering in the code. Don’t forget to bring a fork.


That’s a smooth pun.

While digging through the code to try to figure out what it’s doing, I found a simple bandaid: the debug menu’s “set time” function includes a way to forcibly set the day and season, so Duane Mixon is back in a proper winter at least.

I think its becuase the default start season is spring, so whether the system is droping/not tracking season time through settings edits or whenever it hits an invalid date or anything happens with the numbers that it doesn’t know how to parse, it just resets to day 1 of spring and starts counting again.

Only a guess but it makes a kind of sense in my mind at least that there would be a catch all date/ else-then plugged in to prevent errors when the system doesn’t know how to handle a date.

Doesn’t look like that’s what’s happening. I dug around in the code, and calendar::sync appears to do the right thing, working out the current day, season, and year from the turn count. The question is what is it that’s screwing around with the turn count when I fool with the season_length setting? Because something did, I wound gaining an extra 44 days, with some of my food insta-rotting in a six second span.

I may have to sit down and try to debug this properly one of these days, because just looking at the code, it seems I’m not seeing something. (The comments for why the cataclysm starts on a Thursday are amusing, though) It all looks like it should work, but it doesn’t.

XD where are the comments for why it starts on a thursday? sounds excessively in depth :slight_smile:

weekdays day_of_week( const time_point &p )
    /* Design rationale:
     * <kevingranade> here's a question
     * <kevingranade> what day of the week is day 0?
     * <wito> Sunday
     * <GlyphGryph> Why does it matter?
     * <GlyphGryph> For like where people are and stuff?
     * <wito> 7 is also Sunday
     * <kevingranade> NOAA weather forecasts include day of week
     * <GlyphGryph> Also by day0 do you mean the day people start day 0
     * <GlyphGryph> Or actual day 0
     * <kevingranade> good point, turn 0
     * <GlyphGryph> So day 5
     * <wito> Oh, I thought we were talking about week day numbering in general.
     * <wito> Day 5 is a thursday, I think.
     * <wito> Nah, Day 5 feels like a thursday. :P
     * <wito> Which would put the apocalpyse on a saturday?
     * <Starfyre> must be a thursday.  I was never able to get the hang of those.
     * <ZChris13> wito: seems about right to me
     * <wito> kevingranade: add four for thursday. ;)
     * <kevingranade> sounds like consensus to me
     * <kevingranade> Thursday it is */
    const int day_since_cataclysm = to_days<int>( p - calendar::time_of_cataclysm );
    static const weekdays start_day = weekdays::THURSDAY;
    const int result = day_since_cataclysm + static_cast<int>( start_day );
    return static_cast<weekdays>( result % 7 );

XD so much depth of thought and preplanning.

There’s no better reason for doing something than a Douglas Adams quote.