Dungeons & Dragons, though a "fantasy" game, is the product of men who grew up in a time when the distinctions between that genre and what we now call "science fiction" were less firm. Indeed, one could argue with some justification that those distinctions only really firmed up in the years after the publication of OD&D. I myself sometimes find it difficult to come to terms with this reality. One of my great failings is that I like to put things into little mental boxes. This flaw has served me well in many ways, not least in ordering my thoughts as I marshal arguments in making my case for this or that. But it's a flaw nonetheless and it frequently leads me astray, particularly when I come across things that defy easy classification. Trying to put such things into a little box not only does them a disservice but it also prevents proper understanding.
Jack Williamson's 1947 novel, The Legion of Space, which was originally published in 1934 as a serial in Astounding Science Fiction, is pretty clearly a science fiction story. Yet Gary Gygax admitted that Williamson's science fiction yarns were a big influence on him in creating D&D. Until about a year ago, I wouldn't have been able to make much sense of this. On some level, I still find it odd, mostly because I'm working against decades-worth of indoctrination by the "fantasy and sci-fi don't mix" brigade that I sometimes think sprang up in reaction to the immense popularity of Star Wars, which gleefully committed that Original Sin of genre fiction.
In any case, The Legion of Space is a clever reworking of The Three Musketeers as a science fiction novel (one of the main characters' names is an anagram of Dumas). The titular Legion is an interplanetary police force/army that arose after the downfall of the Purple Hall, a tyrannical regime that had once ruled humanity. Now, a scion of the Purple Hall seeks help from the alien Medusae to assume the mantle of Emperor of the Sun and only the colorful members of the Legion stand in the way of this nefarious plot.
It's very easy to see why novels like this were so beloved by Gygax. Not only are they fun, enjoyable reads in their own right, they provide good models for referees looking to adapt classic literature to other ends. Williamson's borrowing from The Three Musketeers makes plain why the original story is considered a classic -- its characters, situations, and themes really do transcend both the time in which they were written and the times in which they were set. I suspect it's this that appealed to Gary and from which he took inspiration. As a novice referee, I know I cribbed heavily from my favorite books, although certainly not as skillfully as Williamson. Nevertheless, I think doing so was an important part of my "education" as a referee.
Books like The Legion of Space are another teacher, as they show a more sophisticated way to do what I often attempted less successfully in my youth. They're also vital in developing a more expansive understanding of "fantasy," something I think is key to comprehending the long-lasting appeal of Dungeons & Dragons. I'm still in the process of training myself to look beyond a staid conception of fantasy and to see a wider perspective. It's been an illuminating experience and one I recommend highly to anyone who, like me, is psychologically inclined to putting things into boxes even when it flies in the face of reality.