At one point, while writing parts of a history of detective stories, looking for possible oriental relatives, I stumbled upon the name of Judge Di (Dee). Di Renjie (630-700) is a historical figure, a capable minister of the Tang dynasty. Loosely based on Di and his reputation, an unknown 18th century author wrote "Di Gong An", a detective novel in which Di as a magistrate investigates a number of crimes. A copy of this was obtained by the dutch sinologist Robert Van Gulik in a Tokyo second-hand bookstore, and was later translated by him into English as "Celebrated Cases of Judge Dee". More precisely, he translated the first part of the novel, and argued that the second part is a later addition much inferior in style and plot. Van Gulik wrote a detailed introduction to his translation, in which he observed some differences between the oriental and western styles of detective stories. He intended to introduce to the Western audience an authentically Chinese detective, unlike the stereotypical Western inventions popular at his time. Then, he went on encouraging authors to write similar stories based on these rules. Eventually, he did so himself, and invented a completely imaginary career for Judge Di spanning over several locations and levels of Chinese jurisdiction. One of the most notable characteristics of the Judge Di novels is the parallel investigation of several cases in the same time, which are investigated by the magistrate with the help of his trusted lieutenants. Although the whodunit is not typical in Chinese crime fiction, Van Gulik often centered the mystery around the identity of the murderer in his novels, which he illustrated himself. After his death, many authors continued his work, most extensively F. Lenormand in French.
There have also been film adaptations of the character. A close adaptation of the Van Gulik novel "Judge Dee and the Haunted Monastery" was made in 1974. The Chinese television also started a series about the historical character, Di Renjie, and in 2010, Tsui Hark did "Judge Dee and the Mystery of the Phantom Flame" featuring Andy Lau in the titular role. Both Chinese adaptations take place in the period of the reign of Wu Zetian. Wu is certainly one of the most intriguing figures of Chinese history, and the only woman to have obtained the title of huangdi as founder of the short lived Zhou dynasty (690-705). It is certainly an attractive proposition to bring together two such historical figures in one plot, though Di should have been around 60 when the events of the Phantom Flame were supposed to take place. Both Chinese film adaptations are wire fu, and there is a new Tsui Hark film coming out as a prequel. On the other hand, Haunted mystery is a sort of cheap but faithful adaptation. Faithful, I mean, to the book by Van Gulik. By the time he wrote Haunted Monastery, Van Gulik seems to put less emphasis on the court procedure and other details, e. g., the morbid details of execution in the end, and the setting of an old monastery with a spooky air where he takes shelter when his journey is interrupted by a storm gives just the right background to dispose of these formalities. Van Gulik still keeps that original feature of his novels to set his plot in the Tang dynasty but describe customs of the Ming, as did the anonymous writer of the original Di Gong An. However, the average viewer of the film version would notice few of this, and I don't think it makes a big difference given the rather improvised settings, nowhere near the sometimes purely imaginary magnificence of the past as in Phantom Flame. The environment also provides Van Gulik with the possibility to discuss the differences of thought advocated by Confucians and Taoists, but again, the film carries over little of this. However, the plot is almost unchanged, which is a huge advantage, as Van Gulik used elements of recorded case histories in his novels, and thereby one has the chance to get some insight into the Chinese way of thinking about, committing and investigating crime. While writing to a western audience, Van Gulik repressed the role of the supernatural, which occasionally occurs in Di Gong An. Phantom Flame restores this element to some extent, in the manner of a Chinese phantasy, though once one accepts these elements as belonging to a mythical past, the flow of events - even if somewhat on the fantastic side - can still be reconstructed by logical deduction, which is why this may be called a detective story after all. At this point, I would compare the Phantom Flame to the French movie 'Vidocq', which builds similarly on the myth (or reality) of alchemy.