The concept of "terrain" in wargames, and many roleplaying games, includes not just the ground beneath a character's feet but also surrounding objects and structures. Setting up terrain for combat encounters is helpful to players because it defines what space they have to work with, and what physical obstacles their characters face. As a catch-all term, terrain can encompass land, walls, ruins, treasure chests, and even hazards (usually called difficult or dangerous terrain.) Difficult or dangerous terrain can be tricky to manage in a miniatures game, because once the game master or active player has declared that a threat exists, it's basically been roped off. No sane character would go anywhere near a threat that's just been identified. Conversely, if you don't declare that the threat exists, then a player affected by it might feel like the threat wasn't actually there in the first place, and that you've arbitrarily decided to punish them. But it's actually entirely possible to have hidden traps in a landscape where everything's been fairly labeled. Here are some ways I've found to make difficult and dangerous terrain fun and fair on miniature battlefields.
You can write the location of traps on grid or hex paper that you keep hidden from other players. When a miniature steps into a space on the dungeon or battlefield that corresponds with the space you've marked as trapped, then you reveal the paper as proof of the trap.
This works very well for dungeons, spaceship interiours, and other tight spaces where traps are likely to be a situated in a bottleneck of hallways or passages. This method is really the traditional method and it's what D&D maps have used for decades. The game master has a secret map with traps and secret doors and other surprises marked on it, each of which is revealed when a character triggers it. It's a reliable system that reinforces secrecy. Traps and other surprises remain completely hidden, with no clue of their existence.
It can be difficult to manage if your game doesn't use a grid or hex map. If you use a tape measure to determine movement distance, it's highly unlikely that you'll be able to detect when a character has triggered the location of your trap. In this case, you might want to agree with your opponent or party that a trap is an area of effect rather than a single point on the map. When a miniature is close enough to a hotspot you've marked on your map, then the trap is triggered. Of course, even this can be difficult to judge by eye, so it's best to set a trap near some terrain that already exists. For example, a broken-down cart might not be trapped, but a trap is triggered when a miniature moves within 3 miniature bases of the cart on the north side. That's easier to judge by eye, and it's always worked for me in friendly games where we're not measuring every last millimetre anyway.
It can be burdensome to cross reference each and every space a miniature passes through with a hidden map, especially without visual cue to help you remember where you've placed a trap. The obvious solution (that also doesn't work) is to place a seemingly innocent piece of terrain to mark where you've set a trap. The problem with that is that players quickly learn to be suspicious of any seemingly innocent terrain, and avoid it at all costs.
The correct solution is not to mark your traps with terrain, but to set potential traps on all essential terrain. If there are doorways miniatures must pass through to reach the exit, then every doorway is a potential trap. If there's a bridge, it's a potential trap. Treasure chests, weapon racks, torture devices, piles of skulls, they're all potential traps.
When a character interacts with a potentially trapped terrain, the player rolls dice to determine whether the item was trapped. As a game master, you can set the probability according to the difficulty of the scenario. If there is no game master, then each player gets some number of trap probability. For example, each player can set 1 trap that's triggered 100% of the time, 1 that's trapped 50% of the time, and 1 that's triggered 20% of the time.
This only works when the object being trapped is essential to the scenario. Most players will do everything in their power to avoid an obvious trap, so trapping a non-essential piece of terrain is basically like removing that terrain from the map.
When you don't have much terrain that's essential but still want to include traps in your battlefield, you can use trap markers that double as reward markers. I use loot boxes or treasure chests, but you can use whatever suits your setting. Whatever you use, at the start of the game you declare that each instance of your marker is either a trap or a reward. A player can willingly interact with a marker and roll a dice to discover whether the marker contains a benefit or a penalty.
I like roll first to determine whether it's a reward or a penalty, and then roll on a random table to find out the effect. Rewards can range from boosts in health, improved movement speed, single-use tokens to ignore hits or a free re-roll, a cool new weapon or weapon augmentation, a victory point or XP, and so on. Penalties could include an immediate wound, a missed turn, a single-use bonus to an enemy, or a curse or negative condition.
The markers are clearly visible on the battlefield, and none are technically essential. However, a negative effect isn't guaranteed, and there's even a chance of a reward, so most players risk interacting with at least a few.
If you're not a fan of marking where traps are, either in secret or in plain sight, then you can implement quantum traps instead. With a quantum trap, a trap exists everywhere, all at once. Every square of a map is both a trap and not a trap.
A player (or game master) can trigger a trap using trigger points. You can decide how many trigger points each player has to spend, but I usually start with 3 trigger points. Trigger points can be played instantly, at any time.
Here's what you can buy with trigger points:
In some games, a "fumble" or "critical fail" is meant to be detrimental. You can make this manifest by ruling that a trap is triggered when a player rolls either the lowest or highest possible value (depending on what the rules considers bad or good).
This doesn't work in a game where you roll a lot of dice due to probability. But it's a nice touch for games based around a d20 (like dnd or Majestic 13) or a single d12 or maybe even a d10 (any less than that and fumbles happen way too often). You probably ought to mitigate what trap has been set off with a random table, or else a string of bad rolls could result in a lot more damage than intended. A healthy mix of scary and really mild penalties is usually a good idea. I'd put the most severe penalty in the table as a critical fail, but otherwise I wouldn't weigh the severity with the lowness or highness of the roll, purely as a way to keep players guessing.
This is an example d10 random table for a trap. Obviously, you may need to adjust damage values and even entire penalties for your game system.
Traditionally, dungeon crawls and similar scenarios for roleplaying games and wargames have done their level best to conceal traps and difficult or dangerous terrain from players. This emphasised the element of surprise, and kept players wholly unaware whether there were even any traps to be worried about. It worked well with scenarios played methodically, with players moving forward relatively blindly and the game master tracking the status of every mapped space on the board. For a more flexible system that retains elements of surprise by emphasising uncertainty and unpredictability, you can use these alternative methods. To sum it all up: