Temperature insanity

Save file incoming: http://we.tl/nlXsEhslhX

Turns out nobody was right. Seasons are shifted from what they should be, but I’m not sure why. The functions that generate the weather are ok, but off by like half a year. It’s a mystery. I’m gonna call the ghostbusters and keep you informed of progress. =P

[hr]

TIL: calendar::turn is actually the calendar object used to track the current game time. As opposed to a static property of the calendar class holding the current turn of the game. This may have fun implications…

so hud bug what show wrong season?

[quote=“Efimero, post:62, topic:6865”]Turns out nobody was right. Seasons are shifted from what they should be, but I’m not sure why. The functions that generate the weather are ok, but off by like half a year. It’s a mystery. I’m gonna call the ghostbusters and keep you informed of progress. =P

[hr]

TIL: calendar::turn is actually the calendar object used to track the current game time. As opposed to a static property of the calendar class holding the current turn of the game. This may have fun implications…[/quote]

Thanx for still working on it :slight_smile:

I think I found it now. Looks like I was accounting for the starting season offset, but new games were also accounting for it, so it was getting done twice. I don’t really understand why that caused a shift ONLY after playing through, but it seems to be as it should now.
I have to double check what that change affects and pass it through the lead devs, so it should hit experimental tomorrow, but no sooner.

Hopefully it’s the last fix. XD
Thanks for playing!

[hr]

PS: There’s merge conflicts. Expect cries of rage and blood rains. Prepare for possible sulfur storms.

[hr]

And finally, it was discovered that years in Cataclysm start in spring, which seems stupid until you realize that the default game starts in spring, and the other starting dates were added after spring was since forever the starting season. So then winter is the last season, not the first.

Also, qurvax, your last savefile is apparently now at the end of summer rather than in the middle of winter. I don’t know how that happened, but it now reports that, so there. =3
You don’t have to change anything, btw. When you update to the version with the fix (still in approval process) the reality will snap back to what it should be. After re-doing all the tests, it looks like it’s finally a fixed reality in accordance with the expected calendar of the game, so all should be fine forever, in theory.
Also, I coerced our smiling god not to shine during the night, so no more “Sunny” at 4AM (like it was before I changed the weather).

Maybe my save got “corrupted” somehow after being moved between so many versions? Thank you a lot for the fixes! Well, after recent games i really got an habit to be prepared to ANY weather ANY time. In CDDA one must be prepared for anything, right? :slight_smile:

There’s no such thing as corruption in my weather generator. It is a fixed math function. It’s either working or completely wrong. XD
And it’s not saved in the savefile. It just is. There’s a seed for the randomness, but that’s a separate part from the actual function that defines the seasons and days.
In any case, it seems fixed now. If KA101 manages to punch it into place with the other changes that have happened around since I branched off, it should get into experimental within today (EU time).

[hr]

Bad news. The elder gods of bureaucracy have woken up and our best agents are now fighting them and figuring out how to avoid delay the inevitable end of the world. Unfortunately, this may delay this fix until tomorrow. The weather for today will be crashes, crashes and crashes when you save your game, specifically.
Have fun and stay safe, survivors. =3

Looks like this is in. Please, do download the newest build (or build from the sources yourself) and test if all is working as expected.

Thanx. Already on it.

EDIT: It’s still shows winter, but temperature suggests it’s something around the middle of the summer.

Screene:

Also notice the sea of fungus. I have no idea, why there are SO many of them. I wasn’t in the area for quite some time, and the closest spire was destroyed by me a couple of days ago.

Once again, send me the savefile.

http://we.tl/Z9hty9wOF9
Build: 1932

Efimero, I have a question despite it being pretty unrelated to this thread. It’s regarding issue 8518: https://github.com/CleverRaven/Cataclysm-DDA/issues/8518

I have yet to start hunting, but I wonder if some hardcoded temperature stuff I did is messing with the weather some how. Ice labs are hard coded to drop in temperature; it takes the current temps and subtracts 30 or 60 or whatever amount. Could this hardcoded modification of temperatures in any way affect your weather system?

That’s weird. It’s showing winter, but given your current turn and year length, you should have barely just ended the summer time. I think the function that calculates the current season in the game calendar is dumb and should be taught to be smart. Or maybe even more dumb, depending on how you look at it. Basically it’s not always looking at what turn it is at, but rather it’s doing increments on the previous status, which opens the way for “corruption” like this. I have to consult the oracles and see if we can bring down Chronos, but for the time being, consider the display being bugged, not the actual weather. Unless I’m totally miscalculating all the numbers in the calendar, which after all this would be quite surprising, honestly.

If you’re curious, it’s as follows. A turn is 6 seconds. That means a minute is 10 turns, so an hour is 600 turns, a day is 14400 turns. In your case, a season is then 432000 turns, and a year is then 1728000 turns. You are currently in turn 760296. That is a 43,99% of a year, so a bit under half a year. You started at spring (and the turn 0 is at spring 1 anyway), so you should have passed through spring and summer, but not reached fall yet. The weather function works from that assumption, but the calendar just adds one to the season whenever the days are larger than the season length. It doesn’t actually check the turn. I guess I’ll have to try and make it do that, but given how many things depend on the calendar, it could be tough.

Anyway, thanks for the report, pal.

[quote=“Shoes, post:72, topic:6865”]Efimero, I have a question despite it being pretty unrelated to this thread. It’s regarding issue 8518: https://github.com/CleverRaven/Cataclysm-DDA/issues/8518

I have yet to start hunting, but I wonder if some hardcoded temperature stuff I did is messing with the weather some how. Ice labs are hard coded to drop in temperature; it takes the current temps and subtracts 30 or 60 or whatever amount. Could this hardcoded modification of temperatures in any way affect your weather system?[/quote]

Nah. All I do is feed the temperature to the game engine and after that, stuff happens, like the ice lab subtracts what it wants and the body parts mess around based on clothing and sunlight and wetness etc. On that front it’s pretty solid. And it was like that before I touched it. The temperature is just a “global” int that everything that actually utilizes the temperature reads from. Nothing is actually reading directly from the weather generator except the rotting stuff and the funnels when they need to get a history of what climate happened in a certain tile in the past. I’m pretty sure the only problem left is the calendar using deltas instead of the absolute turn, as explained above, but thanks for the input.

PS: Also, regarding the bodytemps, apparently that stuff has the ability to lie to the player as a feature, so who knows. I have no idea what the colors mean, but they’re derived from the temperature modified by a bunch of stuff and compared to the warmth, so it’s supposed to be intuitive, but at this point who knows. XD
All I know is I didn’t touch on any of that stuff.

It was even worse until recently (about a month ago), it was saving ‘broken down time’ (sec/min/hr/day/etc) and calculating turn based on that on demand.

So I’ll start anew. This will take some time tho :slight_smile:

I’m going to try and fix the calendar. It may take a while, but it should fix things retroactively, so your savefile should snap back to the right date. It may take a while though, since I don’t know if there are things using the calendar through non-turn-driven methods at the moment. Those would cause problems, if they exist. But first I gotta fix, then we’ll see what breaks.

Was going to approve, that problem remains in build 1932, but seems you are aware of that.
40C and melting character in the middle of Spring. 2C and freezing character in the end of Summer.
All that intrigue, what it’ll be tomorrow! Apocalyspe was never that dangerous before :slight_smile:

[quote=“Crador, post:77, topic:6865”]Was going to approve, that problem remains in build 1932, but seems you are aware of that.
40C and melting character in the middle of Spring. 2C and freezing character in the end of Summer.
All that intrigue, what it’ll be tomorrow! Apocalyspe was never that dangerous before :)[/quote]
Hey, just look at the turn number in the .vas file and divide by 14400 to know what day you’re actually in. Depending on your season length that will give you your current real season. If the fix to the calendar gets in, it will do that automatically. XD

Gamestate check says it’s game turn 401904, which is 27,91 day. So in your calendar it sould be… What? :slight_smile: (Season length is 14 days).
BTW, in my calendar it shows Summer, day 14. Temperature is -4 Celcius. Gonna find some clothes, i wasn’t ready to this. 7 days ago it was 40 Celcius >.<

Hmm… looks like the season are a week off, but your date is not lying yet. You’re on the last day of summer. Which means the climate is actually in the middle of autumn. Sorry about that. XD
Anyway, the date should remain in sync with reality as long as you started in spring and nothing weird happens to your savefile, but updating to a different cdda version can possibly cause that.
Still, starting in spring is the safest. The date only desyncs when the turn number differs from the date, which doesn’t normally happen. Specially on default settings.
For now, just assume you are seven days after the date displayed. I have o know if the calendar fix is going in or not before I can fix the season offset.