September 2024 Update - Good Morning, and Good Night


Another month gone by, another progress update I have to share with you. With the milestone village complete, I'm getting to focus more tightly on specific features and mechanics – which for September, was mostly about the rising and setting of the sun for a full, real time 24 hour day / night cycle. So lets dive in!

As a reminder, subscribing as a premium patron will not charge you until the release of the first playable milestone build, which is still at least a couple months out. An announcement will be made when a release date has been selected.

Day and Night

Last month I mentioned the major theme in September being night, and the transitional effects of day into it. I was... cautious about being too optimistic, because I've learned through many months now just how much of an issue these tasks can end up being to develop. But I'm happy to report that this went a lot smoother than expected! I even had some spare time to work on other features, but first, the top level stuff on how time works in Tales From the Herd:

In a game like this, there are pretty much two roads to choose from, in concerns to handling time of day. There's option A, where the game essentially operates on a sped up version of a 24 clock – say, so that one day in-game equates to 24 minutes in real life.  And there's option B, where the time in your village is supposed to mirror your actual local time and date. I have opted to develop The Herd with the latter style.

The truth of the matter is that both methods have their pros and cons, and there was no easy answer. For example, when time is drastically sped up in the game, you will be able to see more times of day, more often, and certain events or the scheduling of your pony friends in-game will be much less restrictive of when you can engage with them. It might be convenient – but I think that it also reduces the weight and believability of the world.

Especially as I start to bring more of these core mechanics online, you may start to get sick of me beating this drum, but I really want this village to feel like an actual place. That it's been there long before you arrive off of the train, and that it will exist long after you leave it. In a gameplay sense, parts of it are... "meaningless". I don't want every corner of this world to be in service of the player – as odd as that might sound of a video game – and a realistic but lengthy day / night cycle is one such sacrifice I'm looking to try.

Now the good news, if you were hoping for a different outcome: you can still offset the time of day as far as you'd like in your village. So if you find yourself often only having time at night to play, and would like to see some daylight, you're free to set the clock 6 or so hours ahead – kind of like adjusting the village's time zone. And to be clear I'm not saying "never" for time scaling options, but I would like to at least have it as the only option for the first couple of milestone builds, and I can get some player feedback. Of course I'll be in constant discussion with the community, about this and many other aspects of the game.

Now, onto the actual technical details...

 This is what you're used to seeing: the village at day time. Actually getting a working clock in the game wasn't too hard, but handling the visual aspect presented a number of challenges. Here is what night looked like when I first just had the global lights adjust:

For shadows, those are pretty bright, huh?  

This is all because of how I've elected to use light in Tales From the Herd. I didn't come from a game design background, I came from an art background: and so I was expecting to have a lot of control over how shadows in Unity blend with the other colors on screen. And I can't fault Unity for that not being the case – after all, shadows are a lack of light, an absence of something in our control. So when I started development, what was my solution? Well, make all the "shadows" a light source, of course.

Lights in Unity do allow you to adjust them how you would layers in Photoshop or a similar program, letting you change their color, opacity, and perhaps most importantly: how they blend with other colors. So, I set them up that way and said to myself "I'll figure out how to make this work with real time day / night lighting later". This is a classic technique I've developed, where I forgo responsibility for my actions until a much later date.

Well, future me is present me now, and it was time for that tab to get paid. Voilà:

 So, how did I get my shadows to look right in constantly changing lighting conditions? Easy, I update every single shadow in the game every minute of every day.

These shadows (that again, are actually lights) are smart in the sense that at a certain part of day they begin to transition slowly into their "night modes". This is an adjustment that happens over the course of like an hour in the evening and morning when the sun is rising again, where their opacity is nudged to better match the environment. I had no theory for this equation, and really just kept making small adjustments until I thought it looked right. But hey! It works!

And you might be thinking to yourself, "changing every single shadow in the village all the time seems... excessive" and you'd be right! Which brings me to the other big project for September:

Rendering Optimization

This village has gotten a lot bigger since I started working on it back in... February, or whenever. As it turns out, rendering every part of it all the time takes kind of a toll on performance. And I guess Unity does have some kind of built-in system with the camera that's supposed to disable the rendering or visibility of objects that aren't directly in view, but... I haven't noticed it working too well in my game. Or at all, really. So enter my homebrew solution:

 

If we're imagining the little box I'm dragging around the screen as the player (and I mean, it literally is, I thought I'd just clarify since they're too small to properly see that), you can see how the only thing that's ever rendering on screen is what's needed to. This measure has noticeably improved framerates in my tests, and even sped up the loading process of the village itself by about 30%.

Shadows too are now using their only little version of this system, so it's only the ones visible on screen that bother updating their appearance according to the time of day. I've pretty thoroughly tested this rendering cull so that I know none of the nasty pop-in you see in this GIF is actually visible in-game, this is just a little peek behind the curtain.

Advanced Object Save States

A while back, I talked about introducing a little concept called object save states, and used trees as an applicable example: you buck a tree, it drops sticks, and then won't drop sticks again until they "regrow" a literal 24 hours later. Even if you turn off the computer and return later.

This is because when you buck a tree, the game saves a unique file that basically says "There is a tree at coordinates x:42, y:12 that was bucked of its branches at 5:29 pm on Saturday the 19th" or whatever, and when you buck it again in the future, it can check to see if there's data for a tree at that exact position. I can rely on this system, because a tree never moves – but what about the branches it drops? They didn't exist until the player essentially created them, and they can even pickup and change these objects' positions.

These required some retooling of my object save state system, but basically when a stick or any object like it is created, it gets a file assigned to it with a randomly assigned ID, and a last known position. Pickup and move it, and this object has its state updated once again.

Easy enough. The trickier part was actually bringing these objects back into the world after the game was closed and re-opened. Take my little "only render what you need to" technique described earlier, and apply it to these objects. They might not exist at all when you boot the game, but there is a record of a stick being at coordinates x:40, y:15. Once the camera is near enough to these coordinates, the object manager digs through the game's files to find a stick blueprint, clones it, and spawns it at that exact position. And once again, I'm showing you how the sausages are getting made, but you as a little pony explorer out there will never see any of this stuff happen. I mean... that's my hope, at least.

Like pony memories, object states can also host an infinite amount of sub-data. So in the stick instance, it has its color saved and loaded as an RGB value in this sub-data, because even two oak trees aren't likely to have the same trunk / branch colors. How 'bout that?

Fluff

The final thing I wanted to talk about in this update was just that little extra polish I've added to nights. For now at least, the village is perpetually frozen in summer time, and with this comes one of my favorite parts of summer nights (at least here in the Midwest United States): fireflies. These little guys show up late in the evening, and depart just before dawn, adding just a little more distinction between sticking around at night vs. day.

The water also appears kind of strange at night... I think I left the shimmering effect on a little too bright, so it looks almost like it's glowing after the sun sets. But idk, I might keep it, because it's kind of a vibe:

 

And with that, it's time to look ahead!

Coming Up...

The arrival of the first playable build feels like it's actually in sight now; which is exciting, but I don't want to get ahead of myself. I've expanded the village with plenty of land, but now it's time to start actually filling that land with a little more depth. I mean for one thing, the village feels big enough to get lost in at this point, so we're gonna need a map.

If you've been following along for a while now, you might be starting to get the sense that I'm prioritizing immersion and atmosphere, and I don't intend for the map to break that mold. I've got what might be considered some "weird" plans for it, but I really want it to feel like a companion designed to help you appreciate the world, and not just reduce it into a series of straight lines you'll travel.

But that's for another time. For now, and as always, thank you for your support, stay awesome. Ponies rule.

Get Tales From the Herd: Prologue

Comments

Log in with itch.io to leave a comment.

the "not making things too in service of the player" thing makes me think of older entries in the animal crossing series (So like, I think it's a good idea.) still think scaling options is a good idea for an option though!