As part of Pocket Gamer Connects San Francisco 2015, Evan Skolnick, a narrative designer, gave a talk on the importance of storytelling in games.
He led by saying that when the player finds they can't do specific things in your game, "narrative can help soften the blow", and explain why these things aren't possible.
The write people
In terms of how to write well, Skolnick suggested that you should "bring in an expert", as too many developers rely on designers from other backgrounds who just don't have the experience to properly craft a story.
He also said that you should bring in this expert as early as possible in the development cycle, as they can help structure the story and therefore the game a lot better, and in his own words, "writing is a lot more than dialogue writing."
You can see all our videos from Pocket Gamer Connects San Francisco 2015 in this YouTube Playlist.