The setup can be simple or extremely elaborate. The Village Murder Mystery, for example, requires no setup beyond a way to radomly select the roles; however, if a party is to be built entirely around the mystery, a more elaborate setup is common.
Often a theme for the party, based around a historical era or fictional context, is used to tie things together. If the organizer of the mystery is up to the challenge, they can select roles and characters based on their knowledge of the guests; however, commercial products are available to provide the setting and roles. These include How to Host a Murder and Murder A'la Carte, among others; these are, however, set up for a particular number of players and can limit the party by that.
Another implementation of the game concept is Murder Mystery Theatre, where guests pay to attend a type of live show with active audience participation; the actors play a cast of characters, one of whom is the murderer, and the audience must collaborate to work out clues from the performace, props and setting to solve the crime.
Variants may involve changing the nature of the crime (especially if younger players are involved), allowing some participants to know certain facts in advance (even the identity of the murderer), or having 'plot twists' of unexpected events to occur, to help or hinder the investigation, as needed.