In role-playing games, the game master or GM (also known as dungeon master or DM among people who play Dungeons & Dragons), is the organizer, storyteller, and referee. He or she prepares the adventure for the players and the characters they play (the player characters or PCs). The GM describes the events and decides on the outcomes of players' decisions. The game master also keeps track of non-player characters (NPCs) and random encounters. In a sense, the players are the lead actors, and the GM provides the stage, the scenery, the basic plot on which the improvisational script is built, and all the bit parts.
It's a larger commitment than simply playing in a game. GMs may run their game as frequently or infrequently as they wish; some gamers meet once a week or once a month, others only two or three times a year.
GMs may choose to run a game based on a published game world, with the maps and history already in place; such gameworlds often have pre-written adventures. Alternately, the GM might enjoy building their own world and scripting their own adventures.
A GM can easily run one-shot, unconnected adventures each time their gaming group convenes; in this case there is no connected plot, and the players can choose to play different characters in each session. However, a devoted gamemaster can string many such adventures into a game campaign, in which the same heroes fight many different monsters and a few recurring villains, gaining treasure, reputation and power as they go. Such campaigns can last for years, even decades, earning a great deal of loyalty from their players, even as some players join or leave the game along the way.
A good gamemaster draws the players into the adventure, making it enjoyable for everyone. Good gamemasters have quick minds, sharp wits, and rich imaginations. Gamemasters must also maintain balance - hideously overpowered monsters or players are no fun!
However, there is a rare but well-known type known as the "killer GM". This type of gamemaster enjoys killing the PCs, meaning that the imaginary character "dies" in the same way a character in a novel might -- they cannot go forward in the story, short of in-game mechanics like magical resurrection. The GM might get satisfaction out of creating monsters with very powerful game statistics, or designing fiendish traps that are virtually impossible for the characters to escape, but such a GM is likely to have trouble keeping players coming back for more adventures.