Jump to content

Where did my math go wrong?


Recommended Posts

I really like to know not just what season it is, but where in the season it is. There's a difference between, say, day 4 and day 16, let alone between day 22 and day 33!

 

This is pretty simple in the early years, but when worlds get old it's a bit of a pain to figure out. After looking around for someone who had created a season calculator and not finding one, I decided to whip one together in Excel.

 

Given that the last day of summer is day 20, and the last day of winter is 36, the formula is:

 

Season day = (world day) modulo 36 

 

(On day 36 proper the formula results in 0, but we just understand that to mean day 36.)

 

This gives the correct result per the wiki article on seasons, at least for the first 5 years. However, when I look at dedicated servers and plug their days into the formula I don't get the same results as the description in the server. For example, plugging world day 541 into the formula results in season day 1 (first day of summer), whereas the server is describing this day as "late summer." Similarly, plugging 1017 into the formula results in season day 9 (mid-summer), whereas the server describes it as "early summer."

 

So where did I go wrong?

@jeneah, "Easy" season lengths are 20 days, and "Hard" season lengths are 15 days. So it was (day - 1)%35 + 1 before (% being modulo, and the -1 is because we start on day 1 instead of zero, and + 1 to fix that in the output).

 

However, there is known to sometimes be an extra day in a season. I don't believe this is intended, from having looked at the code, but it happens, and makes it difficult to predict the season progress on a dedicated server. However, you can access the remaining days in the season from the console:

print(TheWorld.state.remainingdaysinseason)

Edit: So using the correct formula, you get these results:

day 541: (541 - 1)%35 + 1 = 16 --> 4 days left of summer (not including that day)

day 1017: (1017 - 1)%35 + 1 = 2 --> 2nd day of summer

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...