Cobo Makes Games blog

Day and night cycle in games: designing every hour of the day

How Mytheria's day and night cycle works: a 12-minute day, a dangerous moonlit night, a fog that comes once a night, and a dawn every player shares.

One whole day at the edge of the meadow in Mytheria, sped up, from dawn through night
On this page
  1. How does a day and night cycle work in games?
  2. The short answer
  3. How long should a day be in a game?
  4. Make the night dangerous, and let players stay out
  5. Give the night one big event
  6. Make dawn a shared moment
  7. How we built the day and night cycle in Godot
  8. Use it in your own game
  9. A checklist for a day and night cycle

In many games a day and night cycle only changes the light. In Mytheria, our pixel-art co-op game, the hour changes what you do: the day is for gathering and building, the night is dangerous, and every morning starts fresh for everyone at once.

Every clip below is from the game, filmed for this post.

How does a day and night cycle work in games?

The game keeps its own clock that runs faster than real time. Everything that depends on the time of day, like the light, the music, how creatures behave or when shops open, reads that one clock. The design work is deciding how long a day lasts, how the hours are split, and what each part of the day asks of the player.

The short answer

How the day works in Mytheria:

  • A whole day takes 12 real minutes, shown by a clock around the minimap. Every in-game hour lasts 30 seconds, at night as well as during the day.
  • The day runs from 06:00 to 22:00, and the moonlit night from 22:00 to 06:00.
  • At night, creatures on the surface get ten times stronger, but nothing forces you to go home.
  • Once a night, at a moment nobody can predict, the fog comes and you need shelter.
  • At dawn every player's screen goes to sleep and wakes up together, and the world has grown back overnight.
  • One clock drives everything, from the light to the creatures.
The edge of the meadow in Mytheria at one hour of the day

Drag the slider to move through the day

One spot in the game through a whole day, sped up to two seconds per hour. Drag to any hour to see what it means for play.

How long should a day be in a game?

A day should be long enough to get something done, and short enough that the next night comes while you still remember the last one. Ours lasts 12 real minutes: 16 hours of daylight in 8 minutes, then 8 hours of night in 4.

We keep every hour at the same pace. If the last hours of the night ran faster, players would spend them waiting for morning, so the night runs at the same 30 seconds an hour as the day, and you play through all of it.

Make the night dangerous, and let players stay out

At 22:00 the moon rises. On the surface, every creature gets ten times its strength and attacks twice as fast. Underground, in mines and temples, there is no night at all. What the night and its fog do to you, stage by stage, is in night and fog.

Nothing locks you out at nightfall, the Waystones stay open, and nothing is taken from you if you stay out. There's no special night loot either. The night is harder, and whether you go home is up to you.

Give the night one big event

A dangerous night that is the same every time turns into a routine. So once a night, at a moment chosen at random between about 22:30 and 05:00, the fog comes. A horn, a haze at the edge of the screen and a paling moon warn you first, which gives you 22 to 30 seconds to find shelter.

The fog lasts one to three minutes. It slows you to 80% of your speed and brings extra creatures, and outside shelter it takes 3.5% of your health every second, about half a minute from full to nothing.

Shelter is never far. The meadow, anywhere underground, the lantern shrines along the roads (each one marked on your minimap) and restored settlements all keep the fog out. In the fog you can still see a small area around you, and the air around every shelter stays clear, so you can find one.

At four times real speed: the warning, the fog rolling in, and a walk to the lantern shrine, where the fog keeps its distance.

The fog is always gone well before dawn, so the morning never starts in it.

Make dawn a shared moment

In a co-op game, the morning should happen to everyone at the same time. At 06:00 every screen fades to night together: "The world sleeps". While it's dark, the world does its overnight work in one go. Trees and rocks grow back, monster camps restock, a few things move around the island, and the day's news is written. When everyone's game is ready, every screen wakes to the same morning.

Dawn at real speed: the world sleeps, the map shows the area that opened overnight, and the new day begins.

The light through all of this follows the same clock, from golden mist at dawn to a dark but readable night. We wrote a whole post on lighting pixel art across the day.

How we built the day and night cycle in Godot

A single script turns the world's time into the day, the hour and the phase. The HUD clock, the lighting, the mist, the creatures and the forest all ask that script, so they always agree about what time it is.

At nightfall the host works out the whole fog event from the world's seed: when the warning starts, when the fog arrives and when it clears. That plan is saved and sent to every player, so all screens show the same fog at the same moment. The dawn uses the host's clock, which every guest already tracks, so a single timestamp starts the same fade on every screen; more on how guests follow the host's clock is in our post on co-op in Godot.

Tomorrow's world is worked out during the last half minute of the night, a little each frame, so the dawn itself never stutters.

Use it in your own game

A clock that works this way is free to use: Day Night, a Godot 4 add-on with separate day and night lengths, every hour fired in order even when time jumps, and one number to save. It comes with a 2D tint and a 3D sun that follow it, and it's MIT licensed.

A checklist for a day and night cycle

  • Pick a day length players can plan around, and keep every hour at the same pace.
  • Give each part of the day a job in your core loop: the day for building, the night for danger.
  • Make the night harder, and let players choose whether to go home.
  • Add one unpredictable event per night, with a warning and a nearby shelter.
  • In co-op, make dawn one shared moment.
  • Drive everything from one clock.

Further reading

Wishlist Mytheria

Mytheria is a pixel-art co-op adventure for one to four players, coming to Steam for Windows, macOS and Steam Deck. A wishlist is the best way to follow it and to help us.

See the game Join the Discord

Mytheria

Coming to Steam

The store page isn't up yet. Leave your email and we'll tell you when you can wishlist Mytheria on Steam.

We'll send that one email and never share your address.

Windows · macOS · Steam Deck