It seems that the RPG genre of books and stories have standard components, that fans have come to expect to see from authors. Is there a definitive guide somewhere to these components, with instructions for a starting author?
First, some reality: books written in a copyrighted RPG setting are almost always commissioned by the owner of the RPG property, and those publishers very rarely accept unsolicited manuscripts. So before you write your awesome D&D adventure novel, you really ought to go to the WotC website and determine if they'll even look at your manuscript. (Assuming you want to get published. If you just want to have fun, go ahead, but be aware that it's illegal for you to then publish the story.) If you do get a contract to write a tie-in novel, the publisher will give you their guidelines with exactly what they expect.
If you're merely hoping to write an RPG-like epic fantasy adventure, then there is no better advice than just to read lots and lots of them. There is no written formula; you'll pick up the unwritten formulas just by being well-read in the genre.