I always find it funny - the question was about making a good game yet most of the advice is only focused on writing a good story. A game is no movie and no book, it's an interactive medium. If you focus too much on the story you are probably better off writing a book.
The best advice so far would be Andars advice about playing other games and analyzing them. When playing a game, try to anwser this question: "Why is this game fun?" - This will lead you to the core idea of the game, its source or definition of fun. The core of a game is rarely unique, there are probably only a handful basic ideas, that are fun. But the important thing about the core is, that everything resolves around it. Every decision about the game design is weighted in light of the core - does it add to the core or does it distract from it?
The story can be the core, but it doesn't have to be. Often the story is just an excuse to get the game rolling, to give it a direction, but the real core is progressing your characters, customising them with classes, skills and equipment, or exploring the vast world.
This also doesn't mean you can ignore the story if it is not your core. A good story helps you sell your core to the player. Story-sequences are rewards for finishing certain parts of the game and are what ties it all together. It is like the icing on the cake, without it the cake would be really bland. But icing alone isn't fullfilling, it needs to be on top a cake.
I have played only very few games where i would say that the story is their core - and none of them were RPGs.
Don't confuse a good story for good gameplay - and the gameplay is what makes a game a game, otherwise write a book.
Use the story to sell your gameplay - not the other way around.