In traditional whodunnit mysteries, you can lay false trails and red herrings every which way, but there are a couple things you must do to play fair with readers:
You have to introduce the villain early enough to lay in real clues that point to him or her–no popping the bad guy out of hiding on the last page before the reveal. This is much easier to do if you know who did it; otherwise, you have to go back and add it into the second draft.
You also have to provide logical, determinable reasons, and not just because your brilliant investigator sees something nobody else could possibly see. No deus ex machina stuff:
"Come, come, Watson, surely you knew that the temperature in Borneo seldom drops that low! And there was a solar eclipse, and a neap tide! There is no other explanation!"
I never used to do books this way. Always there would be little bits I didn't know about I'd uncover along the way, worth a grin, but the hero and villain? Never a question. I knew going in. Got the yin and yang, everything else circles around that.
If it was a whodunnit, I'd try to keep it hidden, but offer clues so a reader paying attention would have enough to figure it out. If they went back and looked, they'd spot them, once they knew who it was.
If it was a whydunnit and they knew who the bad guy was from the git-go, I'd try to make them understand why s/he was doing it, even if they didn't approve.
Yeah, yeah, guy is a bad-ass, but I can see how he might have started down the wrong path ...
But of late, I've started trusting my autopilot to fly the plane in places, and so far, it has kept me on course. And allowed me to look out the window and enjoy the scenery.
Yesterday, half way through the draft and some, I realized who the villain was.
Whoa! Surprised me, it did. I didn't see it coming. Likable character, but my subconscious had given me clues, and all of a moment, there it was.
Son-of-a-bitch! Wouldja look at that! Who knew?
And maybe if it surprised me, it will surprise readers, too.
So today, I got to write the scene in which the hero and the villain face off and talk about why. I figured there would be a big fight sequence, in which the hero barely ekes out a victory, after, well, heroic effort, and there you go.
That didn't happen, either.
In the moment, as they were talking I realized that was not the right way to finish it. I like the way it went much better.
The scene flowed like lava, hot, unstoppable, and when I looked up, I was done. As good a fifteen-hundred-word chunk as I've ever done, at least from where I sit. And the fun part is, I didn't know it was coming, so it was an unexpected joy.
Which of late, besides the money, of course, is the reason to do this stuff. Because if you can't have fun, why bother?