Preparation. It's got to be preparation.
I really don't mind a railroaded adventure ("Hey, you guys hear about this haunted keep full of monsters that come out and raid the local towns" - sign me up!), I definitely do mind an adventure that doesn't have anywhere to go. I played with this one GM...