As I ramp up my work on the project again, I am reading over and relearning a lot of code. Today I got to the GameCalendar class and remembered that I had a bunch of changes I wanted to make before I’d stopped work on QubeKwest. What I wasn’t sure of exactly, was what changes I wanted to make. After a bit of consideration followed by a bunch of coding, here’s the things I’ve changed.
Tracking game ticks was a pointless complexity for the calendar system. Thus it was removed and that of course means that the math ticks added into the calendar was removed too. This makes several parts of the calendar easier to calculate and it also means that the internal workings of advancing the time for the calendar now only needs to happen roughly 1/53rd as often. It’s not a lot of overhead, but I’ll take it.
Days were too short. My brother and I have played a bit of Minecraft lately and been repeatedly frustrated by how short the days are. While I’d already build days to be longer than they were in Minecraft, I decided I wanted to make them even longer, and a bit more asymmetrical in favor of daylight. This table demonstrates what I’m talking about:
Part of Day Minecraft QK (Old) QK (New) ------------------------------------------------- Day 10 min 16 min 40 min Dusk 1.5 min 3 min 4 min Night 7 min 10 min 12 min Dawn 1.5 min 3 min 4 min ------------------------------------------------- Total 20 min 32 min 60 min
This change adjusted how the game represents the current “wall clock time.” In simple terms, the math is different for deciding what time of day it is. The game will still represent the clock as a 24 hour clock of 60 minutes in each hour. The length of a minute in the game has just increased. (Now 2.5 seconds each.)
Seasons were too short. Due to the length of months (16 days) it seemed incorrect to have seasons be only 2 months long. Thus, I’ve changed to a 16 month calendar. Now each of the 4 seasons is 4 months long. I haven’t come up with names for any of the months, and I’m not even sure if I’m going to bother.
Moon phases still line up in the months the same way they did before. This is because neither the length of a month nor the number of moon phases there are have been changed. It doesn’t sound like a lot, but I was thankful for this break in the sweeping changes I was making.
Due to the collected changes, the timestamp format was adjusted to have a second digit for the day of the month. The resulting format is:
hh:mm YYYY-MM-DD
Calculating this was simplified by the removal of game ticks from the calendar, but it was an almost total rewrite for this method to accommodate that adjustment. The best part is that the wall clock time and the timestamp are no longer only approximate values. Since I now only track down to the minute level, the number of minutes involved is always exactly known. No rounding errors any more.
Last but not least, the collection of constants used by the calendar were updated in both name and value to make using them a little cleaner. It’s been a fun day that involved drawing in my notebook, coding, and correcting tests that I blew up with all these changes, but I’m also glad it’s all set now.