Defense structures

Raids are frequent and numerous as enemies don't journey towards your base from their "camp" but just spawn on your map nor need to maintain their base like players do. So players must wisely consider protective measures while still taking everything else into account, whereas hostiles only attack.
Basically, players have to fight the same enemy AI programming for each type of hostile but the approach to it may differ according to gameplay preferences, either face to face for a more combative experience or behind killboxes for a less threatening measure, or both combined.
== Map features ==
Before laying blueprints, first inspect the map for natural features that can work as defenses, such as water or a mountain.
=== Moats ===
Water or marsh tiles can be used as moats which will considerably slow down incoming Raiders, giving you some time to shoot and soften the clash before engaging in melee combat.
=== Rivers ===
In maps with rivers or other bodies of water, you can build cover, like sandbags, on top of the water using a bridge. Funnelling enemies over the bridge can slow them down significantly while exposing them.
=== Mountains ===
Mountains (in Small hills or Large hills maps) that align with each other can become part of your defensive walls by filling the gap in-between. Mountainous maps, however, are better used by Mining in tunnels and caves or walling out a section surrounded by mountains.
=== Map borders ===
Pay attention when expanding towards the edges of the map, as there's a boundary which your colonist can not build beyond that is only visible when the Structure tab is selected.
== Early-game defense ==
At the very beginning your most primitive security choices are spike trap, sandbags, and stone chunks. You will need to find a balance between these three to make the most out of the available materials without costing too much time. Analyze the terrain to find choke points, natural walls, and other features you can use to defend your colony.
=== Stone chunk manipulation ===
From the start, much time will be spent Hauling stone chunks, either to build or to open a Growing zone, while gathering raw materials into a stockpile zone. As you move stone chunks around, you might as well create a Dumping stockpile zone on the outside of your wall, covering its width and expanding it further. This is a little help as fire prevention, since stone chunks will slow the spread of fires by preventing grass growth, thus naturally removing any flammables below. Fires can spread up to 4 tiles away, so this won't completely stop fires unless you put a thick enough line.
Performing this action can be time consuming, so just a single line covering your entire wall width would be a good start.
Your speed in this matter is greatly affected by the number of haulers available. Taming and training animals with Advanced training capabilities, such as a Husky, allows the animals to do the hauling, while your colonists can focus on building other defensive structures. Taming hauling animals is also time and food consuming so you will need to allocate resources carefully rather than getting 20 pets right away.
=== Walls ===
An essential Structure to keep threats out, so long as the base is self-sustainable inside. Walls alone can fend off early game raids if a colonist's Construction is high enough to keep the walls standing while enemies start to starve and become tired. Walls also protect from Carnivore attacks and a possible Manhunter pack, which cannot reach colonists safely inside unless a colonist is seen passing through a door, at which point the animal will attempt to break it down.
As raids become stronger, walls alone won't hold off raids, so prepare additional defenses behind them such as lines of Sandbags, or funnel them through a chokepoint to engage in melee combat.
Many layers can be raised as you expand. Initially it is faster to build with wood but later on, they should be made of stone like granite blocks or limestone blocks.. Placing several doors 15 to 25 tiles between each other allows multiple exits and the ability to flank enemies.
If raising additional walls, instead of putting the second layer right next to the first, consider leaving a gap between both. Wide gaps give long-range shooters enough distance to pick off targets, while 1-tile gaps allow repairs without being exposed to enemy fire. Double layer walls may seem more resistant protection but are discouraged as colonists cannot go out to repair the side that is being attacked, placing themselves in harm's way.
Wooden walls are weak and flammable, while all walls are weak against frag grenades. Grenadiers can easily breach them, so target those with explosive weapons first to prevent the wall from falling. When your efforts are not enough, this shall signal the time to retreat to your inner walls or any other defensive structure inside.
Watch out for trapped animals, which will attempt to break out if they are trapped inside without food, especially during winter when it becomes too cold to graze.
=== Cover ===
Cover is vital for firefights as it can block projectiles, reducing the amount of damage received by your colonists. This is an essential defense as long as colonists or turrets are directly engaging.
However, static defenders behind cover are vulnerable to explosives, so be careful.
==== Sandbags and Barricades ====
Sandbags and barricades are very efficient when placed wisely. Their protection is inferior to walls (% vs 75% from walls), but are more effective against diagonal fire as they can be placed side by side. They are faster to build, and can be built from textiles (sandbags) or ordinary building material (barricades).
Sandbags and barricades are a quick security measure when an extended wall would take many days to complete, as well as a fallback secondary defense when the perimeter is breached. It all depends in each game.
The most common usages are in shape of a square's corners or a U shape with the opening towards fast retreat.
==== Walls ====
Walls are the most effective cover, providing up to 75% cover. However, this restricts your colonist's effective attack area, and single pillars are greatly affected by direction, making them unable to protect against projectiles fired diagonally.
==== Stone chunks ====
Stone chunks are natural resources with 50% cover efficiency, weaker than constructed cover but still effective. Their placing is similar to sandbags only that it requires hauling to previously set dumping zone lines, instead of construction. Helpful if you have no one well skilled in construction.
=== Spike traps ===
The only initially available defense that deals damage, is single use and needs careful placement. Common locations are in the corners of your base where enemies will likely make turns as well as narrow areas even outside your base that receive frequent traffic. If it doesn't seem obvious to you at first, one way to find out is by carefully studying raids pathing from the map borders as they close in towards your base. Watch where they go through and starting laying blueprints but forbidding them (as you are currently being attacked). 
When building spike traps, you must also leave free areas so that your colonists and friendlies can pass harmlessly or else they are greatly slowed while trying to tiptoe through them, and may accidentally trigger one in the process. As such, putting them in a 1-wide corridor is not a good idea. A good way to harness this is a 2-wide corridor, with a spike trap, and then a fence next to it. friendlies will go over the fences, while enemies will walk through the traps.
Traps made of wood are highly flammable so its best to place them on rock or soil far from grass or trees, where wildfires won't waste them. Stone traps can't get burnt. Either can be destroyed by explosions so they shouldn't be placed right in front of your walls as grenadiers will blow them away altogether.
Be aware that after subsequent game updates, you can no longer place spike traps adjacent to one another, as displayed below. 
File:Trap_choke_14.jpg|Trap and fence passage
File:Defense structures deadfall trap.png|Traps in potential enemy cover spots (map border)
=== Clearing the area ===
Once your basics had been covered, it's time to make improvements. On maps where flora is dense, it's best to clear the surroundings so that enemies won't have cover to fight, totally exposed to your fire. From the Orders tab, use the "Cut plants" order to remove trees and "Haul" to haul stone chunks away, gaining berries and wood in the process, and hastening any jobs at the Stonecutter's table.
Clearing the area also prevents fires from reaching your base. On the other hand, vegetation on temperate forests or tropical rainforests never cease growing, so an easy way to clear your surroundings is to do controlled burnings of the surroundings, doing the job faster than chopping and cutting. Burned trees only provide 20% cover.
=== Bait furniture ===
Attackers will destroy furniture if no colonists are in sight, and will sometimes even stop to destroy furniture if it is between them and the nearest colonist. They may smash items or set flammable things on fire (particularly crop fields).
Cheap wooden furniture such as a stool or table can be used as bait to lure enemies into a position where they can be more easily killed. It can also distract them by drawing a few attackers away from your base, which can help prevent your defenders from getting overwhelmed.
File:Distraction_tables_2.jpg|A raider lured into a dangerous position in the middle of a moat.
File:Distraction_tables_3.jpg|A mechanoid detoured far away from the base to smash a wooden stool.
As a small added bonus, if your outdoor bait furniture consists of a table and stool, colonists completing work tasks far from your base may stop to eat there. This may help avoid the "Ate without table" negative thought.
== Mid-game defense ==
=== Cover ===
==== The "Fire Wall" ====
An effective cover design is to alternate 2 walls and 1 sand bag. With this, you can have two defenders behind full cover firing out of one hole. The sandbags should be there mainly to soak fire coming from oblique angles; ideally, there shouldn't be anyone standing directly behind them, otherwise stray fire directed at that colonist will easily hit others around him.
This structure narrows the effective attack area, forcing both sides to fire straight at each other. Fire walls should be placed directly in front of where enemies will be attacking from, such as potential sources of cover.
Pros
* Gives excellent cover
* The walls stop some explosives
Cons
* May prevent colonists from ganging up on enemies
* Restricted attack angle
==== Surrounding cover ====
For additional protection against shots not coming straight, sandbags can be built to the sides of where colonists will stand during combat.
This does not result in a narrowed attack angle for your colonists, allowing them to attack enemies from a broader angle while still receiving comprehensive protection from fire, especially when enemies are almost firing horizontally at your colonists. Colonists also take fewer hits from missed shots as they stand 1 tile away from each other.
This can be used to complement the aforementioned 'Fire walls' by placing them somewhere slightly farther away where defenders will fire diagonally at enemies.
==== Cover removal ====
While sandbags already give you an advantage over raiders in terms of cover (55% vs 50% for stone chunks), removing all sources of cover near your base is still very useful when dealing with ranged enemies as they will then have nowhere to hide.
Haul all stone chunks towards a dump behind your defensive lines so enemies can't use them. A sniper rifle has a range of 45 tiles, though most raiders can't shoot that far, so removing chunks around 30 tiles away from your defenses can deprive many enemies of suitable cover.
Watch out for your crop fields, as colonists tend to move and lay out chunks in straight lines when planting on Growing zone tiles, suitable for raiders to take cover behind.
==== Cover baiting ====
Once there's no suitable cover nearby, ranged attackers will scramble to find any objects usable as cover. You can exploit this by placing any form of low cover to attract them to a place where they can be dealt with more easily. Stools work well, though they wear out quite fast under constant fire. 
If the cover is hard to remove (such as plants and trees constantly regrowing in plant-rich biomes), you can manipulate stone chunks in ways that give them a disadvantage. For example, putting gaps between each chunk exposes the enemy behind to fire directed diagonally, or continuous lines allow missed shots to hit nearby covering enemies. If your defense line is big enough, you can bait enemies into taking cover in such a way that leaves them flanked (see picture).
You can put traps behind the bait cover, which makes it slightly easier to trigger, though still less effective than chokepoints (see below).
==== Bunkers ====
A simple early game construct, effective until mid-game. Simply build a room in any shape (or convert them from ruins) and then deconstruct a few sections of wall facing the enemy to make some holes and replace with sandbags -- these will be firing holes for your shooters, where they can use the walls as cover for 75% protection from direct fire, and sandbags as cover from diagonal fire.
Bunkers should be built out of stone, as they are durable and are non-flammable.
Additionally, build a roof for your bunker to protect defenders from bad weather like rain and lightning strikes. So, when a raid comes and your shooters head to the bunker, they now enjoy the full cover bonus from having thick walls between them and the enemy, without an aim malus when it rains, and the floor they're on can remain free of movement-slowing snow.
To finish the bunker, add flooring so your colonists don't have to worry so much about fires while inside.
Pros
* Cheap -- Wall materials are the only thing required to build a basic bunker, allowing for quick construction.
* Simple -- Four walls and a few sandbag/barricade firing positions is all it takes to build an effective early-game defensive structure.
* Upgrade-able and modular: Additional walls/rooms & defensive structures like turrets can improve the bunker’s capability.
* Full cover provides high defence for colonists.
** Full cover negates damage from explosions outside of the bunker, internal walls can negate explosives that enter the bunker.
Cons
* Risk of encirclement: Enemies can surround your bunker and cut it off from your main base, overwhelming you.
* Static position: If not placed well, the bunker’s utility will be greatly decreased, and not all map types suit bunkers,.
* Continuous investment: In order for the bunker to remain useful into the mid and late-game, periodical upgrades will be required and will sap your resources unless you decide to abandon or repurpose the building.
* Hostile takeover: Enemies gaining control of your bunker(s) can prove dangerous as they can utilize the effective cover.
Pillboxes can be incorporated into perimeter walls, but make sure that there is no direct entry from there, such as by building a durable door.
==== Secondary cover ====
Besides your main line of cover, you may also build additional cover for various purposes:
#For shield distraction, building cover for your shield tanks helps them to last longer with their shields.
#Putting lines of sandbags perpendicular to your main cover line allows them to be used to flank enemies. Make sure that they are put a great distance away so enemies can't use it to their advantage.
=== Chokepoints ===
Chokepoints allow your colonists to concentrate firepower, killing incoming attackers effectively, as well as utilize traps to their maximum potential. They also allow you to seal off raiders' escape routes by physically blocking them off using your soldiers.
At its simplest, it involves the use of a single opening in a wall, coupled with a location for colonists or turrets to fire and beat them, sometimes with traps to catch some of the unaware attackers. 
Chokepoints should be built with a turn to break line of sight, prevent enemies from firing into the chokepoint from the outside.
A strategy is to litter the choke with sandbags or rubble, greatly slowing down the raiders and giving you time to deal with them. They also prevent raiders from standing on them, forcing them into your defenses.
You can concentrate fire on a crafting spot or animal sleeping spot placed right in the entrance with miniguns to rip incoming raiders apart.
==== Slowing tunnel ====
One early-mid game tactic to slow down your enemies is by creating a narrow strip between your colony and potential areas where raiders could attack from, then alternating sandbags or debris with unoccupied space, close to the exit of the strip.
To stop them from using the chunks or sandbags to their advantage, build a turn to break their line of sight.
Don't put sandbags or chunks right next to each other, otherwise they will simply vault over multiple bags at once, reducing their slowing efficiency. An excessively long tunnel also prompts them to break in instead of entering through it.
Pros
*Fairly cheap
*Easy to build
Cons
*Does not deal damage
It is not necessary if you don't need extra time to set up defenses.
==== Burning floors ====
You can build flammable floors to set on fire, burning enemies. Once the floors are burnt, they leave behind burnt floors that apply a movement factor, and will persist until removed.
=== Traps ===
==== Understanding A.I. ====
Friendly AI will always prefer to move through doors and avoid traps, while enemies will prefer to go around structures by entering open spaces and are unable to see traps. (Note: Recent updates have removed the ability for spike traps to be placed within 1 tile of each other in any of the four cardinal directions)
Because of that, trap chokepoints like this one are effective. Enemies will prefer to use the corridors rather than attempting to destroy doors as it would be more time consuming, and being unable to see the traps, they will trip them hopelessly. On the other hand, your colonists can safely pass using the door instead. Enemies cannot pass doors unless they destroy them first, or they are being held open. (Note: Colonists can trigger traps while walking over them. Consider adding doors in between traps to allow for safe construction of them.)
==== Roof trap ====
This clever trap is simple to set up and hard-hitting when triggered. It can be considered a giant single-use spike trap.
All you need to do is to erect 1 pillar made of a low-HP material, optimally wood, then build a roof over it. When raiders walk near the pillar, demolish it from a distance with long-range guns. You can remove the home area near the pillar to prevent colonists from repairing it, then damage it until it can be destroyed in 1 hit.
After the pillar is destroyed, the roof will fall, crushing the raiders on the head, neck or torso and dealing up to 20 damage (though armor will negate part of it).
You can use cover baiting to lure enemies into this trap very effectively. 
Triggering an IED trap near it is also a viable choice, with the advantage of being automatically triggered and dealing even more damage with its explosion.
This is more of a clever use of game mechanics than an actual trap, so raiders won't detect it, nor will they treat it as one.
Pros
*Large radius, easily injures a sizable group of raiders at once
*Penetrates shields
*Low cost, only 5 wood for each trap
*No risk of friendly activation
*Undetectable by raiders, and position will not be remembered
Cons
*Harder to trigger, may need to lead your targets
*Requires lots of space
*Low damage
*Rarely kills or incapacitates
*Cannot be used in killboxes
It is optimal for softening a group of raiders so it's easier to defeat them. You can also put them in multiple layers, but placing the traps too close to one another will result in the trap not triggering properly.
Grass also cannot grow under it. This can be used to make firebreaks but will cut into your supply of grass for grazing animals so be careful.
File:Roof_trap.png|Roof trap before triggering.
File:Roof_trap_triggered.png|Roof trap after triggering, having injured some raiders (some through shields) and left a large pile of rubble.
File:Roof_trap_auto.png|More refined roof trap design with stools to lure the enemy into using them as cover, along with an IED trap to automatically trigger the trap. Significantly more expensive.
=== Damage minimization ===
These are ways to minimize damage done to your base.
 
==== Firebreaks ====
2-tile wide strips of concrete, metal or stone tiles are capable of stopping the spread of fires. This can prevent many fires from reaching your base and burning it down. This is more important for plant-rich biomes with large amounts of flammable material.
You can build one surrounding your base, and divide the map into sections in order to control fires. You can also use them to separate crop fields such that a fire won't consume all your crops.
Keep in mind that building such amounts of floors usually requires huge amounts of building materials - if you have stone on hand it is better to build a perimeter wall out of stone instead, with the added advantage of fortifying defenses.
==== Grazing animals ====
Setting lots of grazing animals around the outside of the base helps clear away grass, slowing or stopping the spread of fires towards your base. They may also distract raiders during raids, but at quite a cost.
==== Walling structures ====
You should build an additional wall around your important structures, such as generators, power conduits or cash crops, even if you do have a perimeter wall in place. This causes raiders to prioritize other targets over these, averting destruction.
For geothermal generators, remember to have some exposed roof areas so the heat from the generator can vent out instead of being trapped inside.
==== Power network ====
It's not a good idea to have only 1 wire connect everything in your base, as one broken-down conduit can easily cause a blackout. Instead, create a backup power storage by building batteries hooked to the grid, but run through a power switch that is turned off once the batteries are charged. As a supplement, run power conduits through more than just one wall on your grid so that if you have a break in one line, you may still have power flow in another without needing to immediately build a new conduit.
=== Panic room ===
You can dig out a panic room deep into the mountains or build one out of very thick walls. This provides a good escape if you know that you can't defeat an incoming group of raiders, or you are losing and need retreat, provided you manage to get to the room in time.
*If you dig one out of the mountains, you gain immunity against mortar shells and some innate temperature control. You will need to make many layers of doors (at least 6) as the raiders will focus down the doors.
*If you build one using thick walls you have more flexibility in its positioning, and you don't need that many layers of wall - 4 layers are OK, since raiders will divert their attention to the walls as well instead of focusing down the doors.
You don't need to make the panic room big enough to accommodate the whole colony, as the point of a panic room is to preserve colonists in a dire situation so you can rebuild later on. Choose the colonists most important to you when it's time to escape to these rooms.
Panic rooms also need the following:
*Enough food to last 1-2 days at full capacity
*Medicine for the wounded, for injury is likely during the retreat
*Joy objects (otherwise colonists may face a huge -20 mood penalty)
If you want, you can put beds and tables to make sure your colonists don't feel too bad while cooped up inside. You can also choose to put building materials to seal up the entrance with cheaper and more durable walls. Putting resources inside also helps with rebuilding, though they take up space.
While inside the room, if you're down on your last door or layer of wall, assign your best builder to hold the door by repairing it, and make sure the others don't go out. Disabling firefighting for covering colonists or restricting them to the panic room can help stop them from leaving. If the doors are unable to hold, use the breach as a chokepoint instead, and take as many enemies down with you.
Consider building multiple panic rooms so your colonists have another panic room within reach if a raid blocks off access to one. You can also choose to build another exit so you can flee to another room should the original be overrun.
== Mid-late game defense ==
=== Turrets ===
Turrets are automated defenses which shoot at enemies in range. There are three varieties; the mini-turret, autocannon turret and uranium slug turret from 1.0 onwards, while in earlier versions there is only 1, the mini-turret.
In 1.1 all turrets received a great nerf to their firepower.
Turret-reliant perimeter defenses are generally only viable for the first several raids, after which the areas will quickly get overwhelmed each raid due to not being able to focus fire on the numerous raiders. 
While protecting the outside starting area, you may want to rapidly pause the game during raids and give orders to repair damaged turrets. 
Remember that turrets may explode when critically damaged, so get your colonists to run from them.
All require barrel changes or reloading after extensive firing starting on 1.0, making relying on them more resource-intensive.
==== Mini-turret ====
Mini-turrets fire light bullets at enemies within its range.
With its low firepower it is not a good idea to extensively rely on them, especially in mid-late game. However they do provide decent additional fire to lay on the enemy combining with gunners, and also serve as a distraction from your more valuable colonists.
Pros
*Can be uninstalled and re-deployed wherever needed, making their placement slightly less of an issue
*No exclusion zone allows them to fire at touch range
*1x1 size makes it harder to hit and more compact
Cons
*Inaccurate at long-range
Building turrets out of Plasteel brings their health to 335 (up from 120), making them substantially more durable and slightly less flammable.
==== Autocannon ====
Autocannons deal moderate damage and are long-ranged, but have an exclusion zone making them less effective against close enemies in the frontline.
They are somewhat costly to build and maintain. Despite its long range, it is actually effective only when enemies close in due to its low accuracy.
Pros
*Shots deal decent damage
*Somewhat high fire rate
Cons
*Inaccurate at long-range
*Somewhat high cost per shot
==== Uranium slug turret ====
A long-range turret that fires a high powered uranium slug.
It is more accurate than the other turrets at long distances and has much longer range, but is more expensive to maintain and performs poorly at close range.
Pros
*High damage shots
*Extremely high armor penetration, able to negate most all armor on an enemy
*Accurate at long ranges
Cons
*High cost per shot
*Not good at close ranges
==== Weaknesses ====
Turrets are most vulnerable to the following things:
*Explosives deal immense damage to turrets. All forms of regular explosives wielded by raiders are capable of 1-hitting a steel mini-turret and leaving a plasteel one at less than half health.
*EMP stuns the turrets. Enemy EMP grenadiers can stun a turret for 20 seconds with each grenade, meaning they can constantly lock down multiple turrets, especially those put close together.
*Smokepop packs prevent turrets from locking onto targets within or behind smoke. An enemy equipped it can create a safe zone from turret harm.
**This is a great issue in killboxes, where turret firepower is often concentrated, as an enemy that activates the belt will essentially be able to nullify a large portion of your defensive firepower.
Turrets can be ignited, and are unable to put themselves out. Given enough time, flames can debilitate the turret.
For the mini-turret, long-ranged gunners can shoot from outside their range without retaliation from the turret. This includes lancers with their Charge lance, making them less than ideal for fighting off Mechanoid incursions.
==== Turret emplacements ====
Sandbags can be placed around turrets to give them cover from gunfire. Turrets should have them to reduce damage taken both by the turret and colonists behind the turret repairing/shooting. This has the added advantage of making it harder for melee raiders to run from an exploding turret.
They should be spaced out by at least 3 tiles to prevent a turret explosion from damaging other turrets, potentially causing a chain reaction. Alternatively, use high-durability walls to block explosions.
==== Turret chokepoint ====
Putting a turreted defense in a chokepoint with a narrow entrance and wide turreted area is best because it forces the raiders to take a single-file approach to where all the turrets will be able to fire on them.
There should be more than one line of turrets so that the innermost line or lines can be used to position colonists where they are not immediately under threat from grenades (grenadiers will target the closest turrets first) or if colonists are positioned closer so they can repair, to retreat colonists further back when turrets are about to be or have been destroyed. Every line of turrets should have a line of sandbags directly in front and every supporting wall/rock should also have sandbags to lessen the likelihood of collapse due to collateral damage. 
Turrets should not be placed directly (within three tiles) next to other turrets for the same reason, as they have a chance to explode when critically damaged. Placing walls between the turrets can lessen the impact of explosions, allowing you to put them tighter, but remember walls can block line-of-sight and bullets.
==== Booby-trapped turrets ====
Melee enemies may go straight up to the turret to engage it. To take them down, you can put traps near the turret such as spike traps.
IED traps can be useful if you're using the turret as bait to lure enemy fighters straight to their doom, which is rather costly since the turret would likely be taken down as well. IED firefoam traps may see some use if the enemy comes in using both incendiary and melee weapons, as the firefoam traps can automatically trigger to protect the turrets from the flames.
==== On-demand turret deployment ====
For mini-turrets, instead of placing static turrets around the perimeter, you can instead keep them uninstalled and placed in the center of your base. Once raiders come, have a builder install them facing the battlefield, behind your cover. This helps to save power and also allows you to utilize turrets more efficiently as you can keep more turrets engaged on the enemy rather than just sitting there due to lack of contact with the enemy.
This tactic is less effective against melee charges who will swarm your defenders before you have enough time to react.
==== Turret power network ====
Turrets should be turned off whenever not in use. However, it's hard to anticipate when they will be needed, given the random nature of events in RimWorld, and turning them on by then is usually too late.
To fix this, connect your turrets to a separate power network, reconnecting them if needed. To toggle them all at once, install a power switch in a convenient location. The power switch can be then used to easily toggle a lot of turrets at once, saving power. 
This method saves a few seconds of time as turrets can power up before the enemy gets within range, allowing them to fire 1 extra volley of bullets. This is not to be underestimated as turret bullets pack quite a punch. However careful arrangement of power conduits is necessary especially if geothermal generators are used.
=== Mortars===
 
A mortar attack on siege and raids can be effective while the attackers are still preparing. It's fun and most times raiders would flee before begin their assault due to huge losses of men during preparation.
It also allows you to effectively utilize your colonists who are poor at combat, as mortar accuracy is unaffected by colonist skill, however colonists incapable of violence will outright refuse to man a mortar.
Always to remember to manually unassign colonists from mortars; if you don't, they will continue standing there until they eventually collapse from exhaustion, starvation, or have a mental break.
An important point to remember is that while your colonists are better at dealing with single or spread-out enemies, mortars are designed for heavily grouped enemies. If you diffuse your enemies, the mortars will not be able to hit the enemies easily.
Don't aim mortars anywhere too close to your colonists otherwise you risk friendly fire.
==== Mortar emplacements ====
Mortars can't be placed under roofs, so they're usually placed outdoors. In which case, build shelves to hold the mortar shells so they won't deteriorate. Set them to accept mortar shells only otherwise your colonists will haul random objects to the shelves.
Mortars also explode when damaged. Most of the time this isn't an issue, but if you're facing against a siege, an enemy mortar shell that scores a hit on your mortars can cause a chain reaction to rip apart your entire mortar emplacement, killing any crew manning it. To fix this, separate the mortars with high-HP walls that can survive at least 1 hit from an exploding mortar. Building mortars with plasteel also allows the mortar to survive a mortar hit, provided that the mortar shells don't explode.
Mortars can't fire at anyone within 30 tiles of it, so you will need to place the mortars deep inside your base for maximum coverage. It needs to be well-protected against intruders, for enemies that survive to come close to the mortars can wreak havoc on the helpless mortar crew, so you should pay attention and unassign the mortar crew to fight if necessary. It's best that you have your colonists standing guard outside, but if you need to you can always have a few pillboxes to defend the mortar base.
Keep in mind that your landing mortar shells will blow up anything nearby, including things of yours that raiders don't commonly target, like conduits. If your turret killbox relies on the power of remote geothermal plants and a mortar strikes nearby, it could break the conduit and cut the power to all of your turrets.
==== Mortar battery ====
The number of mortars needed depends on how they will be used.
If you're solely keeping them there to use the EMP shell then 4 is enough.
For high-explosive shells you will need 8 for a decent battery. 12 can seriously injure incoming raids, and 16 or above is pretty much overkill unless against tough enemies such as mechanoids.
==== Shells ====
There are different shells available to be loaded into the mortar.
*High-explosive shells are the go-to ammo for dealing damage to enemies.
**Shield belts can easily block damage from the mortar, so it's best to have backup.
*Incendiary shells deal low damage, penetrate shields and set areas on fire. The fire can cause disruption among the enemy ranks, as they frantically run trying to put out flames.
**It can be paired with brawlers, which allows them to close in with less firepower on them, and force the enemy into melee combat, preventing them from extinguishing the flames on them.
**Be careful as the fires can spread across wide areas causing extensive collateral damage.
*EMP shells are highly situational, yet are useful to warrant their use in every well-built defense (other than killbox-reliant ones). They don't deal any physical damage whatsoever, but are useful against some specific enemies. They have a large blast radius, meaning that their inaccuracy is less of a problem compared to the others.
**They can stun mechanoids for 20 seconds, allowing your colonists to close in on them and concentrate fire, or even engage in melee safely. You can keep engaging the mechanoids as you wish when the shells land; you don't need to worry about the mortars injuring your soldiers (though you may want to keep an eye out for your shielded brawlers).
**They excel at dealing with shield belts, instantly downing many at once. This can be helpful in preparing for a melee blocking or killbox defense. 
**They can also shut down mech high-shields for 0.5 hours, giving you an window to send a barrage of high explosive shells to destroy whatever is inside.
*Firefoam shells can be used to extinguish fires outside your base, but is useless against any inside, due to the mortar's blind spot.
=== Traps ===
As you unlock research, and obtain more manpower and resources, you can lay more traps to debilitate incoming raiders.
==== IED traps ====
Early on, you may want to focus on armed colonist defense with turrets, but as the raiders grow in number, it becomes more efficient to use a bit of metal to kill several at once than to invest a lot of metal in a turret that costs nothing to fire, but will explode rapidly due to large raider groups.
IED traps are extremely effective when used correctly, however in open areas they are mostly useless as the raiders are highly unlikely to step on any of the traps, and even if they do they're usually not tightly packed enough for the trap to cause serious damage. Thus, it is better if you combine traps with funneling to force the raiders together.
1 IED trap can trigger other IED traps in its explosion radius. This may or may not be desirable depending on the situation; you can easily set off a chain reaction to destroy a whole incoming raider horde, but also use up much more resources. They also damage nearby structures, such as walls or spike traps, so don't put too many close to each other.
* Rather than setting more IED traps near existing ones, you can just place the Mortar shells themselves, or even some Chemfuel on the ground for the same effect as a molotov cocktail blast. However, unless you can restrict them to placing just 1 of each it's more expensive to do so.
** Chemfuel has 50 HP, just within the damage threshold of an IED trap, but the shells have 70, so you will need to pre-damage them or leave them on the ground to deteriorate first if you want to use this tactic.
IED traps have a delay before exploding, allowing some raiders to escape. Raiders will attempt to run from an exploding trap, though the fuse is short enough to catch some of them.
Pros
*High area damage
*Raiders usually less protected against explosives
Cons
*High resource cost
*Single-use, non-rearmable
*Requires research
*Does not instantly trigger
==== IED incendiary traps ====
A variant of the IED trap that sets enemies on fire. It's a more situational pick compared to the regular trap, due to its incendiary nature.
Pros
*Distracts enemies while they are on fire
*Penetrates shields
Cons
*Low damage
*Not effective against Mechanoids
Its use requires strong support to be effective. With that, it is a good defensive choice against heavily armored or shielded enemies, with the flames providing good distraction while your colonists shoot them down. 
It synergizes great with brawlers, which will prevent the enemy from attempting to extinguish the flames while fighting.
==== IED EMP traps ====
A variant of the IED trap that creates an EMP pulse. It's a more situational pick compared to the regular trap, due to its EMP explosion.
Pros
*Instantly downs shields
*Stuns mechanoids for a long time
*Large blast radius
Cons
*No physical damage
Its use requires strong support to be effective as it can't deal any damage. It is excellent against mechanoids or shielded enemies, however.
==== Mountain trap ====
An extreme version of the roof trap using overhead mountains instead of constructed roofs.
To use it, you mine out a whole mountain except a pillar in the center. Then you damage that pillar until it has just a sliver of health left (25 or less for easy activation with a single sniper rifle shot). Mining out all the rocks at once will result in your colonists getting crushed by the trap.
It is triggered the same way as the regular roof trap, and has the same effect radius except victims are instantly killed and buried. 
The collapsed rocks spawned after this trap is triggered can be useful or harmful depending on the situation.
Rearming it is a lengthy process as you will have to mine out lots of rocks. This does provide a decent way to train miners though.
Pros
*Instantly kills any enemy
*Leaves no corpses
Cons
*Takes much longer and is more dangerous to re-arm
**You have to mine out everything then support the mountain roof with a low-HP wall; compare with regular roof trap which simply requires building the wall and the roofs
**Colonists risk death if you aren't careful
*No loot or capturable downed raiders
*Overhead mountains may not be easily available
In mountainous areas where overhead mountains are abundant, this trap can absolutely destroy any incoming raids, especially when combined with funneling.
=== Reactive firefoam poppers ===
You should have some uninstalled firefoam poppers on hand. When a fire starts and you need to extinguish or control it, you can reinstall them near the fire, and trigger them.
Firefoam on the ground slows movement speed of pawns by about 25%. As it covers a wide area, this can be slightly useful as area denial to slow down charging melee attackers, though it prevents the use of fire against them.
=== Firefoam roof array ===
Due to the slight slowing effect of firefoam, you can deploy a large amount of it to slow down enemies crossing by. However, since rain washes it away, you need to erect a roof to prevent that from happening. You also need to clear home area so colonists leave the firefoam alone.
This has the added effect of creating an excellent firebreak against wildfires, as well as creating a roof trap that can damage enemies.
Initial deployment of the firefoam is very expensive without the use of chokepoints so it isn't recommended for open base designs.
== Killboxes ==
Killboxes are heavily trapped, armed areas where enemies are funneled into so they can be destroyed easily.
They almost always consist of a funnel which directs raiders into it, like a wall with a single opening, which opens into a zone where your colonists and turrets are located.
Raiders will then trickle in, allowing colonists or turrets to concentrate fire on them, or traps to destroy them while they try to move in to attack. In the killzone, enemies lack cover and are within close range, while your colonists have plenty of cover to fight from.
This is an extremely effective way to defeat most raids, as the enemies will often be overwhelmed by the sheer firepower raining on them. It also allows effective use of traps, as funneling enemies greatly increases the chance one's going to trigger them. A well-built killbox can easily neutralize the threat of many raids, which may make the game less fun for some players.
Note that killboxes aren't a catch-all solution to enemy threats, and you still need tactics to handle drop pod raiders or sappers.
=== Building ===
The entryways should lead to a large 'box' where the killing begins (hence 'killbox'). The box should be surrounded by cover sources (preferably walls plus sandbags) where your colonists fire on the enemy. For increased firepower you may build turrets as well, away from your colonists' firing line and separated from each other by walls, in case they explode.
It's always best to double-wall the "receiving" end of your killboxes as the sheer firepower raining on your enemies will inevitably destroy some of your own walls by accident, allowing raiders to flood in from another direction, bypassing traps and overwhelming your defenders. This is especially true if you use explosives such as frag grenades or IED traps to kill incoming enemies.
=== Entryways ===
Any entryways of the killbox should not be straight, otherwise raiders will simply fire using the entryway as cover. Instead, you should have a turn to break line of sight, prompting the raiders to enter an area where you can get them easily. For better effect, put a grave or other similar object that raiders can't stand on. The entryway should be single wide to allow the use of melee blocking if necessary.
The below shows the results of different killbox entryways.
File:Killbox_right.png|Right design of a killbox entryway. Raiders are prompted to move into the killbox, sometimes so close that they prefer to melee attack instead of shoot.
File:Killbox_wrong.png|Wrong design of a killbox entryway. Raiders are bunching up in the entryway, using its walls as cover.
Entryways should be long, but not too long, corridors with sandbags or barricades every second tile to slow enemies. Do not place a continuous line of sandbags or barricades, as pawns only slow down when they are climbing on and off the two (similar to real life, as you can just run on the barricade after you climb on it). In between the spaces, spike traps can be placed to soften up the raiders (with doors adjacent to the sandbags so your colonists can replace them). At the end of the corridor, place a T-Shaped sandbag line (do not alternate with empty tiles like before), as pawns cannot stand on the sandbags and therefore are incapable of using the corridor exit walls as cover. IED traps can be used, but should be used sparingly lest they blow up all the walls of the corridor.
Don't make your entryway excessively long, otherwise raiders will think it's not worth it going such a distance and will decide to go for something else instead. Manhunters however will still chase colonists down a long corridor or over extreme distances, so you can have some dedicated anti-manhunter killboxes with extra-long corridors for this purpose.
If your entryway is long then you may need to build doors to allow friendlies to enter without setting off your own traps or having to go through all the obstacles. This door obviously needs to be fortified against enemy attacks.
File:Slowing_tunnel_long.png|Entryway with alternating sandbags to slow raiders and doors to provide access. Slows raiders but not colonists.
=== Equipment ===
Different equipment is necessary in different situations. 
==== Short-range killboxes ====
Colonists defending in a short-range killbox will be shooting at a large number of targets no more than a few tiles away. Thus, defenders should use close ranged high damage weaponry for firing at raiders.
* Chain shotguns inflict extreme pain at killbox range, surpassing the DPS of every other weapon at short range or less.
* Miniguns are excellent at attacking the bunched-up raiders inside a killbox, but require large amounts of resources to craft ().
* Charge rifles and heavy SMGs are second-tier picks, being able to dish out hurt against closely grouped targets at close-mid ranges.
* Long range weapons are not optimal due to low DPS. Instead, use them to pick off survivors outside the killbox.
* Grenades are good if you can time them right. Throw them near the entrance where each explosion can hit a tight group of raiders, especially if they're slowed down with obstacles, but take care not to demolish your own walls.
*Have melee colonists stand nearby as raiders who enter your killbox may decide to melee charge you instead.
==== Long-range killboxes ====
Colonists defending in long-range killboxes will be shooting at bunched up raiders. Thus, defenders should use mid-range, fast firing, and decently accurate weapons to inflict as much damage as possible. Note: It is possible to modify a killbox in a pattern that leverages both long and short range weapons. This can be accomplished by creating a passage that has a 45 degree angle "open to the field" while keeping the main 90 degree passage open to short range fire only.
* Charge rifles are the best weapon for this purpose, shooting 3 semi-accurate high damage charge shots. It also has a decent 26 tile range and an excellent 35 percent armor penetration, essential for killing targets late game, when your killbox is more developed.
* Heavy SMGs are excellent alternatives to charge rifles. Significantly cheaper but similarly skill friendly and with a solid DPS. 
* Assault rifles are basically charge rifles with lower damage and armor penetration, but making it up for its longer range and higher accuracy. Higher skilled pawns are required to make use of their range however. 
* Miniguns, Chain shotguns, and perhaps LMGs are second options, excelling at crowd control, especially against tribals.
* Explosive weapons are not advised, as raiders will be moving around the killbox frequently, and grenades have a delay between the grenade hitting the ground and the explosion of the grenade.
=== Turrets ===
You can put turrets in a killbox. They help to provide additional firepower alongside your colonists.
You may also choose to fully arm your killbox with turrets, with enough to single-handedly take out raids especially in tandem with traps. Doing this allows you to defeat raids automatically without the need to divert colonists from other jobs, but eats up power when active and resources to maintain, and is vulnerable to solar flares, EMP grenadiers or smoke, so you will need backup.
Turrets should preferably have their own cover. They should also be connected to a separate grid which can be shut off to deactivate them all, to save power when not active.
Mini-turrets and autocannons are the best choices for killboxes, being able to dish out hurt at killbox ranges. Place mini-turrets close up to the enemy, while place autocannons slightly farther away to keep enemies out of its minimum range.
Alternatively, if you can keep the enemy in one spot, a specially designed killbox can allow uranium slug turrets to function well. Uranium slug turrets are most accurate at 40 tiles or above, achieving a maximum of ~61% accuracy against humanlike enemies, so you will need to place them that far from the entrance, and distract enemies so they do not go closer. Slug turrets are good against tankier pawns, as a uranium slug can easily rip through Centipede and Power armor.
It is better to 'Hold fire' until the enemies have actually entered the killbox, for all the turrets will focus fire on the first enemy to try and go through the entrance, which is very much overkill.
=== Blocking ===
As melee blocking is more effective than even a killbox used normally against melee only attacks, it's best to have somewhere that you can do this.
Melee blocking can be done at killbox entrances, as long as it is one-tile wide and has sufficient empty space in front. Both the entrance to the killing area and the entrance to the covered area where colonists fire onto enemies will work:
*Doing it in the killing area allows you to spare the turrets from immediate destruction, and they may add firepower.
*Doing it in the covered area entrance allows you to sustain fewer injuries by having the turrets take the damage first.
=== Explosive weapons ===
Enemies carrying explosive weapons can be very damaging towards your killbox and the defenders inside.
Centipedes with inferno cannons can counter killboxes as the fire makes your colonists lose control and run out of cover, and the flames can destroy turrets easily. Having some firefoam poppers inside your box helps a lot with extinguishing fires and preventing future fires.
Another counter for killboxes are raiders with the triple rocket launcher and doomsday rocket launcher. If they manage to shoot inside your box the damage can be massive, and it is hard to distract them in a killbox. You can concentrate fire from your colonists on them, or keep psychic shock lances and psychic insanity lances near and use them if you see that they will not die fast enough.
=== Fire killbox ===
Besides killing enemies with conventional weapons, roasting them with fire is also an effective choice. You need to lure them inside, light up flammable objects to heat up the killbox, and evacuate colonists so they don't get roasted as well.
Fire killboxes are slightly more complicated to operate than a regular one, where you can simply wait inside and fire; you will need to direct colonists, while others light up fires and then make a break for it. 
You can shut off the killbox by either leaving doors open to let enemies in, which you then shut off by disabling "keep open", then directing a colonist through them, or by building walls.
They need to be at least walled to prevent enemies from breaking out, and also to insulate it from the outside so that temperatures rise faster. Stone walls are optimal as they are non-flammable.
== Killhall ==
Another possibility is to build a long corridor with traps, that can also be used shoot enemies from cover: a "killhall".
It acts as an active and passive defense:
* If used actively, it allows to kill enemies will little to no harm done to colonists, and with little damage to repair after the attack.
* If used passively, it'll lure enemies into spike traps. Only very large or tough groups of enemies may go through (by springing all the traps), or possibly enemies with the "nimble" trait (that will avoid all of them).
If the first part has many obstacles (e.g. stone chunks, barricades or sandbags), and another branch of the corridor is empty and ended with a flimsy door (e.g. a wooden door, or better: an animal flap), fleeing enemies will try to escape by this seemingly faster exit, but they will fall into another group of spike traps, eliminating the rest of the raid.
A drawback is that last part of the corridor has to be quite long to work properly, i.e. a bit more than the range of the weapons used (e.g. 30 tiles for assault rifles and charge lances, 45 for sniper rifles).
This is not an issue if it is placed under a mountain, the best location being at the corner of the map.
=== Attack of a killhall ===
An attack will proceed as follows: 
# Enemies will be lured into the hall, thinking it is an unobstructed way into the base.
# They are slowed by obstacles, leaving time for colonists to take position inside doors, hidden behind wall corners, waiting for them.
# Enemies are shot one by one by colonists, they are slowed by stone chunks and cannot rush in for a melee attack before they get shot. Enemies who shoot behind their friends others can sometimes hit them by mistake.
# Once half of them are dead, they decide to flee, but instead of going back by the way they used to enter, that looks cluttered by chunks, they try to break the doors on the side of the corridor.
# They are still shot at by colonists, but once they broke a door, it seems that there is only a flimsy animal flap between them and liberty.
# Unfortunately, what seems to be an exit path is littered with spike traps and they get killed one by one by them.
# If some of them still manage not to get killed by the traps, they get shot like clay pigeons in the exit corridor.
# It is now time for the colonists to strip the dead enemies of their possessions and store their corpses for later use...
If colonists decide not to attack the invaders, half of them will be killed by the traps on the entrance way, the other half on the exit way.
If the attackers are manhunting animals or mechanoids, they will not try to escape and will all be shot or being trapped.
=== Example of a practical implementation ===
# Entrance and "escape exit".
#* The entrance has a door "held open" and "forbidden", so enemies can enter, but not friendlies.
#* The "escape exit" has an animal flap (can be substituted by a wooden door), leading fleeing enemies to think that they can break it to escape quicker.
# "Slowing down" corridor, filled with stone chunks spaced one tile apart that will slow down enemies, give time to prepare and make this path look like a slower way to escape.
# "Shooting range" corridor, where enemies will be shot at from distance and will be forced to advance one behind another. It is also filled with stone chunks to slow them while they're being shot at (as chunks may be moved or destroyed during the attack, 1×1 stockpile zones allowing only stone chunks should be placed, enabling their quick rearrangement).
#* Above, the "escape exit" corridor, filled with spike traps (doors allow replacing traps without having to walk on them).
#* Below, the "entrance to the base", also filled with traps.
# Part of the hall where colonists will shoot, taking cover with the wall corners. If the enemy has weapons with more range than colonists, they can hide behind the doors and pop out when the enemy is close enough.
# "Entrance to the base" (or at the part that enemies are planning to reach), with wall corners at the end to use as shooting positions (in case some enemies reach this part).
# Human corpses walk-in fridge, to put the bodies after the battle and keep them away from the view of colonists, avoiding the "observed corpse" debuff.
#* It should be quite large, as enemy raids grow in size, and butchering humans should not be done every day, to avoid a permanent I\we butchered humanlike debuff (see the possible mitigation strategies). It can also hold the human leather stock, as it takes much space once butchering is done. 
#* This can also be a place where corpses are burned, if it is preferred to butchering.
# Human kibble factory, where human meat can be processed into kibble (that extends hugely its conservation time, can be sold, or fed to any animal). 
# Repair stock, that holds the necessary materials to quickly repair the walls and the spike traps after an attack.
# Hospital for prisoners, to quickly save them if they survive.
Points 6 to 9 are optional, but are great improvements if used.
==== Additional notes ====
* Walls of the parts 3 and 4 should be tough and fireproof. Best would be plasteel, then uranium; granite blocks may also be used but will break down faster, and flammable materials are to avoid at all costs.
* Flooring should be put in place to keep the mood of the colonists high when they are in the area.
* Walls and flooring of the parts 2 and 5 doesn't matter, as colonists will very rarely go there, and there shouldn't be much fighting in these parts anyway.
* Spike traps should be made out of steel, as it has the best price-quality ratio for this device (nevertheless, steel is flammable in RimWorld, but here, traps are protected behind the walls and doors).
* Accurate weapons should be preferred for colonists: the narrow corridor will be damaged unnecessarily if explosives are used, or weapons like shotguns or miniguns (not to speak of their reduced range).
* The hall should like an unobstructed path to enter the colony (i.e. no closed door between the outside and the inside of it), but the doors leading to it that will be used by colonists should be strong enough to deter attackers from trying to break them.
* The number of stone chunks in the way is also important: if there are not enough of them, fleeing enemies will just escape by the way they attacked and will not be led into the spike traps on the supposedly quicker escape route.
== Situational ==
=== Crashed ships ===
It is vital to know Mechanoids' behavior:
* Any attack to the ship will trigger its guardians, and they have a long aggro range of around 40 tiles from their spawn point. The larger the map, the easier it can be to deal with them, as long as the ship crashes away from your base. This means that as long as they are far from your base, Mechanoids will still NOT chase you yet.
* When the ship's health falls below 50%, Mechanoids will stop guarding and will instead proceed to attack your base as a normal raid.
You can trigger a ship's guardians from a long distance either by bombarding with mortars or hit-and-run with sniper rifles.
Currently, the best approach is to deal with the Scythers first, followed by their ranged units. There are a variety of alternatives, but the nature remains the same; hinder the melee range closing-in of their shock troops. 
==== Preparation ====
Though these ships are "time bombs", instead of immediate action, you can spend a few days building preparations before engaging them.
* Placing a spike trap right in front of your sandbag may be helpful if the need to retreat arises, as mechanoids will very likely want to use the shortcut.
* Always make sure you have a safe path between your walls and your base, so that there's safe cover between your "ins" and "outs"; battles can take a long time if short on numbers.
Building IED traps can also be a good way to hurt the mechanoids, especially if there is a long distance between your colonists and the ship part. High-explosive traps deal hefty damage to incoming scythers and lancers, while EMP traps stun them, making them vulnerable to attack. 
If possible, a properly placed antigrain IED trap can obliterate most of the mechanoids, leaving a few heavily damaged centipedes to fight at most.
You may also want to keep a few firefoam poppers nearby. Trigger some of them before combat to prevent fires, and leave a few more to rapidly extinguish a group of burning colonists at once.
After you have finished preparing, you can use EMP shells to stun the mechanoids. Proper firing will make them helpless hunks of metal, once you get used to this technique, you can even preemptively fire EMP shells and then trigger the guardians, so as soon as they pop out, they instantly get hit by EMP shells. The number of manned mortars will factor in, as the chance to miss for each shell is quite large.
==== Cover ====
Use the "fire wall" cover approach detailed above, with melee units stationed behind each sandbag to hold off the scythers while your gunners lay fire on other mechanoids.
Ideally, the cover should be placed a distance from the ship, giving you time to soften incoming scythers with concentrated fire.
File:CSP v1 new tactics 101-00.png|Zoom out
File:CSP v1 new tactics 101-01.png|Zoom in
=== 'The Purifier' ===
This is a powerful way to burn a massive infestation to a crisp. Provided that the infestation have no direct access to map edges and unroofed areas. 
To start, build a medium-sized room (approx. 5x5) with triple-thick stone walls, next to the infestation. Fill it with Straw mattings, and flammable objects such as wooden barricades, it has good hp which means it will burn for longer and has high flammability, so it will catch fire quickly. Another alternative is to use tainted clothing.
After that, dig a 1-wide tunnel towards the infestation at night when the insects are sleeping. Finally, toss a Molotov into the room. 
Once the temperatures reach (), insects will begin to burn. They will attempt to dig out by rushing towards the purifier, but be set alight by the burning Straw matting, making them unable to dig. Temperatures can rapidly reach or above, boiling both the insects and the hives. Even those that don't get set alight will eventually succumb to heatstroke.
Although using this method will not yield you valuable insect jelly.
Category:Guides