Heaters and Thermostats

Hey Folks! I added a thermostat/temperature alarm earlier today, and by the end of the day, just barely managed to get it to talk to the heater. So as of now, we can automatically turn off the heat when it becomes too hot!

While getting the thermostat setup, I used the pressure sensor as a template. And I noticed that it was actually really close to being completely data-driven and universal. So I cloned the code for the pressure sensor to make a generic "Sensor" class. Now, in theory, I can use it in a variety of different ways just based on the data supplied to it.

There was still a fair amount of data involved, however. State changing interactions, flags to indicate which state each was in, new color and light definitions, and new triggers were all part of the deal.

The thermostat itself looks a lot like the pressure sensors, except it has 4 states (off, white, red, blue) instead of 3 (off, red, green). And since this was the third alarm with a similar silhouette, I decided to edit the patterns of each sprite to distinguish them a bit.

Getting the heater to talk to the sensor was a similar job, as I could basically reuse a lot of the existing code from the air pump/pressure sensor linking code. In fact, I basically just reused the air pump's UI with different data and all seemed to work ok.

So as of now, our heater has two modes: one where it just heats as long as it has power, and the other where it listens for a "too cold" signal from a linked thermostat. Linking can be done either during ship editing, or via sending a crew over there to open the UI.

There's still more I could add. For one thing, the thermostat currently has hot/cold thresholds set by the data, and this would ideally be exposed via the UI on the thermostat. There's also currently no difference in power usage between "on and heating" and "just on." Both air pumps and heaters suffer from this. There's no cooling yet. No humidity control. No way to reduce pressure without opening an airlock. And no CO2 scrubbing or air processing.

So there's more stuff I could add to life support. Similarly, the crew could use some penalties for freezing/overheating. Or things like pain.

Basically, still a lot of content and data to add. I'll have to give it some thought overnight to see if I want to add more of that stuff, or instead try adding a new salvage tool or process. The good news, however, is that this means we now have two new things worth looting in a derelict, and new tools for making our ship more hospitable!

Tags: Ostranauts