RimWorld's Combat System may seem a little daunting to new players at first, however a few simple guidelines will have you ready to repel attacks and hold ground like a pro.
In every fight there is one very important life saving rule to remember:
Always use whatever cover is available!
The various character roles play a big part in combat. Fighting type characters (i.e. commissar, assassin, pirate) are ideal for combat, use these types first. Keep your commonly used weapons close to your base's front line, so that characters can equip them easily.
It's often handy to keep one unarmed character with only firefighting duties nearby during a fight, if a character catches fire they will run around in panic and likely die. So this extra character can help them out before they panic.
Characters will need rest if they take a lot of damage. This is when you can use the less combat skilled characters, have your injured character drop the equipped weapon and un-draft them, then have your reserves pick up the weapon and fight in their place.
Place your Sandbags in a U shape or zig-zagged pattern, as the extra bags will provide more cover spots for your characters. Walls can be used for lean-around cover and are great for flanking positions. Take care not to place your Sandbags too close to security defenses, as they explode when destroyed, damaging everything around them in a 3 tile radius (starting "outside" the turret).
Loose rubble near your base can be used by attackers as cover, be sure to have your characters clear away rubble as soon as possible. Ranged attackers will be much more exposed with all the rubble removed.
If you have the resources spare, you can make multi-level defenses, with rows of cover you can fall over. This may seem wasteful, but dead characters cost more than sandbags. Be careful as sometimes enemies can also use them to their advantage.
Enemy attackers will move around your defenses so keep your characters behind cover and fall back if you're being overwhelmed.
Sometimes you will have to use more clever tactics to defeat your incoming enemies, such as when you're outnumbered, or you don't have suitable ways to cope with the incoming raiders.
Once enemies have moved into cover and begun shooting, they tend to stay in that spot, even if some of your colonists find their way around and manage to flank them. Since flanking shots are much deadlier than if you were shooting over rock rubble, you should try to do this whenever you can. Enemy snipers can be flanked with their long cooldown to your advantage, as well as prioritizing the ones with the best shooting skill first.
If you design your defense network with this sort of thing in mind, you can gain a massive advantage over most enemies that come your way.
Combat may largely consist of gunplay, with melee combat coming into play. Raiding parties may include melee-wielding attackers (hereafter called brawlers) as well as ranged combatants. Pawns usually will not stack into a cell with other melee attackers, but if they do, only one pawn per cell may attack the same target. This does not apply to colony brawlers, as they can and do stack into a cell while melee attacking the same target.
Melee combat has strengths and weaknesses. A colonist skilled in melee and equipped with an effective weapon will easily win any one-on-one melee battle. However, a brawler trying to close the gap to attack a gun-wielding attacker may get shot down before reaching their target. The shield belt was designed to solve that problem. A colony might develop a small strike team of brawlers that can swiftly eliminate threats in close quarters, especially those that have infiltrated the colony.
If a colonist has gone into a berserk mental break they will engage nearby targets. To subdue them with the least risk of causing serious injury, draft one or more colonists armed with nothing but bare fists or marginally blunt weaponry.
If a pawn has lost all the body parts that can melee attack (such as hands), they will resort to using a head butt attack.
Be careful when you shoot at enemies while allies are in the way or near them, as they may have a chance of being hit as well. Colonists can shoot over the shoulders of allies up to 2 tiles away from them, but any further and they may be hit.
Colonists engaging enemies in melee also have a chance of being hit by their ranged counterparts.
As of Alpha 15 (August 28st, 2016), friendly fire chances reduced by 60% for fly-by shots (shots that miss and land in the cell with a pawn have the same chance to hit as before).
Turrets are an automatic defense that fires at enemies. It has medium range, and deals decent damage up close.
Turrets with a wall of sandbags around them are an effective way to repel attackers in early to mid-game, a few well armed characters with a turret will be hard to beat. Have someone on hand to deal with fires and to repair the turret, but evacuate them when the turrets are critically damaged.
Your characters will slowly become tired and hungry, eventually leading to a mental break if you don't take them off draft. Undraft them so they may work on cleanup and repair. Select dropped items and corpses and unforbid to allow colonists to move them. Build graves, set up a dumping stockpile accepting corpses, or set a bill for butcher table or crematorium to dispose of bodies and prevent colonists from taking a mood penalty.
It's important to keep colonists' mood high and needs satisfied, to prevent them from breaking in the middle of combat, leading to more problems.
A satisfying colony will keep soldiers' spirits high while they starve a sleepless night in the trenches.
The most important combat tip is saved for last. Use the pause feature! The tide of battle changes very quickly with a smoking turret or thrown grenade in the middle of your colonists. Take advantage of the space bar to freeze the action and give your colonists new orders.