Sleeping Improvements

Hey Folks! Still in the process of getting crew management to work. Shifts, in particular.

My first task was to get the basic training I mentioned yesterday added. This was fairly simple to do, as I just had to add a few lines of code when crew spawns to give them basic knowledge. Later, I will probably make this data-driven. But I was anxious to keep momentum, so I started testing. And that's where I discovered some problems in the sleep system.

It turns out that my crew was spawning tired, but too uncomfortable to sleep. So they could never catch any Zs. It took me a little while to reacquaint myself with it, but it actually looked like it could work once it got up and running. It was just the starting conditions which failed to get it running.

So I made some changes to start AI with the ability to sleep whenever they want to, and their circadian rhythm unset. Then, if they try to sleep, they'll succeed. And any time they succeed in going to sleep, their circadian rhythm changes to match. (I.e. they'll sleep easier at the same time tomorrow, but have trouble sleeping outside of their rhythm)

I also added a sleeping animation, to make it a bit clearer when they're actually sleeping vs. waiting for sleep to start. This required a few tweaks to code and data to ensure the animation triggers at the right time, the crew teleports into and out of the bed appropriately, and their idle animation is appropriate for when sleeping vs. not. As you can see in today's picture, it's fairly crude. But at least it's clear!

Now that the crew can actually sleep when they're tired, I'll return to the shift settings system, to see how that feels with all the individual components working now.

Tags: Ostranauts


Rovlad's picture

I think NEO Scavenger became a lot more interesting when you've switched over from using specific items for crafting into more arbitrary categories (waterproof, pointy, long etc).
Maybe something like this can be applied here? Don't have conditions strictly apply to needs, but rather have them be related to each other? I dunno, just a sleepy idea. :)

Rovlad's picture

Another idea: include totally "untrained" crew as a challenge mode or even a cheat code / easter egg.
Drinking from toilet, sniffing each others butt, bringing the wrong slippers, the works.

dcfedor's picture

I'd still like that tag-based crafting to apply here. The interaction "SeekSleep" doesn't require a bed, but instead looks for an item with "sheet-shaped," and "soft ." Similarly, "SeekFood" doesn't require a fridge, but rather anything that's a container.

So in practice, AI might attempt to sleep on clothes and search toilets for food.

The one thing the initial training does is give them a bit of a hint in how to satisfy needs. A blank slate will try random stuff until it gets lucky, then will usually prefer whatever succeeded most. But sometimes, they get hooked on fulfilling emotional needs because they made progress there, and totally ignore sleep because they haven't yet stumbled upon a solution.

That's not wrong, necessarily. Like you said, it'd be an interesting challenge mode. The training is just there for folks who want their crew to be slightly more than helpless :)

Dan Fedor - Founder, Blue Bottle Games