I confess. I cheat.
I liberally raid my gaming notes for book ideas. Dorian, one of the antagonists from the Locked Within series, is based on the villain from a Buffy The Vampire Slayer campaign I once ran. In fact, that villain was an intentional prototype for Nathan's enemy.
Authors, or anyone with aspirations to write, can fall victim to the trap of structuring their games in a very linear and forced manner. Many GMs are prone to frustration if their players de-rail their plot by killing and important NPC or taking a different route to achieve their goals. Writers, who get to spend so much of their time in the company of characters who do nothing but obey their every whim, can perhaps be even more prone to it.
But when we let go of that control and accept that being a GM is part of a collaborative process, something wonderful can happen. Not only can we apply our storytelling skills to the adventures and settings we create, but we can test out our ideas on other gamers.
Gamers are notorious for coming up with unexpected solutions to problems and, like many sci-fi and fantasy fans, for picking out plot holes or character inconsistencies. This is doubly so when it's their own characters on the line, and that one little nitpick could mean the difference between success and failure.
Not that I think nitpicking during a game is a good thing. Far from it, I hate when a good game session stalls because one player wants to bring everyone's attention to how radar really works or how ship rigging would get tangled in a scene like the climax from Pirates of the Caribbean: At World's End.
But, that drive to understand and make sense of things can be an excellent trial by fire for your ideas. I'm certain, that if a group of gamers all think your story, setting or characters have enough merit to pass by without criticism (or better yet, with praise) then you've got something special on your hands. I still toss new ideas into my games to see how they fly, then re-work them to suit the book. There's a reason why the names of several members of my gaming group can be found on the acknowledgements page of Locked Within!