Computational Feasibility of Ship Atmosphere

    Jh

    Joined
    Jan 10, 2015
    Messages
    83
    Reaction score
    9
    • Legacy Citizen
    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.

    Its not a bad idea and biospheres sound awesome. Its just that I am worried about having them on ships. It seems yo me you'd have to have lots of the nlocks to give air to something like a titan. How much space would you waste chucking air blocks at it that you could put more useful blocks in.
     
    Joined
    Jun 24, 2013
    Messages
    29
    Reaction score
    1
    It seems to me that if you are worrying about more calculations during battle, you shouldn't be. If the atmosphere only checks if it's sealed when some of the blocks holding it in are blown up, and then the atmosphere 'goes away' once it realizes that it isn't contained, then each atmosphere on a ship can only be depressurized once, and after that will have no further performance impact (just require the atmosphere modules to be player or logic-activated, and auto-deactivate when the atmosphere leaks away.)

    As for requiring planetside pitstops to replenish depleted atmosphere for airlocks or after battles, compressed air tanks could also be implemented for air storage, both for large ships and stations.

    On a tangentially related note, does anyone know how many block ids are left to be used for this kind of thing?
     
    Joined
    Aug 21, 2015
    Messages
    165
    Reaction score
    87
    • Community Content - Bronze 1
    • Purchased!
    It seems to me that if you are worrying about more calculations during battle, you shouldn't be. If the atmosphere only checks if it's sealed when some of the blocks holding it in are blown up, and then the atmosphere 'goes away' once it realizes that it isn't contained, then each atmosphere on a ship can only be depressurized once, and after that will have no further performance impact (just require the atmosphere modules to be player or logic-activated, and auto-deactivate when the atmosphere leaks away.)
    ...
    The issue is that every time a block adjacent to atmosphere is destroyed, you have to do a random walk or raycast + walk to exhaust your new container if you don't find vacuum early.

    As an example, say I've punched a deep hole through a flat side of a cube ship, opening a tunnel from space to a cubic atmosphere inside the ship. The game doesn't know for sure there's a connection between atmosphere and vacuum, even though its obvious to a player observer. The game, at best, does a number of ray casts in a spread pattern from the broken atmosphere edge and hits vacuum, knowing it needs to evacuate all the connected atmosphere. At worst, oblique hits to the ship left an indirect path from the atmosphere to vacuum, so a random walk has to be employed until:
    1. A new "wall" is walked and filled in around the atmosphere. (Think rupturing an internal pressurized "crew" region in an otherwise unpressurized ship.) The atmosphere is then updated to reflect its new extents. If there's a large empty volume inside a ship, walking this volume could take a while. Ray casting tricks may not even help much, if it's not a large open volume.
    2. A path is walked connecting atmosphere to another in-ship atmosphere. If the second, found atmosphere bounds the first (walls it off from anything else), you merge the two atmospheres into one. If the second atmosphere doesn't fully bound the first, you merge the two atmospheres and continue your walk.
    3. A path is walked connecting ship atmosphere to an external atmosphere (like a planet, or a station this ship is parked inside). Mark the path's exit point as a "void" for the atmosphere and end the walk. Apply any external atmosphere effects to the voided ship atmosphere (poisonous gases, scarce atmosphere slowly draining ship air, dense atmosphere slowly filling ship air, etc.) Any time the ship transitions between external atmospheric states (planet-to-space, station-to-other ships, mothership-to-space, etc.), check if there are voids for any on-ship atmospheres. If there is, than do whatever you would do for a void to the new atmosphere. Note: the found void is only one of potentially many (important later)
    4. A path is walked connecting atmosphere to space. Mark the connecting space as a void and drain the ship atmosphere! Note this is only one void of potentially many, which will be important in a second.
    5. You reach a ship boxdim. Normally you would hit the above cases first, but you might hit this trying to clear a void from a ship space. Stop the walk, potentially remove a void depending on your algorithm.
    Now, any time a block is placed on or adjacent to a void, you may have closed the void. You rewalk the area around the void until one of the above states is reached again. You likely have to rewalk every time you partially repair a voided atmosphere. You can't just ignore the voids, either. Even if the ship atmosphere is lost to vacuum, presumably you want it refill with air in a planetary atmosphere, you you still have to maintain voids for evacuated internal ship spaces, too.

    There may be some other edge cases, but the above system of walks could add a lot of additional computation to an already comput-intensive game. Thankfully, using voids to denote path to external atmosphere means once an atmosphere is breached/voided, you don't perform a walk on that atmosphere any longer.

    I might prefer a system where a life support system applies support/air to any entire ship box dim, or to a set of pseudo-"interior blocks" which are user defined and essentially a form of block/space highlighting inside a ship. Fluff it as life support uses <technobabble> to project an arbitrarily shaped field it fills with life-sustaining gas mixtures. Even if surrounding blocks are destroyed, as long as life support is up, the ships "interior blocks" are breathable.
     
    • Like
    Reactions: Ithirahad

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    Its not a bad idea and biospheres sound awesome. Its just that I am worried about having them on ships. It seems yo me you'd have to have lots of the nlocks to give air to something like a titan. How much space would you waste chucking air blocks at it that you could put more useful blocks in.
    By that logic, there should only be a need for one or two shield generator blocks, depending on need for backup systems, with shield generation being purely a function of excess energy generation.. (That might be an interesting change to the core gameplay, actually, but I digress...) If you want habitable areas for your astronauts, you have to spend the blocks to make the areas habitable. Look at almost any work of SciFi fiction and to real space missions too, to see that life support is a significant part of the mission payload.
     
    • Like
    Reactions: Parameter

    Lone_Puppy

    Me, myself and I.
    Joined
    Mar 12, 2015
    Messages
    1,274
    Reaction score
    529
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 8
    I hope this or something similar is implemented. I build my ships and stations with docking for atmosphere in mind in preparation for this kind of game play. Although, I do have an issue with exiting the core to find myself in space. This could be an issue. :)

    Oh, and the existing shops could be an issue when spawning without a helmet.
     

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,167
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    I wrote this thread some time ago and without a dev response I have no idea whether the ideas in the OP are worth consideration. Obviously something needs to be done because you can't exactly release a space game where you can take off your helmet in space with no adverse effects!

    I might prefer a system where a life support system applies support/air to any entire ship box dim, or to a set of pseudo-"interior blocks" which are user defined and essentially a form of block/space highlighting inside a ship. Fluff it as life support uses <technobabble> to project an arbitrarily shaped field it fills with life-sustaining gas mixtures. Even if surrounding blocks are destroyed, as long as life support is up, the ships "interior blocks" are breathable.
    If it were done that way, I imagine a hallway could get blown away and leave a tunnel of breathable air in the middle of space! Even with sic-fi tech, something like that in the middle of a destroyed ship would be immersion breaking to an intolerable degree. That can't be solved simply by making the air destructible or you could have something equally immersion breaking like a cannon round entering an airlock and leaving a tunnel of space through the air in the hallway. You might be onto something by suggesting blocks but it's awfully hard to make a block-based atmosphere scalable unless it's totally static.
     
    Joined
    Jun 6, 2014
    Messages
    78
    Reaction score
    10
    "what's so bad about space engineers? I can name a few features that starmade would benefit from, and i know of one implemented in a different manner... who cares if the idea came from somewhere else? what matters is if it's applicable, and useful.
    I don't want air because MINECRAFT has it (seriously, there's a rocket mod with atmosphere), or because space engineers has it.
    or (name a game)
    I want it because i don't think it's normal to have "infinite" air in space... without SOME sort of system in effect to create it.

    as for the "escaping atmosphere" from battle damage, i think your right in using the shield as the calculation... even when down, the shield get's "pinged" on impact, hence it's a constant. by latching onto that code, when a block is ALTERED (YES, i'm going there) a pre-set value will let air THROUGH it (e.g, i'm expecting some sort of "realistic" damage system at some point, where some blocks "decay" with holes or chips)
    by having a VALUE, (which by default is 0%, as in non-existant)
    another reason for this, is for blocks that are OBVIOUSLY meant to let air through... E.G GRATES
    basically, if no value is set in the config, the game won't treat it as an "opening" an airvent would be set at "100%"meaning it'll
    ALWAYS be an opening.

    I suggest a two pass method of "scanning" a ship for atmosphere... the first simply determines "rooms" as in it looks for large open areas which it labels as "rooms"...
    next it scans the "boundries" of those rooms for doors and grates... creating a working crude map.

    it THEN scans grates for doors/forcefields on either side...
    armed with this information, it LINKS itself to all the doors and such (one way, so IT can CLOSE a door/activate a forcefield)
    if a player links lights to the system, it'll toggle them (e.g, a block on a atmosphere side would toggle if a room with no atmosphere was on the other side of the door)

    this allows rooms to be "pressurised" If a room breaches, the room is "sealed", any lights paired with it toggle to indicate status...
    and display blocks (paired manually like lights) could be changed with the tags "[AtmoOxy]" (oxygen level) and "[AtmoPre]" (pressure)

    this system sounds AMAZINGLY complex, until you realise it's only toggled by "changes"... like the oxygen level and pressure would simply "stamp" into memory once you were two or three rooms away... only loading for "battle damage" if a breach is about to occur.

    by "reloading" the room, it compares the time stamp with current, estimates usage, then modifies supply accordingly.
    (I think we need MULTIPLE oxy options, like no cost BIOspheres- like trees and such, or low cost AIR tanks, and HIGH power air creation...)

    like you buy "air tanks"... or you fill them at biospheres or air creators... creating a new resource.

    do you save energy and build very costly (space wise anyway) bio-spheres (spheres is inaccurate... it's merely a CONTAINED room)
    or do you generate it with power? rely on a finite supply?

    this is one of my goals in having air...
    ANOTHER reason i defined "airtanks" is because of a trick i know i'd use... gas...
    this allows us to pump different gasses into a room... E.g... SMOKE impairs VISION, and suffocates...
    POISON - dead invaders.
    Knockout/stun - allows you to take them prisoner... mwahaha

    there is a reason for that, I hope it'd be possible to affect a astronauts "suit" to break their air-supply... MAKING them suffocate or take off the helmet...
    [DOUBLEPOST=1445903804,1445903279][/DOUBLEPOST]
    I wrote this thread some time ago and without a dev response I have no idea whether the ideas in the OP are worth consideration. Obviously something needs to be done because you can't exactly release a space game where you can take off your helmet in space with no adverse effects!



    If it were done that way, I imagine a hallway could get blown away and leave a tunnel of breathable air in the middle of space! Even with sic-fi tech, something like that in the middle of a destroyed ship would be immersion breaking to an intolerable degree. That can't be solved simply by making the air destructible or you could have something equally immersion breaking like a cannon round entering an airlock and leaving a tunnel of space through the air in the hallway. You might be onto something by suggesting blocks but it's awfully hard to make a block-based atmosphere scalable unless it's totally static.
    (i chose to reply as it's mostly unrelated to my previous post)
    hmm... your comment about the cannon round "cutting" air, I agree turning air into vacumn would be silly... but what about actual attacks
    along similar lines? e.g a high power shot with vapor mixed in, has a low chance to breach shields... with PIERCE affect, it's damage is negated, but allows it a high chance of breaching hull (like 80% chance)...
    the shot could be used as a nasty anti-personal weapon... you'd need good air-filters to fix it...
    that vapor could be knockout gas, poison... or maybe a good dose of ACID (not the face melting kind)
     

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    SHIELDS ARE JUST A VISUAL EFFECT. If you hit a ship's exterior near enough, the shield effect can be seen pulsing over the interior too. There are no bounding calculations in play. Before this gets out of hand I have to mention that. (Sorry.)
     

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,167
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    SHIELDS ARE JUST A VISUAL EFFECT. If you hit a ship's exterior near enough, the shield effect can be seen pulsing over the interior too. There are no bounding calculations in play. Before this gets out of hand I have to mention that. (Sorry.)
    Yeah you mentioned that earlier when I asked. Thanks for clarifying.
     

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    That wasn't in response to you, that was in response to srs008 who mentioned the supposed shield bounding-surface calculations in their post.
     

    Lone_Puppy

    Me, myself and I.
    Joined
    Mar 12, 2015
    Messages
    1,274
    Reaction score
    529
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 8
    I agree with using shields to support an atmosphere system. It would simplify cabin decompression. People will eventually build their structures to support the logic around maintaining life support if it is introduced, so I think however it is implemented will be adapted to.

    Personally, I am happy that if the side of my ship blows out or a hole is created in a corridor that all atmosphere is vented. This is actually what will happen in a real ship. Building your ship with segmented hall ways, hatches, and whatever safety systems will become a part of the game. And if you avoid these, well it's going to be a huge gamble on survival. And that's ok too. You could go as far as to only fill the cockpit with atmosphere if you want.

    I hope this is introduced soon. and can't wait. :)
     

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    I agree with using shields to support an atmosphere system. It would simplify cabin decompression. People will eventually build their structures to support the logic around maintaining life support if it is introduced, so I think however it is implemented will be adapted to.
    For the fifth time, this is impossible. It's only a two-page thread, read it.
     

    Valiant70

    That crazy cyborg
    Joined
    Oct 27, 2013
    Messages
    2,189
    Reaction score
    1,167
    • Thinking Positive
    • Purchased!
    • Legacy Citizen 4
    I agree with using shields to support an atmosphere system.
    DUUUUUUUDE!!! We already established that using shields doesn't work because shields are not physically there. They're a visual effect displayed on the blocks. There is no "shield mesh" as I suspected there might be. I asked, and found out there isn't one.
     

    Lone_Puppy

    Me, myself and I.
    Joined
    Mar 12, 2015
    Messages
    1,274
    Reaction score
    529
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 8
    Sorry Ithirahad, guys. I skimmed through a little too quickly and was thinking something else in my head and mixed the two.

    I was thinking about the forcefield door blocks and imagined a type of replacement effect, so it would seem similar to the forcefields that appear in Star Trek hull breaches. Not sure if this could be possible.

    I also thought of the block replacement somehow tied into the effect routine, but did not elaborate.

    Oh and this does not have to use the door block. It could be a new block that decays rapidly or something else tied into the shields.
     
    Last edited:
    Joined
    May 18, 2015
    Messages
    287
    Reaction score
    165
    • Purchased!
    ...
    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. ...
    This is the correct way to go about atmosphere. StarMade is science fiction, it doesn't have to mimic atmosphere the way NASA does it. StarMade is presumably in the future. We already have salvage beams that can break down anything, storing large volumes in a box only a fraction of the size. We have shields, that mysteriously transfer all energy away from the protected blocks, regardless of it being kinetic, thermal, etc. Now we have transporters.... How hard can it be in this future world to create a device that forms a breathable atmosphere contained in a sphere around it?

    Each Life Support (LS) block would have a server configurable radius, perhaps defaulting to 10. This would give a single LS block a 20 diameter sphere around it. On a large ship, you would just place ONE every 15 blocks or so down a hallway, and probably a 1 or 2 in each room. To deal with a large area like a cargo bay, the LS block can link to Cargo Space blocks to fill in the volume of the cargo bay.

    For astronauts, again, this is the future, so assume that the astronaut's suit can hold several hours of air. Suit air is replenished when within the radius of a LS block, by entering or being near a Ship Core (which itself provides life support around it, just like the LS block), or entering a planet that has a breathable atmosphere for the astronaut's race.

    Finally, regarding hull breaches/shields, if a ship has shields that are at all functioning, and it isn't overheating, we can assume that the ship is "sealed". Since the Ship Core itself provides atmosphere, on a small ship with at least one Shield Recharger, the whole ship has atmosphere. On a large ship, there can be a LS to Total block ratio that if met, gives the entire ship atmosphere if the shields are up. No ray-casting for holes or other calculations are necessary or should even be considered. If the shields are down, then LS block checks are performed, and then, only for astronauts/NPCs who are not in a Ship Core/Build Block/Computer.
     
    Last edited: