Sometimes it happens early on, and sometimes it happens much later. In the case of my Aliens novel it came very early on as I thought about all that had gone before, including two of my all time favorite movies. Usually it's when I'm rounding the last bend in the story.
the self doubt comes in and I wonder if everyone will realize I've been bluffing my way through the writing process this entire time.
Two bits of advice. The first is my usual statement to writers of all sorts. Sit your ass down and write. By that I simply mean finish the first draft as quickly as you can, before the self doubt makes you go back a reread a dozen chapters and start changing this. Save that for the second and third drafts, when you have more time and less to lose.
You might think that advice is counterintuitive. You're welcome to that opinion. If, however, you have half a dozen short stories and two novels sitting in a virtual drawer until you can get motivated to work on them again, you have already fallen victim to the problem with not listening to my advice. Lloyd Alexander offered a simple quote in his Chronicles of Pyrdain. He said there are three principles of learning: See much, study much, and suffer much.
Guess which one I think works the best? I've met far too many writers who never finished a manuscript because they kept going back to tweak this and that before the end of the story. Make notes, move on. that's my advice. You can always fix it in the rewrite. Same answer for research. perhaps you NEED to know the migratory pattern of the Canadian Goose. Awesome. Make a note. Look it up when yo';re done writing. the information will still be there and you will not have slowed down.
My other but of advice is the same that every coach on the planet has offered to every athlete that fell down and got scraped up or took a blow that hurt but caused no major injuries (Which is also my advice for a break up, but that ls neither here nor there.).
Walk it off.
Sure it's uncomfortable as hell. Sure your world is ending.
Walk it off.
That is all.
Added bonus, I threw the following on Facebook and my Genrefied blog, but I like it so I'm throwing it here, too. A brief section from THE LAST SACRIFICE that I found satisfactory. No context offered.
“We have come to warn you. Your father sent us. He says if you do not change your path, you will die here soon. Die, or worse.”
“My father is dead.” Beron smiled, pleased to have caught the man in a lie so early on.
“Yes, I know.” The man nodded. “That does not mean he does not look out for his son.”
Superstitious nonsense. Still, a chill walked through Beron’s body.
“You have given your warning. Was there anything else?”
“You misunderstand. He means now. Physically. You should change your path or you will suffer greatly.”
“My path is chosen. I have a great distance left to travel and diverting would only make the challenge of arriving at my destination greater.”
The lean man sighed. “I have offered the warning. May the gods be with you.
“So far, of late, they have not been.”