A Curiosity About Calendar And In-game Date Behaviour

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
Post Reply
flup72
Posts: 24
Joined: Wed Oct 11, 2023 1:15 am

A Curiosity About Calendar And In-game Date Behaviour

Post by flup72 »

I wasn't sure if I should ask this on Help and Support, but since it could lead to a bug I decided to post here.

How high does the calendar count up to? You always start the game on year 405 if I'm not mistaken. Does the year go until year 9999 or beyond? If you get to the final day of the final year does the year loop around forever or you just repeat the last day of the year forever(Wouldn't that make any quest have unlimited time to finish?)? Does it cause an integer overflow? Or maybe the game just bugs out and maybe crashes?

I always wonder this when playing something with an in-game calendar and year. Since it's highly unlikely that anyone would ever play enough on the same save to get to that point I decided to ask. Does anyone know?

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: A Curiosity About Calendar And In-game Date Behaviour

Post by Interkarma »

DaggerfallDateTime has separate counters for seconds, minutes, hours, days, months, years. Game seconds accumulate into minutes, which accumulate into hours, and so on. It's setup this way mainly for simplicity of use rather than trying to be a real-world datetime system.

The year is the final accumulator, which is an unsigned int. Maybe not the best primitive choice here, but still a large number. The maximum positive value of a 32-bit int is 2,147,483,647, which gives us ~2.14 billion years of gametime. If I had used a ulong, it would be much larger. As a quick note, DFU converts the date to a ulong of game seconds for storage and comparisons like quest time, but that's still derived from the system above.

You start game in year 405, and 2.14 billion years is a good stretch. Besides editing the save data, I don't think anyone will come close to that during normal play. But in theory, it would cause some problems if you could or if save was edited to trigger that.

flup72
Posts: 24
Joined: Wed Oct 11, 2023 1:15 am

Re: A Curiosity About Calendar And In-game Date Behaviour

Post by flup72 »

Wow, that's an insanely high number. If anyone would be crazy enough to play that long(if it's even possible) and it bugs out, hopefully they can edit their save to lower the year back and continue playing hahahahaha.

I think someone could cap the year limit low and check what happens if you reach it for curiosity sake, but with such a high number it's barely an issue indeed.

Most of developers wouldn't think someone would be playing the game for so long that this would be an issue (though there's always someone to do an insane challenge run or just testing the limits of games).

From the top of my head I remember that in Castlevania: Symphony of the Night, if you get to timer limit(999 hour i believe) the clock in the clock towers stops ticking because it's dependant of the timer moving, though I don't remember if that locks you out of progressing if you somehow didn't go through before.

Thanks for the reply. It was very interesting to learn how this works.

Post Reply