More Thermoregulation, PLSS, and Heaters

Hey Folks! Finished work today on body thermoregulation, as well as starting on heaters for life support.

After a good night's sleep, I eventually decided on a somewhat simplified system for dealing with the body's thermoregulation. Basically, a human has a safe range of temperatures within which the body will gradually approach ideal core temperature (rate is about 15 degrees K per hour, or roughly what hospitals aim for when restoring hypothermic patients). Anything outside of that range gradually gains or loses heat based on a cubic function. The further outside of safe temperatures, the faster the core body temp changes.

It's still a function a lot like the graph I showed yesterday, except I fudged the numbers to arrive at something that would freeze a human to death in about 3 hours at 0C if they were naked. As always, there's room for tweaking later.

Once that was done, I took a brief break from code to add a Primary (or Portable) Life Support System (PLSS) to my orange EVA suit. Since we have an O2 supply, heater, cooler, and power, there's gotta be somewhere to put all that junk. So if you look at today's screenshot, you'll see it now has a PLSS backpack. I also decided to make the helmet transparent, along with a few other tweaks, so it looks a bit nicer.

After a few minor bug fixes and debugging tweaks, I moved on to my next system: heating.

The spaceship's rooms are going to need thermal regulation, too, since we won't be in EVA suits all the time. So that means something to heat and cool. Initially, I was going to delve into specific heats, conduction, radiation, and try to tie it all together. But thermodynamics is a fairly complex topic, and trying to do too much at once is likely to fail.

So for now, I'm sticking with a simple space heater similar to a radiator. It allows me to setup something that'll work in an HVAC system, as well as model things like body heat and fires affecting room temperature.

Heat is expressed in Watts, much like you'd see on a consumer heater. And then I use a fairly simple equation with molar specific heat to get delta-T for the room's gas. Then, any item with a stat for heat output gets this heater component added, and voila! The room gets warmer when it's there.

However, there are still some kinks to sort out.

For one thing, I had to adjust the heat output for the volume of the room. Since not all gas molecules are in contact with the heater at once, I had to scale down the heating effects based on the size of the heater compared to the room. A heater in a tiny box will heat the air faster than in a cavernous room, assuming the same number of moles in each container.

It seems to work for rooms now, but I'm seeing some weird effects still in the EVA suit. The wearer's body heat is superheating the air in the suit. So it appears I still have a bug in the code.

Hopefully, though, once this is sorted out, we'll be a step closer to a complete life support system. Both on ships and in EVA suits!

Tags: Ostranauts


Asthepanda2iscool2's picture

Turning into a ball of super heated gas probably isn't ideal for the crew, and almost certainly wasn't in their job description!

In the meantime, I have a quick question concerning ammo expenditure for NS. I want to make it so that firing a weapon leaves behind a spent shell/casing so that ammo can be reloaded. Could this be done?

Rar! Rar rar rar! Thanks for reading :)

ra1's picture

It looks like you are having way to much fun developing this game. I hope the players experience it as well.

dcfedor's picture

@Asthepanda2iscool2, off-hand, it does seem like a spent shell should be doable. My first instinct would be to experiment with a condition that has the "AddItemGround" field in it. If a battlemove applied that condition to a combatant, you could drop a treasure on the ground each attack.

However, that might require a specific battle move for each ammo type.

Alternatively, you could mess with the "m_bTransfer" property on some attacks. It'll normally try to discharge the ammo used before slotting it into the wound, which might give you some options. E.g. discharging a bullet could do -100% durability to it, degrading it into a shell. Then, the game would try to socket that shell in the wound.

I think if the shell cannot be socketed, it is deleted. But you might be able to do something clever with it if it sockets. E.g. maybe socketing it causes AddItemGround to spawn a shell, or maybe the shell instantly degrades into an unsocketable version...

It probably wouldn't be easy, but it might be doable.

@ra1, I know, I know. I have to admit, it's nice to feel motivated again after such a long stretch of doubt. I think adding these tools and features has rekindled my hope, especially since now the player can actually make stuff happen besides flying/walking around.

But yeah, I need to get this into a state where I can share it asap.

Dan Fedor - Founder, Blue Bottle Games