Heating Done, and LoS Improvement

Hey Folks! Feels like I may be on the mend again, as today was the first I've felt better since this all started. And I managed to finish up a few tasks!

First, the heater code seems to be in a good place. Unsurprisingly, there were a few errors in my approach. For one thing, the heat transfer due to black body radiation depends on the temperature difference between the object and ambient air, which I neglected. Accounting for that means the air heats up less and less as it approaches the heating body's temperature.

I also had an order-of-operations error in the way I calculated radiant power. Should've been (T1^4 - T2^4) and I was doing (T1-T2)^4. Oops.

I did a bit more refinement of the stats used in heating and the body heat stuff, since there were a lot of overlapping pieces. They now share a StatSolidTemp variable, which lets me heat the air with a variable body heat instead of assuming 310K at all times. I also added a slight fudge factor for low pressure cases, since it felt like near-vacuum rooms were heating too fast.

The result is a pretty realistic behavior when humans are walking around and donning suits. Evacuated rooms don't change much when a human is present, but air-filled rooms see their temps creep up ever so slowly, based on room volume and relative temperatures. And when a human puts an EVA suit on, the air in the suit warms up quickly at first, then slows as it approaches equilibrium with the wearer's body.

The human seems to indicate the system works (see screenshot debug text on left), but an actual heater is probably next.

With a little time to spare at the end of the day, I tackled the line of sight (LoS) system again. This time, trying to fix the issue of weird sight lines around corners, and missing corners when in a room. A bit of research into how roguelikes do it led me to an interesting (and simple) trick: don't make your walls square. Make them diamond-shaped instead. (At least, as far as the LoS code is concerned.) That, and I was missing diagonal adjacent tiles when walking the grid during calculations.

The diamond idea allows lines of sight to traverse corners and narrow diagonal corridors more easily than orthogonal blockers. And you can see the result in today's screenshot. We have a much more useful LoS from Maria into the adjoining room. Plus, she can see the corners of her current room! It looks a lot more natural now as she walks around.

I still think performance needs work, but at least it looks pretty in the meantime :)

Next week, I'll probably tackle space heaters for rooms, and maybe more tools. And a bit of the time between tasks on more LoS stuff. Have a good weekend, all!

Tags: Ostranauts