Self-care is important! And that's not a whole lot of time in the grand scheme of things. But I'm glad to see another update!
Digging looks good!
Glad that you realized in time that you needed a break - a true burn-out is a thing to avoid at all costs!
Thanks, yeah it was definitely the right call. I'm feeling way better about working now and it's been a VERY nice change of pace, haha.
--
So, let's talk about why I added digging. Digging wasn't the goal in and of itself, although I do think it's a cool feature and plan to add a bit more to it soon. The real reason I bit off digging was as part of my new goal of adding features that autonomously modify the space you play in. The dogs themselves already change, but your pen has always been fairly static. Sure you can decorate it, but that's a very controlled thing and you can't watch it unfold. It's something you do yourself. Holes obviously modify the pen, but they're also important for another reason, which is generating dirt.
Dirt is, of course, something a dog can eat.
But it's also an important material for dogs in that it's what they use to construct their own personal dens! Dogs will studiously go about their business of digging holes and creating dirt so that they can grab that dirt and bring it back to their den location to slowly construct a little place to hang out.
The idea of having dogs construct little structures like this was really cool to me. Dogs never really had much of a goal other than filling their immediate needs. They needed long term goals as well as short term goals, and I think things like this will make them more fun to watch and make them feel more alive.
My initial idea for dens was that they were little hidden areas for dogs to go hide away. As part of that I needed a way to actually hide dogs. Unfortunately, enabling/disabling active rigidbody chains isn't the most straightforward thing in the world, and since there's a time cost to creating a dog, I didn't want to just remove it and then regenerate it again every time it went into/out of the den itself.
If you just disable and then enable a dog, this is what happens.
Joint constraints reset and everything just generally turns out badly.
After this obviously didn't work, I experimented with just setting all the dog's rigidbodies to kinematic and then moving it out of the game's view. It wasn't that elegant, but it did work.
Some potential issues with this but it was enough to let me prototype the dens in full.
What was immediately obvious, however, is that when implemented this way, dens were actively not fun. I could very easily see people trying to stop their dogs from creating dens, because if a dog was prone to hanging out inside of one, all of the sudden you wouldn't be able to see them or interact with them any more! I'd inadvertently created a feature that papered over the main appeal of the game!
Thinking a bit more, I realized it might not be that hard to make den interiors actual physical locations. If dogs physically transported themselves to interior locations, then you could still watch them. Not only that, but it'd allow for a bunch more behaviors surrounding dens (hoarding objects, laying eggs in dens, excavating dens further from inside, etc, etc) and add a ton to the feature in general.
The road to interiors was... perilous...
The den interiors themselves are spawned outside of the camera clip view. When the camera moves to an interior it changes its skybox to pure black and shrinks the far clip plane so that only the interior you're focusing on can be seen. Dogs are teleported to and from these locations when entering/exiting dens.
Teleporting the dogs is not super straightforward, and going both into and out of dens caused its fair share of bugs.
These aren't fully solved yet, but they're definitely in that "good enough to move on" state, and there's enough error handling to stop things from permanently breaking.
The additional problem here was with object connections. Dogs can hold objects and other dogs in their mouths, and cocoons can attach themselves to objects and dogs as well. This means that has to be keeping track of everything its attached to or that is attached to it so it can recursively handle it all accordingly whenever it teleports. Currently dogs can bring objects into dens with them, but they cannot bring along other dogs or cocoons.
Dogs will go through the entire construction process, and will use owned dens as preferred locations for behaviors such as laying eggs and sleeping. They'll also be discouraged from doing certain things like pooping in their own dens. In general they'll try not to ever enter a den owned by another dog, but personality modifiers are in effect for this stuff as well.
I'm already excited about the state of the feature as it is now, but once I've got real graphics for these things I think it'll be really really cool.
The next step here is getting the dogs to intelligently choose locations for their dens instead of just checking a few canned locations, and then hopefully to make it so they get angry if they see another dog hanging out in a den they own. The feature's pretty close to where I want it for the time being.
And then the other big update is that I've started working with someone on sound and music. I'll share once things are a bit further along, but I'm really happy with how it's coming together and I'm super glad the game finally has some noise! Turns out things are more satisfying with sound. Who knew!