In the old TV melodramas I watched as a child, it was easy to tell the good guys from the bad guys. You didn’t need to look further than the color of their hats. You’ve got the Lone Ranger in his giant white hat riding on his tall, white horse. He’s a straight shooter, both literally and figuratively. No sneak attacks or subterfuge. No shady deals. His nose is clean as his record.

The sneaky, slouchy bad guys, on the other hand, ambush the sidekick and threaten civilians. They drink and spit. They don’t even take off their dirty black hats when a lady walks by. They have messy facial hair, or maybe a scar. Clearly, they are the villains.

That was good enough for me when I was a kid watching reruns with my cousins. I found comfort in the idea that villainy would be so easy to recognize. I wasn’t yet bored by the patterns, or concerned that certain types of people were always shown as bad guys.

Maybe it’s age or maybe it’s cynicism, but these days, the cardboard scenery doesn’t fool me even for a moment. One good stiff breeze knocks it over.  The story underneath is a lot more complicated, with good people doing bad things and villains who have reasons, sometimes very compelling reasons, for what they do. It’s messy.

And that’s the good stuff. Those moral quandaries are fertile ground for growing a compelling story. The gray areas of life, where you can’t say with certainty that you wouldn’t cross that line in the same circumstances. There but for the grace of G-d go I, as they say.

When I think about my favorite villains, they’re not moustache twirling madmen. They’re people making desperate choices when their backs are against the wall. They are motivated by love and fear, just like the heroes are. Under other circumstances, they might have been the heroes, or at least antiheroes. To some, they are the heroes.

In superhero fiction, these sorts of gray characters abound.

Characters like Magneto, who has powerful reasons to distrust government registration, and who, in many story lines, is proven right in his mistrust. He’s been written as a hero and villain, sometimes within the same story. And both versions are true simultaneously.

Other characters are clearly villains, but still have some goodness in them, a line they won’t cross or some basic humanity. Like Mr. Freeze, like many a mad scientist, who is motivated by love, grief, and anger. Or The Mayor on Buffy, who plans to eat the town, but is still the best father Faith ever had.

Some characters just have different boundaries than the average bear. Like Amanda Waller who thinks she knows what the greater good is, and believes the ends will justify her definitely shady means. Some of these are people who move from villainy to heroism, like Emma Frost or Black Widow. Others merely cling to one bright thing in a world full of muck.

These stories are not simple, and that’s what makes them wonderful. Speculative fiction, even more so than other types of fiction, is driven by “what if” questions. Not only the superpowers and paranormal elements like “what if there are aliens?” or “what if people could fly?”, but the deeper soul-examining situations like “what if killing one saves many?” or “what if you have to choose which ones to save?”

A well-written morally ambiguous character can have you shifting in your seat, giving yourself the side-eye. It’s uncomfortable, and you can’t look away. You’ve got to see what they’ll do, what their limits really are, and what happens when they cross those invisible lines. So, sorry Kemosabe. Both my heroes and my villains look better in gray.