Gas Expansion and NEO Scavenger Bugs

Continuing yesterday's thrust toward faster prototyping, I worked on some more gas expansion code today.

First, however, I had to fix something I broke in my haste. I accidentally made all UI overlays use a material for tinting, and it caused selection brackets and AI thought bubbles to be washed out. Splitting the GUI items into tile and not-tile allowed me to restore the different materials for different usages.

Once that was done, I made a few more tweaks to the gas expansion code, and I think it's functional enough to use. The next step will be tricky, though: making use of this simulation.

At first, I was thinking I should make an atmospheric processing unit to spew gas into the surrounding areas. But that isn't very realistic, as a life support system would have the unit pipe air into distant rooms and back again, with various ducts and filters along the way. And my gas expansion code seems to break down at long range. E.g. as soon as you get 15-20 tiles away from the source, the gas takes forever to expand.

This is a limitation of the expansion code, which uses a type of cellular automata code. It checks each tile's neighbors and averages the tiles' pressures so they are more alike. As a result, gas can only move so fast through a system, while in reality, it can move close to Mach 1 (and usually does).

More than a few of you have suggested steering away from per-tile calculations and using a room-based system instead. I've been resistant until now since it's a sometimes complicated problem to solve. However, this may be the straw on the proverbial camel's back. It's come up enough times that maybe I should just do it. Everything seemingly might use it, including gas expansion, lighting, privacy, and designated social usage (e.g. head, canteen, storage, etc.).

Before I go down that route, though, I need to do something about doors. Without them, there are no discrete rooms (unless you have a ship of ghosts or teleporting Trekkies). And doors...well, doors are a famous problem in games.

For now, I'm going to create a simple sliding door. 5x1 tiles in size, 3x1 opening. One version closed, the other open. I'll figure out some quick and dirty way to toggle the different modes, some way for pathfinding to cooperate with them, and then, some way for the game to figure out what a room is. Then, convert my tile-based gas expansion code to room-based, and see if that helps speed, performance, realism, and eventually, hooking up an HVAC/Life Support system.

In other news, I'm also trying to figure out an oft-reported NEO Scavenger bug. People say that Autosave is causing all kinds of issues when enabled.

The trouble is, I can't seem to reproduce it in my debugger. Hours of play on vanilla produce nothing. I've just tried an hour of playing with a mod, and still nothing. If anyone can help pin down the trigger, let me know! I'd love to get this sorted out once and for all.

Have a good night, all!


Malacodor's picture

In FTL and WTF crewmen can walk from a room, which was evacuated by a hull breach, to another room with normal air pressure. That's of course unrealistic since opening the door would blow them off their feet. Also, doors should be auto-locked in case of a decompression on one side. However, this would mean that all crewmen in a room with a breach were doomed, which seems too harsh. The logical result is to use airlocks with double doors.

Doors should have a green light along the door frame, which also has a battery, so it'll continue to work in case of a power outage. In an emergency one can just run for the green rectangle. If the door is locked the light turns red.

Ran around with a clown mask before it was cool

dcfedor's picture

I wonder about that explosive decompression trope. I've heard that it'll definitely launch smaller objects at dangerous speeds, but I've also heard the jury's out on whether a human would get tossed about. Knocked over, as you say however, may be the case.

As for double doors, they're certainly a good design choice. But I won't enforce it in the ship editor. Who am I? OSHA? ;)

As for green/red lights, I'm all for things that necessitate colored lights and procedures. I like the green/red indicators. Is there any other state besides green and red you'd need to worry about? Is it, basically:

Green - Both this side and other side are pressurized. Door will open normally.
Red - Either this side or other side are depressurized. Door is locked until overridden.

Dan Fedor - Founder, Blue Bottle Games