"The Cabinet of Dr. Caligari" was written by Hans Janowitz and Carl Mayer, both of whom were pacifists by the time they met following World War I. Janowitz served as an officer during the war, but the experience left him embittered with the military, which affected his writing. Mayer feigned madness to avoid military service during the war, which led him to intense examinations from a military psychiatrist. The experience left him distrustful of authority, and the psychiatrist served as a model for the Caligari character. Janowitz and Mayer were introduced in June 1918 by a mutual friend, actor Ernst Deutsch. Both writers were penniless at the time. Gilda Langer, an actress with whom Mayer was in love, encouraged Janowitz and Mayer to write a film together. She later became the basis for the Jane character. Langer also encouraged Janowitz to visit a fortune teller, who predicted that Janowitz would survive his military service during the war, but Langer would die. This prediction proved true, as Langer died unexpectedly in 1920 at the age of 23, and Janowitz said it inspired the scene in which Cesare predicts Alan's death at the fair.