The episode was the third episode of season 6, the last of the great seasons. Afterwards the series went downhill as it tried to set itself up for the planned film version by upping production values, adding in the unneeded Kochanski, and generally forgetting about good writing when the writing team fell out. Prior to its demise, the show had presented several different takes on the central premise of a group of not very bright blokes arseing about in space.
The first two seasons were essentially the standard British sitcom idea that had been perfected in series such as Porridge and Steptoe and Son in which two people are trapped in a room and get on each others' nerves. By season 3 the budgets had grown and so the series became a science fiction comedy in which genuine science fiction ideas such as aliens and time-travel were incorporated into plots. When the writers ran out of their own science fiction ideas, they turned to parodying science fiction and finally, by season 6 they turned to parodying Star Trek.
This was a good idea as essentially the initial premise for the show had been to take the idea that having pompous, smug and generally all-round superior officers in space was dull. It was more fun to think what would happen if you put people in space who'd never become officers. The people who never had a formal education as they failed all their exams then went to art college and are now technicians 3rd class cleaning the gunk out of chicken soup dispensers.
The Trek parodies in season 6 led to some of their best jokes. My favourite being the response to the order to go on blue alert of: 'but we'll have to change the light-bulb.' But for the western episode they almost went too far. The plot is a direct lift, cough, a homage to the episode A Fistful of Datas from season 6 of Star Trek, The Next Generation in which Data's holodeck western fantasy gets out of hand (more on this episode in a later article).
In fact they even used the exact same composition for the final shot of the Starbug sailing off into the sunset as they did for the Enterprise sailing off into the sunset. This homage was so obvious that Patrick Stewart appeared on the Red Dwarf's 10 year celebration night to tell the story of how when he accidentally caught this episode one night he got so irate he phoned his lawyer. Then he suddenly realized it was funny and put the phone down.
The plot for Gunmen of the Apocalypse is that Kryten, the robot character, enters a Wild West artificial reality computer game to try to eliminate a virus that has taken over the ship's computer and which will destroy the ship in 30 minutes. The rest of the cast join him in the game to help and each takes on a standard western character role.
The stylish Cat becomes the Riveria Kid, gunslinger (cue dance every time he says his name). The slobby Lister becomes Brett Riverboat, knife thrower, and the cowardly Rimmer becomes Dangerous Dan McGrew, bareknuckle fighter.
On entering the game they find themselves in the frontier town of Existence. Kryten has become a drunken sheriff who, Rio Bravo style, is too busy selling his own mule for a bottle of mind-rotting whiskey to take on the Apocalypse Brothers who have just ridden into town…
There are several good western jokes, all of which are better than the ones in the Trek episode, including the perennial favourite of walking into the roughest saloon in town and ordering a dry white wine and Perrier water.
Here's a youtube clip to keep you going until the boys from the Dwarf return.