Pressure and Temperature Simulation Hitch
Hey Folks! Unfortunately, slow day today. Doctor's appointment in the middle of the afternoon. And some paperwork catch-up in the morning.
However, I did manage to make a little progress on the room atmosphere simulator. In fact, I think I got it working just right when only two rooms were interacting. However, if a room had more than one open door in it (like a corridor or galley), things got weird. Like, pressure would ping-pong around the rooms, spike, and suddenly drop to negative or positive infinity.
Some of it was down to my code processing the same room multiple times in a simulation cycle, and that was pretty easy to fix. However, I think part of it has to do with my hacky attempt at mixing temperatures.
I'm not interested in doing complicated integrations or calculus for extremely accurate gas exchange. (At least, not here.) I just want rough approximations "good enough" to convince the player. Unfortunately, pressure is related to temperature for a gas. So is volume. And in the case where an airlock opens between two rooms with potentially different temperatures and pressures, we have all of those variables changing.
I think one of the ways to work out such a problem is to do things one step at a time. E.g. pressure first, then heat exchange. And I'm going to try that next. Though, probably a part of my problem is that I'm also not very realistic in my calculations, and I'm creating or destroying energy/matter in the process.
Anyway, I'll try again tomorrow to see if I can get something "good enough." Game jam mentality calls, after all!