Computational Feasibility of Ship Atmosphere

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,168
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    I was building an airlock on my ship the other day, and thought about how much more fun it would be if it actually had a gameplay purpose rather than just a roleplay one. The first problem that needs to be overcome is how to tell if a space is sealed, and do it without murdering everyone's CPU all the time.

    My idea is thus:
    • When there's nothing creating a breathable atmosphere, make no calculations. There's no atmosphere to calculate.
    • When a life support unit on a ship is trying to create breathable atmosphere, check for an enclosed space. To prevent spamming these calculations, there could be a high power requirement or a resource cost (air, easily vacuumed up from a planet) to establish an atmosphere where there was none before. A quick check is raycasting to see if there is a path to space in any direction. If not, block based calculations can check for certain whether a space is enclosed.
    • When an atmosphere is established, save a mesh in the shape of the atmosphere with the ship.
    • If a block is destroyed or a door is opened next to the mesh, see if air leaks.
      • First check if there is an established atmosphere on the other side. If so, do nothing.
      • If not, air starts leaking and the game raycasts to see if it leaks to space or another chamber of the ship. If it leaks to space, the atmosphere begins leaking away rapidly and cannot be reestablished until the area is sealed.
      • If none of the initial rays reach space, block-based calculations check if the space is really sealed, then find the size of the space and reduce the pressure of the air as it fills the other space. If the pressure drops too low, unprotected astronauts may begin to suffocate. Atmosphere may be repressurized immediately.
    • A ship built on a planet's surface would be filled by the planet's atmosphere. Upon leaving the atmosphere, the game would have to know if the ship is sealed. I haven't got any bright ideas for this yet...
    • A provision should be made for sealing across multiple entities docked together so that people don't have to put on their helmets to walk between ships docked together with USDs (docking collars).
    • IMPORTANT EDIT: While block-to-block calculations might be too computationally heavy, I have another alternative idea.
      • Start with a virtual box made of 1-block square tiles around the atmosphere generator. It expands outward block by block, one meter on each side at a time.
      • When it runs into a block, the contacting squares disappear and the rest continues outward.
      • When a square advances into a wider space, it raycasts for space, then if no LOS to space is detected the surface widens to the walls and continues outward.
      • EDIT again: Not every tile need send out raycasts. One tile per opening should be enough. This is just to check if the face just exited the ship, in which case calculations need not continue as the space is definitely not sealed.
      • The atmosphere is successfully created when all tiles of the virtual box run into something and are deleted.
    Gameplay mechanics:

    Astronauts would have limited oxygen in their suits, and would need to enter an oxygen-balanced environment to refill. The suit's oxygen would fill slowly over time when the astronaut's helmet is off, and could be filled almost instantly at a refilling station, which would draw power from the structure it is mounted to in order to refill the astronaut's O2 tanks and dispose of waste CO2.

    Life support systems would center around a single block called an Atmosphere Module. When activated, it attempts to create an atmosphere in the area where it is. If the area is open to space, this will not work.

    Establishing an atmosphere takes a little time time and a substantial amount of power depending on the size of the area to be filled. Filling a 27 m^3 airlock for example might take about a second and 270 energy. Once an atmosphere is established, there is negligible to no energy draw to keep it, a small draw per person breathing it, and a slightly bigger draw for a refilling O2 tank. Something on the order of 1 e/sec per 1000 m^3 to maintain, 5 e/sec per person breathing the air, and 50 e/sec for a tank refilling from the ambient air.

    Planetary atmospheres could have different effects on astronauts with their helmets off. These are just ideas:
    • Green: Rich atmosphere increases athletic ability. Running speed increases.
    • Ice: Chilly. Standing in one place too long with your helmet off will cause you to get cold and move sluggishly, but thick air lets you run slightly faster as long as you remain active.
    • Desert: M-class atmosphere increases running speed slightly, but if you run too much you will get hot and slow down slightly instead.
    • Red: Poor atmosphere quality reduces running speed.
    • Purple: Makes you feel funny. Breathing the air accumulates a rosy tint in your vision which leaves at a similar rate after you stop breathing the strange air. Fun extra: eating plants from this planet has a similar effect, plus a slight view shimmer.
    Any of these effects will be negated if you put your helmet on.
     
    Last edited:

    Jh

    Joined
    Jan 10, 2015
    Messages
    83
    Reaction score
    9
    • Legacy Citizen
    I LOVE IT!
    The effect idea for the planets is awesome! (although I have one moan. Wouldn't really work for aliens on RP servers who don't have the same needs and such as humans. Other then that I really like it.)
     
    Joined
    May 23, 2015
    Messages
    86
    Reaction score
    13
    The idea is cool, but seems needlessly complicated and restricting. The game is, and seems to plan to continue to be about creative building, and restricting people to need to create enclosed spaces seems pretty needless. also:
    How will stations get this air?
    How will new players, who start in space by a shop, get this air?
    While the computation is fairly streamlined, is the impact really worth the feature?
    Being stranded becomes a death-scenario, instead of a difficult, but survivable one. Is this acceptable?
    Will the atmosphere effect people inside blocks, i.e the pilot, gunners, ect?
    How will this affect turrets that were intended to be player used?
    Certain small fighters have no interior, as well as the standard 3-block zippy, will this system render these craft completely obsolete?
     

    Jh

    Joined
    Jan 10, 2015
    Messages
    83
    Reaction score
    9
    • Legacy Citizen
    The idea is cool, but seems needlessly complicated and restricting. The game is, and seems to plan to continue to be about creative building, and restricting people to need to create enclosed spaces seems pretty needless. also:
    How will stations get this air?
    How will new players, who start in space by a shop, get this air?
    While the computation is fairly streamlined, is the impact really worth the feature?
    Being stranded becomes a death-scenario, instead of a difficult, but survivable one. Is this acceptable?
    Will the atmosphere effect people inside blocks, i.e the pilot, gunners, ect?
    How will this affect turrets that were intended to be player used?
    Certain small fighters have no interior, as well as the standard 3-block zippy, will this system render these craft completely obsolete?

    Who said the game is and seems to plan to continue to be about creative building? If this were the case why planned mobs. Also if this were all this game was capable of I'd of stopped playing a long time ago.
     
    Joined
    May 23, 2015
    Messages
    86
    Reaction score
    13
    Who said the game is and seems to plan to continue to be about creative building? If this were the case why planned mobs. Also if this were all this game was capable of I'd of stopped playing a long time ago.
    I said that, because it continues to add new ways to be creative, the latest being rails. Mobs don't detract from the creative aspect either, and just because there are things that aren't immediately about building, doesn't mean the core focus isn't building. And that was not the only complaint/issue with the idea, there was a whole list of issues I saw after thinking about it
     

    Jh

    Joined
    Jan 10, 2015
    Messages
    83
    Reaction score
    9
    • Legacy Citizen
    Yes I know you did and the problems are valid.
    I just don't like people saying this is basically a building game. This game is capable of much more.
     

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,168
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    How will stations get this air?
    Scoop it up from a planet to get things running, and then forget about it.
    How will new players, who start in space by a shop, get this air?
    Shops should have cheap or free air. (Free air actually makes sense if it's easy to get - it encourages people to shop there.) Players should spawn on planets anyway, IMO.

    In both cases, that's only if air is a limited resource, which it probably would NOT be in sandbox where someone with your implied taste would probably be playing.
    While the computation is fairly streamlined, is the impact really worth the feature?
    Absolutely.
    Being stranded becomes a death-scenario, instead of a difficult, but survivable one. Is this acceptable?
    Define "stranded." If you mean in the middle of space with no core to fly away in, it's just as well. You'll get nowhere. If you just mean no air, you could probably get back to a shop or a planet in time unless you're far out in the void. Again, sandbox players probably won't need to worry about this anyway, just survival players who like this kind of risk.
    Will the atmosphere effect people inside blocks, i.e the pilot, gunners, ect?
    The whole "inside of blocks" thing needs to be removed from the game. It's freaking weird. Until then, I'd say no.
    How will this affect turrets that were intended to be player used?
    Add life support to the turret or wear your helmet.
    Certain small fighters have no interior, as well as the standard 3-block zippy, will this system render these craft completely obsolete?
    A fighter needs at least a tiny space to get the pilot inside. Pressurize this space. Fighters with an exposed core would be rendered "short range." The three-block "zippy" is like clinging to a bottle rocket in space. It isn't a real ship, so wear your helmet.

    If oxygen lasts a reasonable amount of time (1 hour, perhaps), short range fighters and three-block ships will still be usable.

    The idea is cool, but seems needlessly complicated and restricting. The game is, and seems to plan to continue to be about creative building, and restricting people to need to create enclosed spaces seems pretty needless.
    I'm not even going to bother...
     
    Joined
    May 23, 2015
    Messages
    86
    Reaction score
    13
    someone with your implied taste
    I like to build, you two make that sound like a sin, jeez

    Though you did indeed answer most of my concerns, and you seem to be suggesting you have air until you get a hole in your ship, which is not what i understood from the OP, which made it sound like you would need to constantly refuel your LS, which would be way too tedious for my tastes. an hour long air tank would be great, i was thinking like 5 min long. I guess I went straight to worst case scenario for this whole thing >.>

    To hit a more personal level, I don't know if you and JH mean it, but you both came across as kind of hostile, where the only thing I said that wasn't a 100% legitimate concern was
    The game is, and seems to plan to continue to be about creative building, and restricting people to need to create enclosed spaces seems pretty needless
    if you didn't mean too, i'm sorry, it's just how i read it
     

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,168
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    I like to build, you two make that sound like a sin, jeez
    I like to build too, silly. :P I just prefer to build in a richer environment where there's more to do.

    Though you did indeed answer most of my concerns, and you seem to be suggesting you have air until you get a hole in your ship, which is not what i understood from the OP, which made it sound like you would need to constantly refuel your LS, which would be way too tedious for my tastes. an hour long air tank would be great, i was thinking like 5 min long. I guess I went straight to worst case scenario for this whole thing >.>
    My intention was that air would only be used for filling up an area that was previously vacuum. I guess that wasn't clear enough. The only thing requiring regular resupply would be an airlock, and if sealing across multiple entities works, resupply needs can be minimized by the use of universal docking ports.

    To hit a more personal level, I don't know if you and JH mean it, but you both came across as kind of hostile, where the only thing I said that wasn't a 100% legitimate concern was if you didn't mean too, i'm sorry, it's just how i read it
    I didn't mean to come across hostile. Please don't pull the "building game" card though. It's not productive and doesn't make any sense. A sizable portion of the starmade community appears to find survival content desirable.
     
    Joined
    May 23, 2015
    Messages
    86
    Reaction score
    13
    I like to build too, silly. :p I just prefer to build in a richer environment where there's more to do.


    My intention was that air would only be used for filling up an area that was previously vacuum. I guess that wasn't clear enough. The only thing requiring regular resupply would be an airlock, and if sealing across multiple entities works, resupply needs can be minimized by the use of universal docking ports.


    I didn't mean to come across hostile. Please don't pull the "building game" card though. It's not productive and doesn't make any sense. A sizable portion of the starmade community appears to find survival content desirable.
    I'd love more survival aspect, my concern was this would be too complicated, with pressure, and atmosphere effects, and yadda yadda, but the more binary system you propose sounds much better than my initial assumptions. also, would the proposed calculation be able to take rail-docked entities into consideration, for bay doors, pop-out things, and elevators?
     

    Jh

    Joined
    Jan 10, 2015
    Messages
    83
    Reaction score
    9
    • Legacy Citizen
    If we get air i think we should get a walk through wall. One that keeps the air in but you can hop in your ship and fly through it. (To make hangar bays) i think it could also depend on the power. Say if you dropped below a certain point the walls would 'turn off' and vaccum would flood in. Making the need for doors still nescisary.
     
    Joined
    May 19, 2015
    Messages
    267
    Reaction score
    19
    • Purchased!
    I think the key thing with this is that we want to see more things added that we can do, not more things added that we need to do.
    Maybe this could be explored in conjunction with the fauna update, so that you can't breed animals on stations without pressurizing the stations, and can't transport them unless you have a pressurized transport pod.
    But for players... it would just be restricting. Starmade isn't supposed to be a simulator, it's supposed to be a sandbox. Simulator-sandboxes do exist, yes, but if we restrict players in this way it just starts to feel too close to Space Engineers, and starmade stops being its own thing.
     
    Joined
    May 23, 2015
    Messages
    86
    Reaction score
    13
    maybe flora in an atmosphere generate more atmosphere? making a) a use for plants before the flora update b) reasons to have a pretty greenery and c) a way to replace air lost through airlock that wont have you dipping into planets every friday
     
    • Like
    Reactions: jgames666 and Lecic

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,168
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    If we get air i think we should get a walk through wall. One that keeps the air in but you can hop in your ship and fly through it. (To make hangar bays) i think it could also depend on the power. Say if you dropped below a certain point the walls would 'turn off' and vaccum would flood in. Making the need for doors still nescisary.
    Personnel-permeable force field. I like it.

    But for players... it would just be restricting.
    Nah.

    also, would the proposed calculation be able to take rail-docked entities into consideration, for bay doors, pop-out things, and elevators?
    That would complicate things, but might be possible for non-moving, rail-docked things. At least, I hope so. The standardized docking ports would lose half their purpose otherwise. I'll think of something and edit it into the OP sometime.
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    I hate to be a party-pooper, but I think this will add additional heavy data processing at the point where we need it least: combat.

    As an alternative, I'd recommend a suggestion that was given in a previous air-suggestion thread: a life-support block that provides atmospheric effect in a contained, limited space around it, regardless of what other blocks are present. This immediately removes the need to calculate leaks. You have to hand-wave it as a small permeable shield generator that contains a sphere of atmosphere, but since we already have shields and forcefields, that explanation is not much of a stretch.


    Illustration: My Counter-proposal already has a kind-of precedent in pop scifi media. Explorers (1985)

    Adjacent life-support blocks could increase the radius of the air sphere. Destroyed life support blocks simply reduces the sphere size. If the last block in the group is destroyed, the atmosphere is simply gone. Unfortunately, this will place atmosphere outside of where it should be, but StarMade is a game about super-future science fiction with really advanced technology, so those who are interested in the role-play aspects will generally create enclosed hulls to simulate atmosphere-containment on their own.

    As for explosive decompression, if it is planned by the builder, like having an airlock ejection mechanism, the builder will simply need to accommodate it with a push-system to simulate the blow-out effect of rapidly escaping air. If it is not planned, like a hull breach in the middle of combat, it's reasonable to say that our technologically-advanced ships will have automatic, emergency atmosphere-retention force fields.

    Additional idea: to simulate a living ecosystem for things like biospheres and other similar artificial "natural environments", I think any plant block group (effectively, any two clumps of grass or a tree) that intersects the life-support block's atmosphere radius should act like an adjacent life support block and add to the atmosphere radius. That way, you could have a single life-support block in a large biosphere that supplies atmosphere to the whole thing with sufficient nearby plants.

     
    Joined
    May 23, 2015
    Messages
    86
    Reaction score
    13
    I agree that that would be a simpler solution, and maybe it could be switched to the other when the game is more optimized?

    And I love the idea for a biosphere, plus you can have a rail-docking biosphere, so you could move it around if you needed/wanted
     

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,168
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    I hate to be a party-pooper, but I think this will add additional heavy data processing at the point where we need it least: combat.
    Ah, not so, my good man. Computation of leaks could be fairly simple. Save the shape of the atmosphere and if a block is destroyed next to it, see if it exposes the area to vacuum. If it's a hole caused by weapons fire, the other side shouldn't be sealed so there's little need to actually check.The only time a weapon can destroy stuff and leave a seal (probably a bad seal, but we don't need to simulate that) is a beam hitting something and not destroying the first block, but destroying blocks beneath. In that case, it would expose only the area where blocks were destroyed, not any vacuum. Besides, this ONLY happens when a pressurized space is hit, and it only takes cannon round to depressurize an area.

    I really don't think this would have a significant impact on CPU. The only way to know for sure is a message from Schema should he happen to notice this thread.
     
    Joined
    Jan 16, 2015
    Messages
    95
    Reaction score
    13
    • Legacy Citizen 2
    • Purchased!
    I would love this, it would make people more weary of going into combat and make planet hopping actually necessary, because other than a poor man's base, planets are kind of useless in later game. This also makes sense for the very much hoped for survival update, making planets and survival systems useful.
     

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,168
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    Come to think of it, I think shields store a mesh (shape) in order to render the shield hit effect. If this is correct, the life support system could use this to search for enclosed spaces that can be pressurized. Some of the code might need to be rewritten (I have no idea; I obviously don't have access to the source code), but it's an idea anyway.
     

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    Come to think of it, I think shields store a mesh (shape) in order to render the shield hit effect. If this is correct, the life support system could use this to search for enclosed spaces that can be pressurized. Some of the code might need to be rewritten (I have no idea; I obviously don't have access to the source code), but it's an idea anyway.
    No, they don't store any bounding surface information... It just kind of shades in the shield hit effect everywhere under the impact point. (Even, if memory serves, completely unconnected surfaces.)