Editing Gas

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{Stub|reason=General}}
+
{{stub}}
{{Image wanted|reason=Illustrative examples of spreading, dissipation, and other mechanics.}}
+
{{image wanted}}
 
'''Gases''' are a class object that behaves in a certain way. There are currently three gasses:
 
'''Gases''' are a class object that behaves in a certain way. There are currently three gasses:
 
* [[Blind smoke]]
 
* [[Blind smoke]]
Line 7: Line 7:
 
== Mechanics ==
 
== Mechanics ==
  
Gasses have a density of 0-100% (which is represented in the engine as 1 byte for a maximum integer value of 255 density). This is calculated for each tile that contains gas, separately for each type of gas. Walls, closed doors, and other blocking structures such as [[Nutrient paste dispenser]]s prevent gas from spawning or diffusing onto their tiles.  
+
Gasses have a concentration of 1-100%. This is calculated for each tile that contains gas.  
  
=== Dissipation ===
+
Gas slowly dissolves into normal air and will disappear when the concentration reaches 0%. Different weapons have different mechanics when it comes to creating gas.
  
Dissipation causes gas density to be reduced in each tile overtime.
+
====Things that increase the concentration of the gas====
 +
* Releasing more gas with weapons or traps
  
On each tick, a random 1/64 of all map tiles are ticked for gas dissipation. Smoke and Rot stink dissipate at an average rate of ~1.57% (4) density per 64 ticks, while Tox gas dissipates at an average rate of ~1.18% density (3) per 64 ticks.  60 ticks is 1 second at 1x speed, for reference.
+
====Things that block gas====
 +
* Walls
  
=== Diffusion ===
+
====Things that do not influence the gas concentration or dissolve speed====
 +
* Roofs
  
Diffusion causes gas density to spread from tiles of higher density to lower density. Tox gas and Rot stink gases may diffuse, while Smoke does not. The minimum density for Tox gas and Rot stink to diffuse is ~6.66% (17), below which diffusion ceases.
+
==Analysis==
  
On each tick, a random 1/32 of all map tiles are ticked for gas Diffusion. For each tick of diffusion, the tile being ticked will average its gas density with that of an adjacent tile with a lower density of gas.
+
Although gases can spread to neighbouring tiles, (it seems) they can only do this to a certain extent.  
  
Gases can only diffuse to open tiles, without walls, closed doors, or other blocking structures like nutrient paste dispensers.
+
Further testing is needed:
 
+
* When two/three pawns fire at the same time, will the volume of the cloud be bigger than if only pawn fires?
=== Spawning ===
+
* Walls seem to 'absorb' gas. In a narrow and wide corridor the gas dissolves at an equal speed. In the narrow one it barely reaches further.  
 
+
* Rot stink might have slightly different mechanics. In earlier tests it seemed to reach a higher concentration in enclosed spaces. This is probably unrelated to the roof, but rather to being in a small area where it can not spread to dissolve equally fast as it was being created by the rotting corpse.  
When gas is spawned, if gas already exists in the tile, any resulting gas density over 100% is pushed out to adjacent tiles, up to 40 tiles away from the source. Multiple sources spawning gas, such as multiple pawns using tox weapons, will fill much more space, much faster, with gas than a single pawn due to this.
+
* Effect of open doors is not known yet.
 
 
==== Explosives ====
 
Explosives that spawn gas such as the projectiles of the [[Toxbomb launcher]], [[Tox grenades]], and [[Smoke launcher]] spawn 100% density of gas on each tile within their explosive radius. Any tiles in their explosive radius that does not allow gas such as a wall causes that gas density to not be spawned. Thus for maximum tox gas spawning into a confined space, an open 3x3 space for all 9 tiles of tox gas generation should be used.
 
 
 
==== Packs ====
 
Packs that release gas such a deployed [[Tox pack]] or [[Smokepop pack]] have a total density (defined as a number of cells filled to 100% density) they release over their duration at their position, spawning gas every 1/30 ticks (2 times a second at 1x speed).
 
 
 
==== Rot Stink ====
 
Rot stink is generated from a rotting corpse on each rare tick (1/250 ticks, or 4.16 seconds at 1x speed), with a density of ~20.4% (52) per unit of of the corpse's body size. Rot stink is generated on the corpse's cell.
 
 
 
=== Vents ===
 
 
 
Tox gas and rot stink pass through vents, while smoke does not.
 
 
 
On each rare tick (1/250 ticks, or 4.16 seconds at 1x speed), the gas density of tox gas and rot stink on each side of a vent is averaged and equalized. For example, if one side has 90% and the other 20%, after a rare tick both sides will have 55%.
 
 
 
=== Doors ===
 
 
 
A closed door acts the same as a wall, preventing spawning and diffusion of gas onto the tile. Open doors act the same as an open tile for spawning and diffusion. Closing a door with existing gas will cause the gas to remain on the tile, but no longer diffuse to or from other tiles, or be spawned on that tile. Gas on closed door tiles will dissipate over time as normal.
 
 
 
== Testing ==
 
  
 
[[File:Smokelauncher gas physics comparison.mp4|thumb|left|Gas expanding from a single point to fill a room]]
 
[[File:Smokelauncher gas physics comparison.mp4|thumb|left|Gas expanding from a single point to fill a room]]
Line 53: Line 35:
 
== Version history ==
 
== Version history ==
 
* [[Version/1.4.3523|1.4.3523]] - Gas system added. Previously smoke was the only gas and it only existed as a temporary object with a set but refreshable duration.
 
* [[Version/1.4.3523|1.4.3523]] - Gas system added. Previously smoke was the only gas and it only existed as a temporary object with a set but refreshable duration.
* [[Version/1.4.3555|1.4.3555]] - Gases can now travel through vents.
 
  
 
[[Category: Game mechanics]]
 
[[Category: Game mechanics]]

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)