Containment

Containment refers to the process of capturing, imprisoning, and exploiting Entities.
== Summary==
Containment is the desired end result when encountering Entities. Colonies can hold entities on a Holding spot or a Holding platform, the latter of which requires research and steel to build. Once contained, entities can be researched or regularly harvested for resources or power.
Only creature entities are placed on holding platforms. Item entities, such as the Cube, can be hauled around and placed in stockpiles - having an important stockpile dedicated to entities may be a good idea. Building entities, such as the Monolith, must be studied in their current location, as none of them are mobile. Be careful about integrating them into your base designs as they may be a source of risk down the road.
=== Containment strength ===
Any containment room is subject to containment breaches, the equivalent of prison breaks for entities. The containment strength of the room can be viewed by clicking on the platform. Containment is the sum of the following factors:
*Average Wall HP/10 (e.g all wooden walls have 195 hp and will result in containment)
*Average Door HP/5 (an open door provides containment)
*Average light level/10 (realistically limited to through use of normal lights)
*Bioferrite plate flooring provides up to Containment at 100% room coverage
*Unroofed containment rooms apply a containment penalty
*Holding Spots modify the resulting containment for their specific spot by 
*Each additional Holding Platform inflicts a roughly exponential cumulative penalty to all holding platforms in the same room. 
*An Electric inhibitor increases containment by 
*A Shard inhibitor increases containment by 
*An Electroharvester lowers containment by 
*A Bioferrite harvester lowers containment by 
The walls and doors that make up the containment room contribute to containment strength based on the combined average of their , with stronger materials (e.g: granite blocks or plasteel) having a higher contribution. Naturally occurring walls with HP greater than naturally occurring granite have their containment strength clamped. This relies on the structures' current HP, not their maximum HP, meaning that having damaged walls or doors will result in a lower containment strength. This effect only applies to fully enclosed rooms. If any door is held open too long, the room will no longer be considered enclosed. Holding Spots and Holding Platforms should be placed with a 1-tile gap from doors to prevent colonists from triggering spurious insufficient containment warnings by keeping doors open while interacting with void entities.
Larger and more dangerous entities generally require more containment strength. An entity can be held in a weak cell just fine in the short term, it simply increases the rate at which they will break out. As a general rule, the average frequency of breaches for entities that are sufficiently contained is measured in years, while the frequency of those insufficiently contained are measured in days. This is still likely to be enough time for an unprepared colony to quickly set up an adequate cell.
The size of the cell does not affect containment strength. Note that storing multiple entities in the same room will increase the required containment strength. This may still be worthwhile for harvesting certain resources more efficiently.
An entity incapable of moving will never breach. This includes entities with broken spines, or entities with destroyed legs and insufficient arm strength. Such entities can even be held outside in a holding spot without any risk, and are a useful resource to a colony.
Although possible, surrounding a containment spot with doors results in lower containment strength than using a room with both walls and doors.
=== Material comparison ===
The following table is for roofed containment cells with walls and a single door made completely out of the listed material, with a separate column for containment cells with walls of the listed material and a security door instead of a single door of the given material. The listed values include no bonuses for flooring, lighting, or containment boosting buildings, and are for containment rooms with a single Holding platform.
Material 	Containment Strength	With Security Door	Material 	Containment Strength	With Security Door
Jade 	31 	175 	Gold 	37 	178
Wood 	40 	180 	Silver 	43 	181
Steel 	62 	190 	Marble blocks 	74 	196
Slate blocks 	81 	199 	Sandstone blocks	87 	202
Limestone blocks	97 	207 	Granite blocks 	105 	211
Bioferrite 	132 	220 	Uranium 	155 	235
Plasteel 	174 	244 	 	 	
===Escape Interval===
The chance an entity will escape is determined by their escape interval. Each entity has a base escape interval (specified as a mean time between in days).
The entity cannot escape if:
* Their base escape interval is zero or negative. Entities incapable of escaping are:
** Nociosphere
** Fleshmass nucleus
* The entity is incapable of moving (missing legs or incapacitated).
The base escape interval is then further modified by:
* Entity's moving capacity
** It is multiplied by (10000 / Entity's Moving Capacity)%
** The moving capacity is clamped between 1 and 100%
** For example, at 70% moving it'll be (10000 / 70) = 143% (rounded up)
** At 100% moving, it'll just be (10000 / 100) = 100%, meaning it'll not affect the escape interval
* Days in captivity
** At 15 days or less, it doesn't affect it at all (multiplies it by 100%)
** At 60 days, it multiplies the escape interval by 120%
** At 120 days, it multiplies the escape interval by 150%
** At 240 days or more, it multiplies the escape interval by 200%
** It scales linearly between the values
* Containment strength minus entity's minimum containment strength (so if an entity needs 30 and the containment is 50, the value is 50 - 30 = 20)
** Below 0 strength multiplies the escape interval by 5% (lowers it significantly)
** At 0, it doesn't affect it at all (multiplies it by 100%)
** At 100, it multiplies it by 300%
** At 200 or more, it multiplies it by 800%
** It scales linearly between the values
* Temperature
** At 0°C and above, it doesn't affect it at all (multiplies it by 100%)
** At -30°C and below, it multiplies the escape interval by 150%
** It scales linearly between the values
** Affected entities:
*** Fleshbeasts
*** Shamblers
*** Ghouls
=== Containment facilities ===
There are a handful of facilities that can be constructed alongside holding spots or platforms. Some facilities help to make entities easier to contain, while others allow you to exploit entities for resources.
Building 	Research 	Cost	Limit 	Effects
Electric inhibitor 	Entity containment 	 	- 6 per holding platform- Max distance: 4- Min distance: 1- Must be pointed at platform- Requires line-of-sight	- containment strength
Shard inhibitor 	Entity containment 	 	- 1 per holding platform- Max distance: 5.9 	- containment strength
Bioferrite harvester	Bioferrite harvesting	 	- 1 per holding platform- Max distance: 5.9- Requires line-of-sight 	- containment strength- Produces bioferrite
Electroharvester 	Electroharvester 	 	- 1 per holding platform- Max distance: 5.9- Requires line-of-sight 	- containment strength- entity study rate- Periodically applies electrical burns to entities- Produces up to 2000W of power
== Containment Effect on Dark Study ==
The amount of Dark Study gained while studying contained entities is affected by containment strength. In general, the higher the containment strength over the minimum containment level of the entity then the larger multiplier of Dark Study.
If the entity is contained at exactly the minimum containment required then Dark Study is not adjusted from the base value.
At containment levels below the required amount, Dark Study is multiplied by 50%.
At containment levels 100 above the required amount, Dark Study is multiplied by 130%. 
At containment levels 200 above the required amount, Dark Study is multiplied by 150%. This 50% additional Dark Study amount is the maximum value possible from containment.
In between minimum containment required and 200 additional containment the Dark Study multiplier is linearly interpolated.
Dark Study Effectiveness
== Analysis ==
Containment rooms can follow 1 of 2 strategies, each with its own benefits and drawbacks: maximizing containment strength and minimizing space requirement.
A downed a high-risk entity can be stored in a cryptosleep casket until a suitable containment cell can be constructed, if one is not available.
=== Maximizing Containment Strength ===
Since having multiple holding platform or spot causes exponential reduction in containment strength, maximizing containment strength means holding fewer entities in the same room. This leads to a higher material cost and space requirement, increasing travel time; but leads to fewer entity escapes and higher dark research point gain. This can be done by:
* Using a Security door for an immediate gain of nearly Containment. 
* Avoid using Bioferrite Harvesters or Electroharvesters(Note that electrical burns caused by harvesters decrease movement, which slightly increases containment strength)
* Hold only 1 entity in each room
* Use the highest HP wall and door materials possible- which will generally be naturally occurring ore deposits, natural or smooth granite, Plasteel, Uranium, natural or smooth limestone, Bioferrite, in that order.
* Ensure the rooms are lit and covered by a roof
* Use Bioferrite plating for flooring
* Build a shard beacon in the containment room.
==== Increasing dark research point gain ====
Beside increasing containment strength, you can gain more dark research points between each cooldown by:
* Not using Electroharvester on researched entities, it inflicts a penalty to research gains.
* Having the researcher use Voidsight serum.
Containment boosting buildings come with downsides- Shard inhibitors require a Shard to construct, and Electric inhibitors take up a lot of space and can only affect a single platform at a time.
=== Minimizing space requirement ===
This strategy has the opposite benefits and drawbacks of the previous strategy. But for low-risk entities such as Gorehulks, de-legged Metalhorrors, or even Devourers once you have got the means to counter them, the risk of escape is minimal, and the research penalty can be alleviated by investing in security doors or other containment facilities.
The natural number of entities to hold in a room is 8, the maximum reached by a single bioferrite or electro harvester. This quantity reduce the containment strength by about half that for a similar room with 1 holding platform.
With uranium walls, a lit containment room with eight holding platforms, bioferrite flooring, and a shard inhibitor will reach 142 containment, sufficient to give Noctols an escape interval of roughly 2 years.
Gorehulks are generally the easiest entities to contain, due to their relatively low containment strength, their low melee damage, and their blunt melee attacks. They also can be de-legged to permanently be prevented from escaping (see the Gorehulk page for more details.
Noctols have similar containment requirement and bioferrite yield to Gorehulks, but they can't be de-legged and have sharp attacks. Toughspikes are also similar. They can be de-legged by frostbite, but yield less bioferrite.
Healthy metalhorrors are dangerous to contain. But if you can destroy their legs in combat, capturing them no longer has any risk
Devourers are vulnerable to tox gas, which can be deployed from IED traps to down them in case of escape.
A Revenant that escapes is highly annoying. Even if you can easily recapture them, their high containment requirement will induce other entities in the room to escape more often.
=== Dealing with escapes ===
Entity escapes are generally not dangerous, especially if they are gorehulks, their containment cell has the sturdy security door, or they're separated to individual cells. The biggest risk in these events is accidentally killing the entity while trying to recapture. Therefor, painful and less lethal means such as tox gas, fire, or acid burn should be prioritized.
This means that it's fairly safe to build large containment cells, even with 8 holding platforms. You can build an IED tox trap near the cell door in case of escape. Tox gas will fill the room and cause toxic buildup for the entities inside; you can repair the door while waiting for the entities to be downed. The gas will completely dissipate before toxic buildup can kill any entity, other than gorehulks or ghouls (they have lower tox resistance). Note that metalhorrors and shamblers are immune to tox gas and can't be supressed like this.
==Trivia==
The highest possible containment score is 403.9, possible only by having a roofed containment cell whose entirely made of unmined Plasteel ore, with a security door, bioferrite plating floors, six electric inhibitors, and a shard beacon- lit entirely by Sunlamps. A healthy Metalhorror, the entity with the highest containment requirements, would have a prison break interval of 8 years with such a setup.