I think I read this as an ebook about 5-6 years ago. The protagonist is the designer of a tabletop role-playing game like D&D. At the beginning of the book, he runs into a crazed fan who pulls out a gun and shoots him in the chest, I think over some perceived slight in how the game system works, and then does something (involving a magic die?) that transports the designer into his game world, where he's forced (I forget exactly how) to be an NPC for the heroic party, who are your usual set of munchkins. There was a female magic-user (who might have been played by a guy) and a male fighter who was ridiculously combat-optimized but lousy at everything else, and later (maybe the second book?) there was an aquatic elf with a spear (trident?) that he shouldn't have at that level where the protagonist realized early on that the character had been built to capitalize on one specific tactic (which comes up near the end of the book where, in a single action, the elf slays dozens of foes). He tries to communicate with them, but the DM decides what his players hear, of course. When the players step away from the game, or engage in an action that takes a long time in-game, but a short time out-of-game (like saying that they're going to march the 20 miles to the castle), their characters kind of go on autopilot, and I think eventually the main character gets the magic-user to develop her own personality, and he gradually falls in love with her.
The primary villain in the game is a masked (helmeted?) Evil Overlord type who wields a terrible magical artifact that lets him completely wipe people off of the face of the Earth (which turns out to be an eraser from the real world). He was masked in part because his face was so beautiful that no one around him could function if they could see it. I think there's a plot point that he has his brother (identical twin?) locked in the dungeons (obviously for the sake of the players, who can free said brother and establish him as the rightful ruler), and as the book progresses, he begins to realize what a bad idea this was tactically (he's beginning to become a sentient character) and I think he has that brother executed. Somewhere near the end of the book, the girl the protagonist has fallen in love with gets sexually assaulted by the warrior character and the protagonist is forced to kill him (the player shows up at the next session with an identical character who is the warrior's "brother" and I think doesn't even bother changing the name). At some point, the protagonist finds a pencil which lets him create things (although the lead is limited, so he can only use it so many times, and he has to try to use it when the DM isn't "looking" at him).
I vaguely recall that the second book in the series involved a Les Miserables pastiche, complete with building barricades in the street, and characters clearly based on the characters of that book, part of a general theme that the guy running the game was very unoriginal. It might have also had a scene where an antagonist operated some sort of well of magic (over a volcano?) and his mother came to visit. She has life-draining powers, and keeps cats, which leads to some description of her holding a cat in her arms with it yowling, trying to get away, as every stroke of her hand pulls life from it. I think the primary antagonist in this one was named The Weatherman due to having control over, well, the weather, which he has due to possessing a real-world item, which I think was either a weather report from the newspaper or a calculator. There was also a plotline about the love interest still experiencing PTSD over the assault and the protagonist finding himself tempted to use the pencil or eraser artifacts to "fix" her, which I think might have led to the location with the magic well as it was where he thought he could destroy them. The second book might have had the players at a convention. I think there was a mention of one of the players not being able to show up because they were exhausted from an all-nighter.
Somewhere in the books, maybe in the first one, there was a scene where I think he was fighting someone (the warrior?) in a set of caves, and he takes advantage of game mechanics by throwing himself off of a ledge, knowing that the falling damage can't be enough to kill him.