Save For Half
Tacticool: Planning and Tactics
One topic I feel that needs to be addressed is making the most of enemy tactics. Pathfinder, like D&D before it, is primarily a combat/action system, so a good deal of time's going to be spent in battle. Now, broadly speaking, there's different two philosophies on how to best implement the rules. Imagine them on either end of an axis for players and GMs, with one end being the "rules lawyer" extreme and the other being the "make shit up." The "rules lawyer" end might require rolls for everything, constantly cite obscure technicalities (or loopholes) to get his/her way. The other end might be someone who likes to bend or perhaps even ignore rules when they get in the way, with their roleplaying as a certain character or campaign style being a top concern. Most people fall somewhere between both extremes.
There is a set of "official" rules beyond the core ones in Pathfinder, the "Pathfinder Society" (PFS) rules. Some of the items, archetypes, etc. in supplemental modules and material are not legal in organized play campaigns run by Paizo, the studio behind it. If you're doing organized play, then by its very nature, you might be a bit stricter with the rules. Third party material, obviously, is not permitted.
For less official campaigns, though, it can vary based on the GM and group. Sometimes, more than one "rules lawyer" could get into a shouting match with each other, leading to awkwardness. Personally, I fall more under the "Rule of Fun" or "make shit up" depending on the players. By default, material (classes, archetypes, feats, etc.) from Paizo official books is permitted. I start with much of the official material and jump off from there. I also improvise and chance what I've got planned based on the party level and composition. Ideally, each encounter should have something that each player and character can feel really excited about or interested in. For example, the druid might get a chance to smash a polluting wizard's alchemical lab, or maybe the paladin wants some demons, undead, or truly evil critters to smite. Play to the party's strengths and weaknesses.
That said, I would still advise preplanning a good deal of the campaign, like the overarching plot, structure (like if it's a linear or sandbox game), key factions and NPCs, and notable encounter ideas. Just as no plan survives contact with the enemy, no scenario survives contact with the players. Jump off the cliff if you've got some ideas. For example, a lich I had planned as the 'final boss' of my campaign was defeated by the party cleric tossing every healing spell they had at it. If you want a 'preview' of the main villain of the campaign, you could have him disguised as a friendly or have him speak to them via magic (maybe with a disguise on). Some players will trying killing anything that moves, so it's good to have a Plan B (or a few backup ideas planned).
For example, if the party goes on a murder spree, have them have to flee the town guard and fend off bounty hunters after them. Maybe even change the antagonist's motivation to stopping them due to a relative of his the PCs casually murdered.
Moving on, there's still a topic I love addressing: player and GM tactics. As a player, it'll help your character (and survival chances) if you can find a tactical niche suitable for yourself that complements your comrades. For example, the tank might stand between themselves and a healer or spellcaster. It's good to know your class abilities inside and out. A certain obscure ability might be the thing that saves your neck or gets the party through a nasty scene. Also, look for ways to even the odds or use an environment to your advantage (like bottlenecking foes or alchemical items to use). If you're in a fair fight, you're doing something wrong. Even a paladin should look for ways to defeat foes overwhelmingly, since it means they could save energy in case there's unforeseen circumstances.
Now, as the GM, you've got the more challenging task of not only setting up encounters, but also the circumstances, order, locations, and tactics important to each. The best way I can think of is start from an initial idea (say, an ambush), pick a place, some set pieces, and how things may go from there. Just don't be surprised if/when your idea goes off the rails. That's potentially when the most fun can occur.
When planning the idea out, t's best to familiarize yourself with the types of encounters you'd be dealing with in your campaign. What kind of creatures? What kind of encounter? How might it be resolved? I like to leave (broadly speaking) 3 ways an encounter could be resolved: Straightforward, Sneaky, and Social. For example, imagine a pair of guards by a gate the PCs want to get through. They could assault the guards (Straightforward), infiltrate through an opening in the fence (Sneaky), or bluff the guards into letting them in (Social). It's very fun when different PCs try each (and then some) simultaneously. Also, don't be averse to allowing them to leaving a few ways to bypass encounters at times (like sneaky by an enemy patrol).
The abilities and equipment of the monster or NPC the PCs face directly determines the tactics you should employ. You should try making the most of an encounter, no matter which level it is. Likewise, even lower-level enemies can become more threatening with smarter tactics. There's the story of Tucker's kobolds, where a well-equipped and experienced party was cut to ribbons by low-level creatures fighting smart (using tactics like firing crossbows from firing holes, pouring burning oil, etc.). Your players will certainly remember it.
Personally, I like each of my encounters to employ something unique in terms of environment or set pieces. Every enemy type should have a set of tactics. For example, in a recent campaign, my party was traveling down a bandit-infested road when they noticed a screaming, bloody woman by a wrecked carriage. One of them goes to help her, she stabs him, and orders her gang to attack from the woods. A successful perception check would've tipped the PCs off about something amiss (like the footprints and marks on the ground not matching how the wagon appears or the blood appearing dried). The bandit archers rained arrows from the woods, while skeletons they controlled attacked the party in melee. Mixing enemy types as a sort of "combined arms" can make for memorable encounters.
Another idea is to have other NPCs and factions fighting each other when the PCs show up (or perhaps as result of the PCs). In one dungeon I've designed, the PCs released a number of prisoners who'd been held there. A free for all brawl erupts as drow, duergar, crazy gnomes, and more all start clashing. The party may choose sides in such a fight, but who's to say they selected the right one?
One aspect that gets overlooked is terrain. There's a lot more you can do to a dungeon than to make it feel like a collection of stone 5' x 5' squares. I don't just mean make the dungeon interesting from an aesthetic or story point of view (although that never hurts), but make it a part of the encounter. Maybe there's a deep pit nearby to drop unlucky combatants off. Maybe there's some loose rocks on the cliffs above that a good shove or lucky shot could send rolling down the hill. Of course, don't forget to toss in a few booby traps now and then.
Traps shouldn't just be limited to booby traps on doors and treasure. You could also count certain environmental hazards as them, such as potential rock falls, loose pipes of dangerous chemicals, buildings catching on fire, and so on. It can make encounters more dynamic. Buildings collapse, bad guys crash into things after being thrashed, and the door slams shut as they enter the room (useful to separate them). Just keep in mind sometimes, the players can become ultra-paranoid. So, if they check for traps, you can say, "You don't see any traps," or "How are you opening the treasure chest?" There's a reason 10 foot poles became a bit of a gag amongst some D&D groups.
Sometimes, large numbers of creatures (especially weak ones) can be a pain in the ass to keep track of statistically. So, one thing you can do is organize them as one being. Pathfinder and D&D already have a "swarm" template for things like spiders or birds, but a Pathfinder module includes a "troop template" that can be applied to humanoid beings. Even without that, you can easily do it on your own. For example, a squad of skeletal warriors could operate as a squad, and them loosing hit-points as a group translates into skeletons getting destroyed. There's a reason swarms of regular creatures can be more memorable than the demons and dragons the party might be expecting.
Speaking of dragons and flying monsters, there's another foe that doesn't often get used to its fullest. Instead of having them cooped up in their lairs, have 'em fly and attack from above. They shouldn't just stand around on the ground while the fighter pummels them. Fly by attacks with breath weapons, dropped boulders, grabbing foes in talons before dropping them, and the like would soften up the party. The PCs would need spells to help even the odds, or perhaps look for ways to ground the enemy to keep them from escaping. Even if the PCs have trapped the monster in its lair, they should always be reminded they're fighting on someone else's terms. Have the enemies pro-actively hunt them, seeking to weaken them, and prevent them from resting. It'll keep the party on edge for good.
Personally, I often look to history for tactical inspiration. For example, American 'tunnel rats' and Vietcong tunnel fighters might be good inspiration for your next dungeon crawl. You can also toss in inspiration from even advanced periods (like the present). Maybe the villains toss in thunderstones and sunrods as a sort of fantasy flash-bang grenade prior to entering the room. If certain tactic is favored by the PCs, no reason that you can't give them a taste of their own medicine now and then.
There's also the issue of including the PCs in a big battle scene. Armies clash, and the PCs might be beside from all sides. Perhaps the PCs are aligned with one side (or not), but keep in mind a point of war is soldiers working in units. Orc hordes might rely on numbers and ferocity. Dwarves could prefer solid defenses. Elves might pick foes off from a distance and use guerrilla tactics. Or, you could change up the tactics if the PCs are expecting something… To make the PCs feel important to the war effort, have their actions really reverberate across the battlefield. If they take out an enemy leader, units can lose cohesion. If they clear a dungeon of enemy forces, their allies might be able to flank the enemy (or retreat if something goes wrong). I might cover war campaign ideas at a later point, but I just want to get a few ideas out for now. Good luck, and may your roleplaying campaigns involve lateral thinking and fun with tactics.