I. Love. The cocoons!! Also v scientifically accurate, so thats nice
I also appreciate that you took dog lifespan into account, the idea of my presh pup dying of old age is deeply, deeply upsetting. I'm sure you can come up with creative alternative retirement plan if you really need to take wobbledogs away.
Glad you like them! I'm really fond of them too and I hope they stick around.
---
Did some more work towards getting the base implementation for cocoons all set up. The two big tasks were UI and save/load.
The trick with the UI is that I wanted to have it appear in-world next to the cocoons themselves. This is easy enough but it forced me to solve a problem I'd been dealing with for dog indicators as well. I'd previously been doing my in-world UI entirely in 2D. I'd just convert the needed 3D position to screen coordinates, scale things as appropriate with the camera distance, and do a some manual depth sorting. It mostly worked great but I couldn't have those bits of UI obscured by any 3D objects (at least not without some shader trickery I'm not really up to). It wasn't a huge deal for indicators but these bits of cocoon UI really needed to exist in 3D space, specifically in the case that there were a few hanging right next to each other.
Anyways, my solution wasn't too complicated. I opted to use Unity's worldspace UI canvases with some special code that billboards the elements and allows me to specify a distance to offset the elements along the vector from their associated object's center position to the camera's position.
Aside from accidentally billboarding the dogs themselves, I got things working pretty quick.
As far as the UI's design, for now I'm just keeping it dead simple because I know it's gonna change. There's a timer and then two buttons for cancel and hatch respectively. I expect to do more iteration on this stuff in the future.
The other, larger, task was to get the cocoons working with save/load. This is one of those sorta hidden costs to everything I do in this game. I'm trying to make it as easy for myself as possible to add new things to the save/load flow but complex objects still often demand complex solutions. The specific issues with cocoons were that they have a rather complex little statemachine structure (that isn't as clean as it should be) that I have to rebuild correctly on load, and then that they also can attach themselves to any object in the game, including other cocoons. I had to do a bit of load order restructuring to get this aspect working, the cocoons specifically load in 2 steps to ensure that everything's in the world before we load their attachment data, but I'm pleased to report that they save/load in every case I could think to test at this point.
After putting cocoons on the backburner, I moved on to another large design issue I've been wanting to solve. Feeding the dogs.
Basically, how do I make that fun? Previously you'd just have to keep watch on the pen and go into the inventory to drag out more food whenever dogs seemed like they needed it. This is fine, I guess, but it's not that interesting and I can only imagine it'd get kinda old after a while, especially if you have a lot of hungry dogs mowing through food at a fast rate. Also, how do I deal with food quantity?
For now I'm operating under the assumption that there won't really be money in the game. I don't think this game needs an economy (not to mention I definitely don't want to design one), and I think it'd be more fun anyways if you have unlimited quantities of most things once you've unlocked them so that you can experiment and set up whatever types of scenarios you want.
What I've got for now is an auto-feeder object. Basically a big pipe in the wall that spits out specific quantities of food and keeps track of those objects so it can spit out more whenever they've been consumed or otherwise destroyed.
I quickly mocked this guy up with prefab shapes because that's way faster and easier for me than using blender still, but it'll get replaced with something more legit at some point. You can click on the feeder to change the quantity and type of food it dispenses, and as the game goes on I want you to be able to unlock lots of different types. The idea behind the selection GUI is that it'll show you previews of all the types of food you haven't gotten access to yet, which'll hopefully be a nice little progress indicator (personally, I'm a sucker for this stuff).
The feeder still needs save/load support (which'll be way way easier than the cocoons), and I need to figure out how it interfaces with pen placement/building, but other than that it's pretty much good to go for the time being.
I also fixed a bunch of bugs over the past week, and this morning I was able to play through several cocoon cycles without any error or warning spew, which was pretty awesome to see. Obviously things still have a long long way to go and there are some large obstacles I have to clear, but the pens seem like they're really starting to come together and this is the best I've felt about the project in a while.