Somebody asked, on a worldbuilding community: what's different, for the worldbuilder, in building a world for a story versus building one for a role-playing game? I answered:
The differences are fairly subtle. In both cases you need a world that's well-enough developed to be plausible and interesting to the people consuming it (readers or players). But there's an important difference: RPGs have players.
Well duh, you're probably saying. Let me unpack that.
A work of fiction like a novel is controlled by one person (absent unusual situations like shared-world collaborations), who is usually the world-builder. You build the world for the purposes of your story, revealing its characteristics in the telling, and if you need to adjust something while you're writing, you do that.
An RPG has players who interact with your world. In the course of doing that they may bump into problems you don't want your world to have (such as inconsistencies) that you wouldn't have found on your own. You might decide to fix those issues rather than living with them. If you fix them, you have to decide whether to do so in-game ("you've just discovered a new magic manual and it says...") or in consultation with your players ("look guys, I didn't mean to make it impossible for you to create simple healing potions; forget that thing I said about needing unobtanium").
And sometimes, as the players discuss what they're experiencing, they'll speculate about your world and you might hear something that you like even better than what you were doing, so you might want to incorporate it. This happened to me once in a game I was running and I found myself rewriting the explanation for an important artifact in real time because a player had said something that sounded way better than what I'd done and I wanted to run with it. This can be exciting (you're now part of the collaborative story-telling just like your players) but also nerve-wracking (you need to not mess up any of your other secret information, and you need to be good at thinking on your feet in multiple dimensions). I don't recommend doing this often, but in an RPG setting you have the option in a way that doesn't come up as much with fiction where, at best, you can address complaints in reviews in a later episode.
Bottom line, an RPG gives you the opportunity for more collaborative world-building even if you aren't explicitly inviting your players to the design table. Depending on how rich your world is and how story-focused your game is, your world-development and progressive-revelation processes could be very different from those you'd use in a story. Here are some links from the Worldbuilding blog that discuss these issues in more detail:
RPGs (these are all by me):
"Behind the scenes" fiction (various authors, related to stories posted on the blog):