Today's post is going to deal with writing for games, and making sure that people pay attention to an essential element: purpose. This works on multiple levels, for you are concerned with your purpose for this dialogue as a writer, and the speaker's purpose in terms of their long term and immediate goals. We will examine these in turn, focusing primarily on dialogue, as that is the means by which a significant amount of a game's story is delivered.
A Writer's Purpose
Whenever you're starting to write a particular piece of dialogue, ask yourself "why?" Why does this particular piece of dialogue need to be written? Is it to progress the story, provide the player with essential background, develop a character, or something else? What you are really asking is "what does this piece of writing add to the game?" If you can't answer that question, then you've either got a problem, or you don't need to do the writing.
Keep in mind that there are many more reasons you could have dialogue that the few I've listed above. What about "adding some humour into a dark scene", "reinforcing the danger of an adversary", "telling the player their next objective", "warning the player about the faction they're about meet"? All of these are valid reasons for dialogue, and there are many more besides.
Morrigan vs Alistair... The witch wins again.
The other reason for working out the purpose of the dialogue is to help you as a writer define what should and shouldn't be included. If you're trying to impress upon the player how dangerous their current situation is, you shouldn't include a witty one-liner, because that's not the tone or atmosphere that you're trying to instill. Likewise, telling the player about their next objective generally should include some very clear and direct speech or facts that say exactly what must be done, because you're trying to provide the player with some direction about what to do next. Make sure you provide that direction rather than getting mired in vague directions and allusions.
A Character's Purpose
While you as a writer must have a purpose for a piece of dialogue, you must remember that dialogue is delivered by characters, and characters have their own agendas within the reality of the game world. If they don't, then you'll likely need to give them one. This means you need both a broad "general" aim of the character, and their specific aim within this dialogue.
In a general sense, a character has some over-arching desire that drives them. They might seek fame, power, revenge, "a hero's death", or "a peaceful home with a loving family". There should be some ultimate goal or general sense of purpose guiding the character and their actions, as for any character of significance, this is what will drive their actions. Loghain from Dragon Age was driven by patriotism, the Transcendent One from Planescape: Torment was driven by a desire for peace. These driving forces caused a great many other actions, but these were key elements of these characters.
We live in a world that has walls, and those walls have to be guarded...
However, in every interaction, you should also consider what the character is attempting to do right now. They may have their overall driving force, but in each specific dialogue, what are they trying to achieve? Are they trying to romance the PC or get to know them better? Are they imparting information to the player? Are they desperately begging for help? Are they trying to manipulate or deceive the PC? Note that this will reflect the aim of the dialogue as a whole, but the character's intentions will put an individual spin on the information being delivered.
Let's look at a specific example, where the player is just about to head into a big battle. There are two NPCs that the player can choose to talk to before taking to the battlefield. In both cases, the aim of the dialogue from the writer's point of view is to impress upon the player the danger of the forthcoming battle. This is to raise the stakes of the game and make the player feel invested in achieving victory and maybe even a little anxious or apprehensive about the forthcoming battle.
A few extra soldiers would be very useful right now...
However, the aims of the two NPCs are very different: One of them is trying to assist the player and tell them of the (difficult) strategy required to win the battle, but the other might be a traitor and attempting to instill the player with fear. Think about the differences in the speech of the two characters as they communicate with the player - they could potentially end up delivering almost the same information about the upcoming battle, but the tone of their delivery will be markedly different.
Of course, these things can be applied to writing in general, not just writing for video games. However, in video games, there is more than one way to give information to the player. When considering your purpose, also keep in mind that might be a batter way to deliver your message to the player than through dialogue. A journal entry, on-screen tip, visual cues or even gameplay itself might help to better fulfill the purpose you've identified. For example, how do you convey an atmosphere of tension through dialogue? What about player controls, or hints as to the solution of a puzzle?
A video game writer can and should use more than just dialogue
By using purpose to define the means and style of writing by which you communicate with your player, a video game writer can produce more engaging material. When all the text helps support the current atmosphere of the game, each dialogue helps to reinforce the personality of the characters speaking, when all the writing is helping to draw the player into the game and the gameworld that has been created, then you have been successful in the task of being a video game writer.