Dungeons & Dragons is one the oldest, most beloved traditional gaming series in history. For over forty years, gamers have taken on the roles of human barbarians, elven druids, dwarf paladins and half-orc bards -- or whatever other brilliant mix of races, classes and personality traits they could conceive. It is a game perpetually limited only by the players' and dungeon master's imaginations.

However, when Gary Gygax created the game, he didn't come up with everything from scratch. Rather, he read the most popular books in the fantasy genre at the time -- and many underrated books that have since faded into obscurity -- and picked the elements of fantasy best suited to springboard off of.

Related: Baldur's Gate 3 Demo Teases a Triumphant Return

Lord of the Rings

Orlando Bloom's Legolas eyes his target in The Lord of the Rings

Let's get the obvious one out of the way. Lord of the Rings is the most obvious influence on Dungeons & Dragons. Elves? Dwarves? Halflings? Many of the most iconic elements of D&D come from Lord of the Rings. However, it is a mistake to think Lord of the Rings is Gygax only influence.

Clearly, Tolkien's saga of works -- The Hobbit, Lord of the Ring, and The Silmarillion -- greatly influenced Gygax, but often people overestimate how much D&D is a Middle-Earth simulator. Other influences impacted the game, often in more significant ways.

John Carter of Mars

Edgar Rice Burroughs, most famous for creating Tarzan, helped launch the planetary romance genre with his Barsoom series. Often referred to as the John Carter series, it tells the story of a Confederate soldier who is transported to Mars where he basically punches aliens until the day is saved.

Related: Dungeons & Dragons: 5 Epic Changes Coming In Theros

Obviously, as one of the most influential works of pulp genre fiction around, this proved a huge influence on Gygax. It would also influence George Lucas when making Star Wars, proving John Carter's influence on genre fiction is vast.

Conan the Barbarian

Long before Tolkien elevated fantasy to legendary heights, Robert E. Howard made a living creating fantasy for pulp magazines, such as Weird Tales. Within the pages of this old magazine, Howard created iconic franchises like Kull the Conqueror, Solomon Kane and, of course, Conan. Conan is a barbarian who goes from thieving on the outskirts of society to ruling over an entire kingdom as an old king forced to grow wise.

Conan the Barbarian is one of the most influential works of fantasy ever created. Spread across multiple short stories, Howard crafted the Hyborian Age, an era where magic and thievery rules. Conan inspired D&D's barbarian class, as well as the genre of low-fantasy that many low-level adventures draw inspiration from.

Fafhrd & Gray Mouser

This work by classic fantasy author Fritz Leiber is less widely read today, but the prolific writer's series of short stories greatly influenced both the fantasy genre and D&D.

Across decades of short stories and one novel, 1968's The Swords of Lankhmar, Fitz follows the towering and articulate barbarian Fafhrd and small and cynical thief Mouser as they encounter casts of wild characters and bizarre circumstances, primarily in the city Lankhmar. Mouser proved to be a huge influence on Gygax when crafting his rogue class.

RELATED: Steven Universe: The D&D Moral Alignments of The Crystal Gems

The Dying Earth

A Beholder menacing adventurers in DnD 5e

If you read Lord of the Rings, you've probably noticed that the magic system in D&D is nothing like that. Tolkien's work doesn't contain limitations on the number of spells one can cast per day or require any particular magic words. However, those elements are present in Jack Vance's classic novel The Dying Earth.

The Dying Earth (a story that's spread across multiple novels and short stories) is set in a distant, apocalyptic future where magic is fading from the world. Civilizations have collapsed into religious cults and barbarian tribes. Monsters, perhaps crafted through magic, roam the world. One needs to recite certain words to cast magic, but, after casting, the user forgets the words for the spell.

The Elric Saga

Pacific-Comics-Elric

Michael Moorcock is both one of the most important editors in science fiction and one of the most important influences on Gygax through his various short stories -- chief among them Stormbringer.

Elric of Melnibone is a sickly old prince of a decadent ancient civilization. While Elric is physically weak, he's a brilliant sorcerer. But the key to his power is his sentient sword, Stormbringer. It feasts on souls and will one day devour Elric, but for now, it is subservient to the twisted man. This story greatly impacted many of the darker aspects of D&D, such as demon summoning and multiple planes of reality.

Related: 10 Hilarious D&D Pick-Up Lines

Kothar

Gardner Fox is less talked about in modern fantasy conversation, but fans of the genre owe him a great deal of debt. On top of writing thousands of comics for DC Comics, he also published multiple short stories and fantasy novels over the years.

Gygax cites Fox's sword and sorcery series Kothar as an influence. The series itself might not appear to be much different from other barbarian-centric fantasy stories, but it inspired Gygax to codify all the tropes associated with the Lich, one of D&D's most iconic villains (which would later be used in Adventure Time).

Worlds of the Tiers

Dungeons-Dragons-Juiblex

P.J. Farmers published almost 60 novels and over 100 short stories over his decades-spanning career, but his most notable contribution to D&D lore is his use of other planes of reality.

World of the Tiers is a sci-fi story in which people use gateways to travel into pocket dimensions. Now, Farmers isn't the first one to use other planes. However, Farmers incorporated harder rules to how the planes interwove, inspiring Gygax to essentially copy them for his game.

Three Hearts and Three Lions

Poul Anderson's time travel novel focuses on a WWII soldier being brought back in time to confront forces in a mythical France, where elves and other fair folk run amuck. This work might not seem distinct at first, but Three Hearts and Three Lions influenced Gygax to create the idea of the morality grid.

RELATED: 10 Tabletop RPGs To Play If You Love Dungeons & Dragons

Most fantasy works deal with good and evil, but Anderson's novel focuses on the balance between order and chaos, which inspired Gygax so much he made his morality system a balance between ethics and order.

The Cthulhu Mythos

Few works of genre fiction after HP Lovecraft haven't been influenced by the legendary writer in one way or another. While his works are incredibly bigoted by today's standards, the ideas and themes of his existential cosmic horror stories remain eternally relevant.

Gygax initially credited Lovecraft directly in his D&D books, using entities from the stories in his guidebooks. However, he had to remove these specific references due to copyright reasons. However, the Far Plane and Warlock classes nowadays are unabashedly Lovecraftian in nature.

KEEP READING: Which Marvel Comics Crossovers Would Make Great D&D Campaigns