The Winter Dragon: It's a season for code blogs

... sit down, kick back and relax, and talk about anything that doesn't belong on one of the other forums.
Aureus
Posts: 968
Joined: Mon Dec 28, 2020 11:13 pm

The Winter Dragon: It's a season for code blogs

Post by Aureus » Sat Oct 01, 2022 4:53 am

Now that the taint is ravaging the land, I'll start another code blog (mostly at Itesh's prompting). This time: seasons and the weather.

Why, you ask? Glad you asked: there's a circuitous answer for that. You see, we were talking in the staff about new players and daytime/nighttime. It is very confusing for new players who get lost in the dark! Then we got to asking pointed questions about why it is that you can't see in the dark at night (unless there's no moon, of course). Then we got to wondering why there is no moon. And moon cycles. And so I said hrm, we can probably do something interesting there with light levels in the dark, and the moon. Well, not THAT interesting gameplay-wise since it's mostly passive, but interesting atmosphere-wise. And plus Brown Ajah and other explorer types love figuring that sort of obscure mechanic out. So why not.

Well, why not indeed. I open up the weather code to look at how day and night work. Actually - I am kidding, of course. This discussion was several months ago now. But I am looking through the coding backlog and want to eventually get to it. And Flash has been reviewing some code so I feel less bad about piling more code changes on top of his queue. I am worried it might soon shrink to a size where he starts to see the light at the end of the tunnel. So here we are.

Why is day and night code located in the weather file? An excellent question, one for the ages. If you stare at WoTMUD's code long enough, the code begins to stare back at you and threaten to devour your sanity, and so you soon learn not to ask these very good and right questions. Moving on.

Ok, I've located day and night and the weather changing code. It is all jumbled together. Hrm, this is interesting. One, I feel like it was written by an insane person (this person is Eileen, circa 2000). Two, I notice that there are really just two seasons here: summer and "everything else".

Well, no wonder it is always freezing cold in Randland: it's almost always "everything else" season.

So I go searching around for where summer is defined (it uses a definition like "IS_SUMMER" and you pass in the current month and it tells you whether it is summer or not). I presume there are definitions for the other seasons, and if there aren't I can add them easily.

Oh, delightful. The other seasons do already exist. But I notice these seasons are assuming a 16-month calendar. This does not sound right at all. And it is not: this is stock CircleMUD! However the Wheel of Time (and indeed our game) uses a 13-month calendar. And, this definition of seasons assumes that the start of the year is spring. But in Wheel of Time's calendar, the last day of the year is the winter solstice. So the start of the year should be winter. So the seasons make no sense. At all. On any dimension. Fun! This is about par for the course with WoTMUD.

Ok, so I have adjusted the definitions of the seasons to match our 13-month calendar. You'll no doubt cleverly point out that 13 months do not divide into 4 seasons, which is entirely true. So I just shove an extra month into one of the lucky seasons. A proper solution would be to calculate the season based on the day of the year instead of the month, but it is late and I am tired and cannot be bothered. I make a mental note to update that... someday. Yes, someday.

Next, I go back to the weather code and break apart "everything else" into a proper winter, fall and spring. For winter, I leave the current freezing temperatures. For spring and fall, I add in a new, more moderate climate. I compile and run this code and it works. A win!

I decide to go review how natural temperature changes occur to make sure I have not missed anything. Hrm here too. I notice that, among an overly complex calculation for how air pressure impacts the temperature, it is mostly deciding at random whether it gets warmer or colder (within the appropriate range) on any given hour. Deserts excepted. Not very realistic there either. It should generally get warmer during the daylight hours, and colder during nighttime hours. So I put a slight thumb on the scale there to make it more likely it turns colder at night and warmer during the day.

And this compiles and works also.

So now we have:
- Seasons that map to the Wheel of Time calendar
- Seasons that make sense, at all
- Fall and Spring, in addition to Summer and "Permanent Ice Age"
- Temperatures that will trend colder at night and warmer during the day

And I still have not gotten to the moon or levels of light, which was the entire original thrust of the conversation. Newbies will have to continue to suffer in the dark when they drop their torches. Oh well, a problem for another day.

Itesh
Posts: 828
Joined: Sat Feb 14, 2015 4:59 am

Re: The Winter Dragon: It's a season for code blogs

Post by Itesh » Sat Oct 01, 2022 5:02 am

Marry me.

Sarinda
Posts: 687
Joined: Wed Jan 12, 2022 3:10 pm
Location: Kalamazoo, MI

Re: The Winter Dragon: It's a season for code blogs

Post by Sarinda » Sat Oct 01, 2022 7:26 am

So are you telling me that I am going to have to start my comprehensive weather and climate research project all over again? :cry: (I will, I find it fascinating and will enjoy it, just haven’t had the time for it lately.)

viewtopic.php?t=16318

Elysia
Posts: 7908
Joined: Sun Feb 15, 2015 1:29 pm

Re: The Winter Dragon: It's a season for code blogs

Post by Elysia » Sat Oct 01, 2022 8:12 am

Sarinda wrote:
Sat Oct 01, 2022 7:26 am
So are you telling me that I am going to have to start my comprehensive weather and climate research project all over again? :cry: (I will, I find it fascinating and will enjoy it, just haven’t had the time for it lately.)

viewtopic.php?t=16318
I think you can just conclude: "well, this was so unnaturally random that there was no pattern to discern".

And then start over once this is in. Because you were assuming patterns where there were none. Well, except for Summer and Everything Else. :P

Aloisa
Posts: 968
Joined: Tue May 30, 2017 8:24 pm

Re: The Winter Dragon: It's a season for code blogs

Post by Aloisa » Sat Oct 01, 2022 12:22 pm

Sarinda wrote:
Sat Oct 01, 2022 7:26 am
So are you telling me that I am going to have to start my comprehensive weather and climate research project all over again? :cry: (I will, I find it fascinating and will enjoy it, just haven’t had the time for it lately.)

viewtopic.php?t=16318
I've consulted with the Brown Ajah and you're being transferred.

Rig
Posts: 2226
Joined: Wed Dec 16, 2015 8:00 pm
Location: JESUS

Re: The Winter Dragon: It's a season for code blogs

Post by Rig » Sat Oct 01, 2022 12:23 pm

My vote is for fixing track when it's snowing.

Aureus
Posts: 968
Joined: Mon Dec 28, 2020 11:13 pm

Re: The Winter Dragon: It's a season for code blogs

Post by Aureus » Sat Oct 01, 2022 1:36 pm

Rig wrote:
Sat Oct 01, 2022 12:23 pm
My vote is for fixing track when it's snowing.
We don’t have the track code yet.

arston
Posts: 168
Joined: Tue Oct 13, 2020 10:05 pm

Re: The Winter Dragon: It's a season for code blogs

Post by arston » Tue Oct 04, 2022 1:12 pm

If the moon shines in the ways then our immersion will be ruined

reil
Posts: 161
Joined: Sat Apr 23, 2016 3:27 pm

Re: The Winter Dragon: It's a season for code blogs

Post by reil » Tue Oct 04, 2022 2:04 pm

I'll drop trou in the Ways. Immersion re-established.

Ryzom
Posts: 214
Joined: Tue Mar 13, 2018 12:52 am

Re: The Winter Dragon: It's a season for code blogs

Post by Ryzom » Tue Oct 04, 2022 2:40 pm

I am constantly immersing in the used socks of several Sedai.

Post Reply