I get all of my ducks in a row…

·

·

,

…and then someone goes and shoots one of them. So I’m not quite ready to put out a build yet, but I nearly am. Nearly, nearly, almost! This coming week, I’m pretty certain. Watch this space!

I’m sorry it’s taking so long. It’s not like I’ve been waiting until I ‘finish’ everything, because it’s all still very experimental and rough, yet, and will be for years. It’s just that this will be the first new build I’ve done for a very long time, in a completely new world, running under a completely new rendering technology, in a completely new major version of Unity, with creatures that have seen a lot of changes but still need a lot more work. So I just needed to get to a point where there was at least some hope of things more or less working on a random, moderate quality games machine, along with with all the user validation stuff functioning, so that long-time backers are automatically able to run the game, and newbies are able to sign up. Making a working build is harder than it sounds – there are so many moving parts, and so much stuff that works just fine in the Unity editor but then falls over when it’s compiled into a standalone executable.

Anyway, while you wait, I’ve been doing some work on the date and time system, today. There’s a bit more to that than you might imagine, so I thought I’d tell you a little about the way I’ve designed it to work.

Time in simulation games is always a thorny topic. I’m a big flight simulator fan, and when I get a chance to play at all, I usually play in real time, since then I get live weather and share the skies with other people who are experiencing the same thing as me. But I like to fly in Europe, which is kind of awkward, since nowadays I live in the US, and it’s usually dark in Europe by the time I have some free time here. Of course, because weather and daylight are such a big deal in aviation, I do have the opportunity to change to any time of day and any weather. But then it means I’m flying in different conditions from everyone else, even if we’re all trying to land at the same airport, in winds coming from opposite directions. You see the problem? Time waits for no man, but it doesn’t always flow at the speed we’d like it to!

In a game like this one, things would get pretty boring if the seasons changed at the same rate and at the same time as those outside the window. Not to mention the problem that when it’s Summer in England (assuming England has a Summer), it’s Winter in Sydney. And if clock time elapsed at the normal rate, then it would be dark every other time you play the game, on average. Potentially every time, if you regularly tend to play games during the evenings.

So we clearly need some form of accelerated time. But I think it would also be really cool if it’s basically deterministic, so that everyone experiences the same weather and seasons at approximately the same time. That way, people can ask their friends how their creatures got on in yesterday’s snowstorm. And we can have Christmas decorations in the village, or summer fetes, at the same time, even if it’s not actually Christmas or Summer in real life.

So anyway, here’s the way I’ve set it up to work. Let me know what you think:

I’ve set game time to run at a rate of one game-hour per minute of real time, during the day, and somewhat faster than that between sunset and sunrise, so that nobody has to sit there and watch their creatures sleep for ages. This feels okay-ish, to me, but it may be too fast – I only tend to play for a few minutes at a time in order to test my code, so I don’t have a feel for it yet. It’s easy to change.

Either way, this is asynchronous time. The very first time you enter the world, it will be late morning, and then time will run along at an hour per minute. But if you quit the game when your creatures are fast asleep, they’ll still be asleep, and still in the dark, next time you come back. Time just stops while we’re not there. This is actually quite important, because obviously the creatures’ brains and biochemistry can’t run when the game isn’t loaded, so if the time of day changed while the game isn’t running, the poor things would get confused. They’d be hungry in the middle of the night, and sleepy in the middle of the day (just like me, come to think of it).

The date, on the other hand, I’ve made deterministic. It may be a somewhat different time of day in my world than it is in yours, but the actual date will be the same for both of us (give or take a day), and hence, so will the weather and the season.

I’ve currently accelerated time by a factor of 12x, such that roughly one month of real time amounts to one year inside the game world. Unlike the time of day, if we play once and see that it’s Winter in Frampton Gurney, but then we don’t play again for another week or two, the seasons will have moved on while we weren’t looking. However, they’ll have moved on in just the same way for everybody. If it’s Summer inside my copy of the game, it will be Summer where you are too.

The exception to this would be if you run the game for a long period without quitting. Now, the day will simply change every time the clock on the church tower strikes midnight, as you would expect. And the seasons will move on accordingly, even if this means it turns to winter inside your game, while everybody else thinks it’s still Summer. This makes sense, for example, if someone wants to do a wolfling run for a whole week without shutting anything down. Day will follow night, and the seasons will still change with the days. 30 days hath September, and all that. But it also makes sense if you just play for a few minutes and then come back a week or more later – time will appear to have passed while the game was shut down, and your seasons will still match everybody else’s. You might have left during the late Winter, but now it’s starting to be Spring and the flowers are coming out. Meanwhile, the time of day will have remained frozen, so creatures who were getting ready for bed last time you played, will still find that it’s getting dark the next time.

The time of day controls the Sun, obviously, and the time of year controls the seasons. But the latter also determines the weather. I’ve built a moderately realistic weather model into the system (which I’ll talk about another time), so that we will all get the same weather at roughly the same time. If there’s a thunderstorm in my world, you will have a thunderstorm too, even if mine occurred at dawn, while yours happened while it was still dark.

This all sounds a bit complicated, now that I try to write it down, but I think it’s the approach that makes the most sense for the most people, in the most places, and for the most play styles. It also makes the most sense for the creatures, which is important in a simulation like this.

Assuming I get a build out by the end of next week, you’ll find that it’s currently mid to late Summer in Frampton Gurney! Specifically, Friday 17th of January here, will be the 28th of July in Frampton. If you don’t run the game until a week later, though, the village will be heading into winter, the trees will be losing their leaves, and the mushrooms will be dying back. So in that case, Merry Christmas!

I don’t actually know what the weather will be like, because I haven’t run the forecast to see what’s coming, but hopefully it will work out okay.


4.8 4 votes
Article Rating
Subscribe
Notify of
29 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Brain Map Wiring

To see full size, click on image and Open Image in New Tab.

General

Moving with the mouse: Hold down right button to look/turn. While the right butt

Glossary of genetics terms

Editing this encyclopedia

Change log

The Simbiosis simulator

Building user mods

Physicality

Information at the software level.

Plant life

Frampton Gurney

Neuroscience

Introduction goes here

Biochemistry

Virtuality

This section of the Encyclopedia is concerned with the virtual world: Frampton G

Biology

Phantasia are much simpler than the animals we find in the natural world, but th

Reproduction

This article is about reproduction from a genetics perspective. See elsewhere fo

Sexes and sex chromosomes

We’ve just seen how reproduction sifts and selects among pairs of alleles,

Dominant versus recessive genes

For any given location on a chromosome pair, we find two versions of a gene – on

In-game help

This section contains the online help for various objects in the game. You can b

Genetics

Phantasians are defined by genes – hundreds of them! Each gene creates som

Encyclopedia Phantasia

Welcome to the Encyclopedia Phantasia. Here you will find detailed information a

Chat Icon Close Icon