Saturday, November 25, 2023

Faire Hollow Dev Log #3 - Day / Night Cycle

I hope everyone had a great Thanksgiving!

With the inventory system now firmly behind me, I'm working on some new visual functionality that I've been saving. This feels like a treat: by alternating between more difficult tasks like an inventory system and more exciting visual elements, I keep my motivation high!

I've put together a working day/night cycle, with environmental details like nature sounds (birds in a forest, crickets at night), darkening sky, sunset lighting, moonlight lighting, and a lamp on the building that turns on at dusk. I also added a flashlight for the player, because my idea is that there will be certain areas of the map that are quite dark that you need to explore at night. That led to an interesting predicament: how do you handle shadows when it's a 2D world?

In Godot there's a node called a 2D Light Occluder, which enables you to cast a shadow from a directional 2D light. The flashlight is the perfect use case for this. The trees made it a bit difficult, however, because I wanted the shadow to be cast around the trunk when you're lookomg left and right, but then (using a script) change the behavior of the shadow when you're looking up or down. I paired this with a transparency layer when the player walks behind the branches, and behind the building. I'll leave it to you to tell me how this looks!

I sped up the day/night cycle so you can see dusk approaching in this short demo video:

No comments:

Post a Comment

Faire Hollow Dev Log #11 - Official Trailer

I am thrilled to share the official trailer for Faire Hollow! This has been a month-long effort to create just the right combination and var...