One of the things that really makes a game succeed or fail is the quality of its narrative. A game that tells a good story will be entertaining. This is a little difficult, but there are a few things one can do when writing a game’s story and plot that will help players get attached to the characters and events that the game is centered around.
First, it’s crucial to make sure that characters feel realistic and believable. One of the many flaws in the Syndicate modern reboot is the fact that its characters didn’t have clear motives and backgrounds. Even with a background encyclopedia it was nigh impossible to figure out what exactly was going on with each character, and most of the characters’ agendas could basically be summed up into “Kill X”, which, while a decent enough plot for an action shooter was also very dissatisfying when combined with the fact that Syndicate quite clearly attempted to create an engaging narrative and failed. On the other hand, something like Tomb Raider, for all its sometimes-weird characters, actually does a good job of giving us background on the characters and letting us see them progress, sometimes illogically, throughout the course of the game.
Don’t worry too much about giving away too much information. If you’re sending the game to testing often enough and early enough you should have negative feedback if players think that the story is coddling them and feels condescending. Unless you’re working with well-known characters, you need to make sure that players can get the hang of what’s going on. For instance, you probably don’t want a character to just dump an autobiography on the player when they first meet them, but mentioning pertinent bits of background is always good; someone who knows how to use a gun really well might mention prior military service might say “Just like in the army.” after a battle, for instance. Note that some subtlety is required; you wouldn’t want to have the character say “Just like in the army, twelve years ago, when we were fighting in France at the outbreak of the European Union’s collapse as WWIII began all around us.”; not only is this far too wordy, but most of that information is either going to be irrelevant, or better explained elsewhere in the setting (take, for instance, an introductory monologue). If a party member or major ally of the player suddenly turns out to be from the country he just signed off on the annexation of, we probably should have known that before (unless he was concealing this, of course). Players will typically put up with a fair degree of information dumping when they find it relevant and useful, so pace things out in chunks. Consider Star Wars: Knights of the Old Republic, which has a number of NPC allies that can be found, some of whom are mysterious and some of whom are rather transparent. As the player works with them they begin to learn more about them, and can further discuss matters with them to work out background information.
Once you have characters, you should also make sure that the setting makes sense. Use a Mass-Effect style “codex” if you must, but be sure that there is plenty of setting and background information available to the player. You’d be surprised how much people are willing to read, especially if you have a “NEW” icon pop up whenever there’s something they haven’t read to guilt them into doing so, but that can also be annoying to some players. Think things through from the seat of every major power player (at least that set the events of the game into play). Don’t do something that wouldn’t sound right to them, and unless you’re dealing with someone truly insane or dogmatic it’s best to try to remain neutral so you don’t wind up with offensive strawman characters and nonsensical plots.
Another thing to do is to plot out minor setting details. While some people say that it’s the central storyline that matters most in a game, you’d be surprised by how much of the feel and ambiance of games like Deus Ex and most of Bioware’s games (Jade Empire comes to mind, for some reason) comes from the tiny details that may not even be at all related to the central conflict. For instance, being able to stop and give a kid a candy bar in exchange for information on terrorists is the sort of thing that made Deus Ex’s environment feel so much like one would expect from the cyberpunk archetype. It also adds a fair degree of exploration bonuses to your game, which a lot of people really get into. There is also the opportunity to give players an ability to explore your setting in a low-stakes environment, allowing them to immerse themselves into the setting and become more engaged.
Finally, you should start in on the main plot. You’ve likely already had details of this floating around, but it’s good to save it for last because it should react and respond to the characters and events that are already transpiring. Every event in the central storyline should be part of a purposeful transition toward a climactic event, even if the players do not necessarily know what they are doing at the time (if things don’t click for them later on, however, you could be in trouble). Building a main plot requires a little bit of discipline; it’s tempting to bring out the big guns early, but remember that the action of most literary works, including video games, tends to increase over time and then reach a final peak before lowering into a denouement. This is not only pretty common, but it’s also best practice, as it keeps players from becoming fatigued by too much high-action events (or, worse, grow to expect more) or being bored off by having too little action. Consider Cave Story. At first, the player has little idea of what is to come and a very basic beginning, but by the end of the game they’re confronting the Doctor and playing a major role in the events of the game’s universe.
Part of the reason why it’s so important for games to have this curve, however, is information transfer. A low-stress environment means that the player only has to know a few things and can move slowly and enjoy more background information; they’re more likely to wander and explore when there’s not battles to fight, and they don’t feel pushed to continue. As the intensity builds they have more information and are able to fully invest in the conflict, putting themselves in their character’s shoes. As the player gains more information, they gain a willingness to play the game even when the narrative throws things they don’t want to have happen at them (for instance, Aerith’s death in Final Fantasy VII, which elicited a strong reaction from most players),
In short, when building a game it’s important to create believable characters and environments, as well as the core storyline events, if you want to have players invest fully into the narrative experience that you are trying to convey.