The Airflow Update

Stationeers

Stationeers puts you in control of the construction and management of a space station to run by yourself or online with your friends. Complex atmospheric, electrical, manufacturing, agriculture, and gravitational systems require your thought and management at all times!

[h1]Atmospheric Simulation[/h1] Today we’re going to go into detail about the atmospheric simulation in Stationeers. We’ll give a short walkthrough about how we identify issues, think of solutions, test and iterate until we’ve solved problems or added new features. Specifically World Atmospheres, and how they move gas throughout the game, and especially how fast vacuums form. Of the many complex systems Stationeers models, the atmospherics simulation is the most defining. Two times per second; pumps move gas, filters split compositions, pipes check for bursting, and much much more. A lot of the gas the player interacts with comes from the world, or ends being vented there. Unfortunately, the speed to pull a vacuum in world has always been one of the largest bottlenecks for Stationeers. [img]{STEAM_CLAN_IMAGE}/28304711/6a9d2a6986f661f66c1e2c7be72a040a755548f2.gif[/img] [h3]Table of times of original vacuum times[/h3] [quote][table equalcells=1] [tr] [th]6 Tile Airlock Test[/th] [th]100kPa to 10kPa*[/th] [th]10kPa to 1kPa[/th] [th]100Pa[/th] [th]10Pa[/th] [th]1Pa[/th] [/tr] [tr] [td]Legacy Code[/td] [td]28s[/td] [td]18s[/td] [td]37s[/td] [td]1m32s[/td][td]2m05s[/td] [/tr] [/table] [table equalcells=1] [tr] [th]Medium Room (5x5x5) Test[/th] [th]100kPa to 10kPa*[/th] [th]10kPa to 1kPa[/th] [th]100Pa[/th] [th]10Pa[/th] [th]1Pa[/th] [/tr] [tr] [td]Legacy Code[/td] [td]10m[/td] [td]3m10s[/td] [td]6m45s[/td] [td]10m15s[/td][td]13m45s[/td] [/tr] [/table] [i]*The initial 100kPa to 10kPa time is solely driven by the active vent speed, and this is not summed into the proceeding columns.[/i][/quote] These tables demonstrate the power of the active vent. 90% of the air can be pulled rather quickly, but as soon as the World Atmosphere hits the vacuum floor, removing the remaining 10% of the air can take 200%-400% more time than the original 90%. Twice per second, every World Atmosphere in the game mixes with its neighbors. In world atmospheres, are large 2m*2m*2m cubes containing 8000 liters of gas, and do a multistep job of equalizing itself and any of its 6 neighbors every half a second. This has worked well for distributing air around in the game, but has its limitations, when one tile is being vacuumed. Even if one tile was very low pressure compared to its neighbor, the high pressure tile would still take a tiny part of the low pressure tile for itself. In very low pressure situations, this effect was significant. So what happens if we pick a fixed value, and say tiles cant take from smaller than 80%, and also wont give to tiles bigger than 120%. Not only might this speed up vacuum mixing, but it would also allow high pressure flows, to keep low pressure gasses from mixing upstream, a bonus feature. [img]{STEAM_CLAN_IMAGE}/28304711/f04654495456aa5d6fdacc506ddd8b8b3c7a5cdb.gif[/img] [h3]Comparison with First Attempt[/h3] [quote][table equalcells=1] [tr] [th]6 Tile Airlock Test 10kPa[/th] [th]1kPa[/th] [th]100Pa[/th] [th]10Pa[/th] [th]1Pa[/th] [/tr] [tr] [td]Legacy Code[/td] [td]18s[/td] [td]37s[/td] [td]1m32s[/td] [td]2m05s[/td] [/tr] [tr] [td]Attempt 1 (No upstream mixing)[/td] [td]6s[/td] [td]13s[/td] [td]22s[/td] [td]30s[/td] [/tr] [/table] [table equalcells=1] [tr] [th]Medium Room (5x5x5) Test 10kPa[/th] [th]1kPa[/th] [th]100Pa[/th] [th]10Pa[/th] [th]1Pa[/th] [/tr] [tr] [td]Legacy Code[/td] [td]3m10s[/td] [td]6m45s[/td] [td]10m15s[/td] [td]13m45s[/td] [/tr] [tr] [td]Attempt 1 (No upstream mixing)[/td] [td]2m10s[/td] [td]4m45s[/td] [td]7m15s[/td] [td]9m45s[/td] [/tr] [/table][/quote] In a 6 tile large airlock, the vacuum stage of cycling performance is 300% better, and in our large room its 40%. The large room doesn't see as much of a time decrease, because that amount of air is just able to keep the vent more saturated, but at 4 minutes faster, it's still a huge improvement. However, with our over simplification of the problem, and first attempt at a solution, we’ve introduced a slight issue. Since the taking, or giving of air, isnt just the comparison of two atmospheres, but instead 6, we can find ourselves in a situation where all the higher pressure atmospheres give us a portion of their air, and we end up being higher pressure than any single one of the atmospheres. Then the next tick, the situation has reversed, and the air exclusively moves away. This mass rebounding would only happen in certain setups/configurations, but created a vortex of death when it did. [img]{STEAM_CLAN_IMAGE}/28304711/49431bd4697106d342a063f134057073e2c950c4.gif[/img] So, lets add some math to reduce the mixing amount so no single tick can make an atmosphere overshoot its neighbor’s pressure and see what happens. [h3]Comparison with Second Attempt[/h3] [quote][table equalcells=1] [tr] [th]6 Tile Airlock Test 10kPa[/th] [th]1kPa[/th] [th]100Pa[/th] [th]10Pa[/th] [th]1Pa[/th] [/tr] [tr] [td]Legacy Code[/td] [td]18s[/td] [td]37s[/td] [td]1m32s[/td] [td]2m05s[/td] [/tr] [tr] [td]Attempt 1 (No upstream mixing)[/td] [td]6s[/td] [td]13s[/td] [td]22s[/td] [td]30s[/td] [/tr] [tr] [td]Attempt 2 (Fixed 14% mixing limit)[/td] [td]15s[/td] [td]31s[/td] [td]47s[/td] [td]1m3s[/td] [/tr] [/table] [table equalcells=1] [tr] [th]Medium Room (5x5x5) Test 10kPa[/th] [th]1kPa[/th] [th]100Pa[/th] [th]10Pa[/th] [th]1Pa[/th] [/tr] [tr] [td]Legacy Code[/td] [td]3m10s[/td] [td]6m45s[/td] [td]10m15s[/td] [td]13m45s[/td] [/tr] [tr] [td]Attempt 1 (No upstream mixing)[/td] [td]2m10s[/td] [td]4m45s[/td] [td]7m15s[/td] [td]9m45s[/td] [/tr] [tr] [td]Attempt 2 (Fixed 14% mixing limit)[/td] [td]2m30s[/td] [td]5m25s[/td] [td]8m20s[/td] [td]11m15s[/td] [/tr] [/table][/quote] This fix addresses the problem while maintaining no up-pressure mixing, but directly counters our biggest desire to have vacuums pull faster. Compromising on the first theorized ‘solution’ of eliminating backwards mixing to speed up vacuums. What if we still take large portions, but scale it based on how many neighbors, and change the 20% bigger/smaller take limits, into linear interpolations, where we just start scaling and taking/giving less, instead of taking none/all. [h3]Comparison with Third Attempt[/h3] [quote][table equalcells=1] [tr] [th]6 Tile Airlock Test 10kPa[/th] [th]100kPa to 10kPa[/th] [th]10kPa to 1kPa[/th] [th]100Pa[/th] [th]10Pa[/th] [th]1Pa[/th] [/tr] [tr] [td]Legacy Code[/td] [td]28s[/td] [td]18s[/td] [td]37s[/td] [td]1m32s[/td] [td]2m05s[/td] [/tr] [tr] [td]Attempt 3 (1/open+1)[/td] [td]27s[/td] [td]7s[/td] [td]15s[/td] [td]24s[/td] [td]31s[/td] [/tr] [/table] [table equalcells=1] [tr] [th]Medium Room (5x5x5) Test 10kPa[/th] [th]100kPa to 10kPa[/th] [th]10kPa to 1kPa[/th] [th]100Pa[/th] [th]10Pa[/th] [th]1Pa[/th] [/tr] [tr] [td]Legacy Code[/td] [td]10m[/td] [td]3m10s[/td] [td]6m45s[/td] [td]10m15s[/td] [td]13m45s[/td] [/tr] [tr] [td]Attempt 3 (1/open+1)[/td] [td]9m 30s[/td] [td]2m16s[/td] [td]5m[/td] [td]7m40s[/td] [td]10m10s[/td] [/tr] [/table][/quote] This third attempt nearly has the speed of our first attempt, while fixing issues with bouncing pressure waves. So while our test case mainly focused on pulling vacuums, these changes dictate the general movement speed of gas even when in a sealed hallway. Gas leaks spreading through your base, holes exposing your atmosphere to the outside, or any other period of high pressure differential, should feel more significant, and happen quicker. While our solution didnt fully prevent ‘up pressure’ mixing, many situations, such as accidentally opening a window on europa, now behave in a much more expected manner. Very little cold air will leak in while your nice base air blows outwards, but as soon as the wind dies down from the dropping pressure, the ice europa air will overtake the room. Hopefully you’ve enjoyed this peak into just one portion of the many simulations we need to constantly run to keep your stations ticking. Revisiting core functionality can be risky as we could suddenly break everyone’s bases, but when we have clear goals, and reference points to aim for, this is the sort of careful approach we like to take. And by the way, we recently added two new devices to the game, the powered vent, and large powered vent. These vents are allowed to traverse neighbor atmospheres when pulling a vacuum to do so even quicker. At the low pressures we’ve been talking about in the test data, they pull vacuums in a matter of seconds. But even in a fully pressurized room, they are 2x, and 4x the strength of a standard active vent, and can evacuate large amounts of gas very quickly. [h3]Large Powered Vent Test[/h3] [quote][table equalcells=1] [tr] [th]6 Tile Airlock Test[/th] [th]100kPa to 0kPa[/th] [/tr] [tr] [td]1 Large powered vent[/td] [td]8s[/td] [/tr] [/table] [table equalcells=1] [tr] [th]Medium Room (5x5x5) Test[/th] [th]100kPa to 0kPa[/th] [/tr] [tr] [td]1 Large powered vent[/td] [td]2m40s[/td] [/tr] [/table][/quote] [h1]Counterflow Heat Exchanger[/h1] The counterflow heat exchnager was not ready in time to be released with the other new heat exchangers but is finally ready! By drawing down the pressure of the outputs with a pump or regulator and regulating input pressures, the temperatures of two counter flowing networks can be effectively exchanged. Balancing the throughput of both inputs is key to creating a good exchange of temperatures. [img]{STEAM_CLAN_IMAGE}/28304711/dfa48f85bed13be794c11a1e4418a472128fe276.png[/img] [h1]New Powered Bench Variants[/h1] Four new powered bench variants have been added to give you more options when building your various rooms in your base and give you more variety. [img]{STEAM_CLAN_IMAGE}/28304711/fecb0a595a2eb8655add569537f1fedc1a75cc45.png[/img] [h1]Artwork Wallpaper[/h1] [expand type=Click to reveal a wallpaper version of this weeks wonderful patch artwork][img]{STEAM_CLAN_IMAGE}/28304711/2c8f34203b2b0d304664ad9371fb5808226f62f1.png[/img][/expand] [hr][/hr] [h1]We need you![/h1] [quote][h3]Stationeers is a small niche project. We know times are tough and our project isn't for everyone. So if you like the work we do, we would love to encourage you to spread the word, grab our supporter DLCs, and watch Stationeers content creators on places like twitch and youtube. We want to keep developing this game for many years, well beyond any early access release and to do this we need your support[/h3][/quote] https://store.steampowered.com/app/2089290/Stationeers_Human_Cosmetics_Pack/ https://store.steampowered.com/app/1038400/Stationeers_Zrilian_Species_Pack/ https://store.steampowered.com/app/1038500/Stationeers_HEM_Droid_Species_Pack/ [h2]Change Log v0.2.4294.19984 [/h2] [quote][h3]We do not filter or redact our patch notes so these patch notes include work we are doing on the rockets that are not yet available in the game.[/h3][/quote] [list] [*] Updated suit and helmet for main menu scene and character customization scene [*] Fixed spelling errors in new heat exchanger descriptions [*] Updated uvs and textures for hardsuit [*] Fixed spelling mistake in character customization menu [*] Fixed spelling mistake for heat exchanger kit [*] Fixed fan blade direction not representing the flow of gas for the Powered Vent [*] Fixed wall heater color not changing when turned on [*] Added input blocker to pause menu to stop in-world screens from being interactable while paused [*] Fixed inconsistent naming for pipes and pipe kits [*] Fixed incorrectly sized collider on low volume pipe kits [*] Improved behaviour of PassthroughHeatExchanger. Now implements a crossflow behaviour where-by it is possible to have the two inputs come close to swapping temperatures. [*] Added RemoveToEqualize to AtmosphereHelper.cs This calculates the amount of gas required to Equalize input pressure with output pressure, removes it from the input and returns it for further calculations. [*] Refactored MoveToEqualize to call RemoveToEqualise. [*] Renamed AtmosphericsManager.TickSpeedMs to AtmosphericsManager.TickSpeedSeconds as this was what it was actually returning. [*] Changed Heat Exchangers to show energy exchanged each tick in kJ. [*] Fixed AtmosAnalyser only runs analysis code when held in hand of local player. [*] Changed Moved AtmosAnalyser value generation to main thread to prevent flickering values, it now reads the cached values. [*] Improved tooltips around spray gun fail states [*] Added new models for small tanks. This is purely an aesthetic change. No change to functionality. [*] Fixed wind turbines being functional inside frames [*] Fixed issue with re-connecting after a client disconnects. The disconnected client no longer needs to restart the game before reconnecting [*] Optimised PassthroughHeatExchanger simulation function. [*] Fixed Gas Mixer tooltip rounds Setting wheel to whole number, now shows decimal places. [*] Tweaked mesh for basic suit helmet [*] Fixed insulated tanks being offset incorrectly after model update. [*] Added bobble heads for future content [*] Restructured Gasses Mixing in world, to allow better flow control. Gasses in world now will move towards lower pressure areas faster, with speeds to pull vacuums with normal active vents increased by 300% in best cases, and 150% in more typical large rooms. The amount of gas which 'moves' up pressure gradients has been reduced, reducing the amount of 'reverse gas spread' happening between large pressure differential world grids. Gas spreading in narrow tunnels will also see an increase in movement. [*] reverting wind(Direction vector) calculations to previous state, to address downwards wind on pressureized planets. Atmospheres will still mix according to new mixing rules. [*] Added prototype assets and behaviour for rocket datalink logic devices. [*] Changed separated Data and power device dirty process for cable networks. [*] Removed un-needed process in RecalculateDeviceListSorted Function. [*] Removed un-necessary step in GetNextValidThing function. [*] Fixed Null-collider in broken build-state of arc furnace. [*] Fixed mix in world wind calculations not using a cached pressure value, causing wind coming from global atmospheres to be incorrectly strong. [*] Fixed unusually strong wind when mining on Venus, as wind strength should now scale with volume extracted. [*] Fixed small insulated tank blueprints [*] changed datastructure for atmospheric mixing data caching to reduce garbage creation. [*] Fixed face mounted structure placement placing on the wrong side of the supporting structure if the player was standing on it. [*] Added 1st pass of rocket location data authoring system. [*] Tweaked overalls mesh rig [*] Added WIP placeholder launch pad pieces [*] Refactored landing pad networks to allow for a generic modular structure and added the launchpad structure using it [*] Improvements to Rocket Location data authoring. [*] Added Concept of space map to rocket location data. [*] Added Data validation and error logging to rocket data location parsing. [*] Added Instanced classes for rocket locations. [*] fixed issue where close to global atmospheres could flicker their neighbours into existence every other tick,due to not caching atmos state prior to attempting to mix in world, causing memory issues. [*] A mixing atmosphere will spark its neighbours if it is ignited, which should cause more flash fires, instead of slow isolated flames in one tile. [*] Fixed a number of devices instancing new materials every-time their anim state changed. [*] Zrillian lungs now have a wider safe temperature range, and dont take damage between -20c to 80c, up from -10c to 50c of humans. Warnings remain unaffected, as the zrillians dont necessarily like these temperatures. [*] Added first pass on rocket control motherboard and ui [*] Added missing message factory changes [*] Renamed ReferencableHelper.cs to Referencable.cs [*] Added SpaceMap and SpaceMapNode data synchronisation to clients. [*] Added WIP code for Rocket travel between SpaceMap nodes. [*] Added IRocketPath and IRocketDestination Interfaces to handle leaving and returning to launch pad. [*] Disabled prototype launch animation. [*] Changed Mass to be a property. And implemented placeHolder mass values on rocket fuselage, pipes and inline tanks. [*] Added Method to get starting map to SpaceMap.cs [*] Added LaunchPadNetwork now caches its centre piece in the same way as LandingPadNetwork. [*] Updated rocket location icon [*] Fixed NRE from rocket. [*] Fixed Prototype LaunchPad prefabs [*] Added CounterFlow heat exchanger to tier two pipe bender. The counter-flow heat exchanger passes gas and liquids from the input to the corresponding output passively based on pressure differential (or volume ratio differential in the case of liquids). Matching the flow rate of both inputs will allow for around 70% efficiency of heat reclamation (this allow for the swapping of temperatures between to pipe networks. Multiple exchangers can be daisy chained together to increase the heat reclamation efficiency. [*]Updated WorldManager source prefabs in scene. [*]Fixed Pumps and other pipe devices changing color on load. [*]Removed Outline effect demo scripts. [*]Added first pass on star map ui for rockets [*]Added rocket can now path to orbit. [*]Changed all pipes can now be built in a fuselage [*]Fixed Stacking PureIce would zero out the spawn contents. [*]Added Logic variables to avionics Device. [*]Changed a number of single-grid atmos devices to be allowed to be built in rockets. [*]Added rocket command to print destination IDs. [*]Added support for dynamically created and destroyed SpaceMap nodes. [*]Changed Launch pads now generate a new node once they have a valid centre piece. [*]Fixed An uncommon crash when running the StateChange fix on a custom world save. [*] Added dynamic locations to map view (wip) [*] Fixed gas being created from spray cans being created with 0 energy [*] Reverted the ability to use a spray can to paint the object in the other hand as this behaviour is confusing and not communicated. [*] Portable generator no longer continues providing power once the canister runs out [*] Fixed the blueprint for the Hydroponics Station kit [*] added missing blueprint for automated hydroponics kit [*] Added Pathfinding algorithm so rocket can path to/from any destination on the space-map. [*] Added Pathfinding testing command for validating authored data. [*] Added Rocket movement logic has collection of Node-connections and can path through multiple nodes to reach target destination. [*] Fixed Some nodes being registered twice to the space-map. [*] Fixed some merge errors with map view [*] Fixed modular structure networks not registering devices correctly [*] Updated new rocket kits to be not spawnable [*] Fixed launchpads being registered as landing pad networks [*] Changed star map to use grid based panel for dynamic locations rather than a radial layout. The position of these can be authored in the xml to achieve a nice map layout [*] Fixed Some devices would allow interaction even when in a locked state or when the player didn't have the correct access card. [*] Fixed Some cases where things could be interacted with when destroyed or incomplete. [*] Added temporary method for rocket to link to a landing pad node [*] Fixed launch pad networks not being cleared when unloading [*] Fixed Device Locking fix prevented airlock cycling using door interaction panel. [*] Fixed Null reference exception on server when writing DynamicPanelData. [*] Fixed Can't interact with slots when device locked (beta only) [*] Fixed Settable Atmospheric devices show incorrect tooltip on setting wheel when locked. [*] Fixed launch pads not deregistering correctly on destroy [*] Fixed space map nodes not removing all their connections when deregistering [*] Added 4 new bench variants [*] Removed some temp images from rocket info canvas [*] Fixed incorrect calling placement of base.OnDestroy in LandingPadModular. [*] Fixed Pipe mounted LiquidDrain throws error when pipe removed. [*] Small Clean up of DevicePipeMounted code [*] Removed Prototype launchpad pieces from kit (LandingPadBasic) [*] Fixed A save with a Pad Network with no saved networkId would not load. [*] Changed UpdateThings on GameStart to run once gameState is set to running (this was the behaviour on clients, should also be behaviour on server) [*] Moved some classes into an appropriate namespace [*] Added temporary method to refresh rocket internals when you modify the rocket network [*] Added rocket refresh command to help with debugging rocket behaviour [*] Fixed rocket engines being registered multiple times in rocket network [*] Fixed TurbineGenerator Animation and sound not synced to clients. [*] Added Some WIP electrolysis code. [*] Fixed Unable to turn on/off light or flush locked helmet using interactable buttons (beta only). [*] Fixed MAX_ENERGY Constant being too low causing large tanks with too much liquid in them to have their contents deleted on load. [*] Fixed Incorrect serialisation type for network messages for Setting and Quantity of digital chute devices. [*] Added PlaceHolder Rocket Mining device. [*] Added OnFishedLoad call to StructureNetwork. [*] Fixed Rocket doesn't find launchpad on load. [*] Added hashing of Id to spaceMap node. [*] Implemented IRocketInternals on Chutes. [*] Removed prototype launchpad tower base from incorrect kit [/list]