Clothes and Body Temperature

Hey Folks! Hope everyone had a good weekend. Unfortunately, some sickness going around the household here, and I may be next in line. Hopefully that won't be.

Back in the space prototype, I've continued the slot work from last week. This time, the focus was on clothing. I had three sets of clothes used on my old crew, so those body part sprites were already done. And last week, I added two sprites for unequipped clothing, so they could be displayed as items on the floor. They were just missing the data files to make them available in-game.

That, however, turned out to have a hurdle to overcome: which slot to use? The browncoat clothing was blue pants, a brown coat (naturally), and shoes. So I could go with the old NS slots and have one for pants, one for the torso, and one for each foot.

However, the EVA suit is a onesie. That means you'd have it cover all your body slots when you put it on. And that makes per-part clothes tricky.

There are some ways to handle that, but for the sake of simplicity, I decided to just have a single "body" slot for now. Each set of clothes is a complete outfit. And some day when I have more time, I can try breaking it into piecemeal clothes.

Once that was done, it was a snap to copy most of the helmet data to make clothes items. And in today's picture, we see Lindsey Lindsey wearing the browncoat outfit, and approaching the EVA suit in the utility room. The user has to manually unequip the current clothes if they want to wear the clothes on the ground, or else the AI will just pick them up. Similarly, one has to manually drop the clothes on the ground before equipping them.

All stuff I hope to smooth out in future work.

Anyway, the clothes now equippable, it was time to look into temperature. The game already tracks temperature as part of the gas dynamics, since pressure and temperature are interdependent. So the remaining work was to make the human body temperature react to ambient temperature. And lucky for me, NS already has code and data for that!

So for the rest of the afternoon, I ported the old NS body temp code over to the space prototype. And converted it's old Fahrenheit data to Kelvin, so it would be compatible with the other values in this new engine.

As of now, crew spawns with core body temp, min and max comfortable temp (dry and wet), passive rewarm rates, and body insulation. The next step is for me to attach this code to the crew and test it out. And finally, to add reasonable stats to the browncoat and EVA suit items for testing.

Hopefully, that'll be smooth sailing. There's a slight chance that I'll run into stats dropping below zero, which can cause bookkeeping issues in the current system. (E.g. if a stat is at 3, and an item causes -5, it bottoms-out at 0. And later, when that thing is removed, the game will "undo" the -5 and bump it up to 5.)

However, there are ways around that issue if it comes up. We'll have to see!

Tags: Ostranauts