PV = nRT
Hey Folks! Hope everyone had a good weekend. We visited some friends for the first time since leaving Edmonton, and had a great time eating and playing board games. I think we are all set to do that again sometime soon. We had all but written-off board games since the little one was born. But it appears to be possible to wrangle and play at the same time!
Back on the space frontier, work continues on the room system. Last week, I almost got the rooms hooked-up in such a way that they could talk to each other and exchange their gases when I clicked on the door between them. Of course, it turned out not to be that simple. Clicking on the door did nothing.
Once I sorted that issue out, it opened up a new can of worms. It turns out the rooms didn't actually see each other through the doors because the doors acted like walls until opened. In essence, that's all they were: walls that magically vanished when clicked, so the room detection script didn't notice anything special about them.
I decided to create a new object type: portals. This way, the game could understand the special nature of the door when it encountered them during room calculations. Each room now stores a list of doors it has, and each door lists the rooms it connects. Thus, rooms can check doors for being opened or closed, and simulate gas exchange accordingly.
One problem down. And in fact, this worked pretty well. I was able to get rooms to fill with a gas, and spread it to adjoining rooms when the door between them opened.
However, this didn't account at all for different room sizes. If a supply closet had 1 atmosphere of pressure in it, and it opened into a giant cargo bay with no atmosphere, the closet and bay would end up at about 0.5 atmospheres each. Not really accurate. Plus, I'd like to work temperature in here somehow. Even if it doesn't figure into the gas exchange (which it would), I at least want there to be a danger of freezing to death or overheating if environmental controls fail. And this temperature issue should be able to move into adjoining rooms if there are no sealed doors.
So I've started working on that now. And I've actually got it running! Except, the math is pretty wrong, as it turns out. I have a few calculations in there that cause gas to be spontaneously created and/or destroyed when doors open, and I have to find out where.
That's all for today. See everyone tomorrow!