As a general rule, D&D is extremely anachronistic. It’s
also not one setting. Third Edition and 3.5 both default to Greyhawk, (which,
Ironically isn’t a setting I’m incredibly familiar with), which offers
technology ranging from the 9th century up through the 18th, depending on what
best fits the feel they’re going for. This results in situations where you have
sailing vessels designed for broadsiding in a setting without gunpowder, and
armor that never existed in the real world.
As a result, you can’t really tie D&D down, and this is
before you start looking at the other campaign settings. Forgotten Realms is
the one most people probably think of as the default D&D setting (it’s not,
but that doesn’t really matter.) There’s Dark Sun, where magic drains life from
the world, and the resulting environment is a barren wasteland. There’s Dragonlance,
where, unsurprisingly, Dragons are the biggest threat (usually), and the world
outside of fortress settlements is barely civilized as a result (incidentally,
this is another setting, I’m not that familiar with). There’s Ravenloft, where
the entire world is splintered across various horror themed mini-planes. There’s
Eberron (one of the newer settings), which has a magitech/steampunk aesthetic
going on. There’s Birthright, which is explicitly pulling from 13th century
knights, and fairytale chivalry (though, I honestly can’t remember much about
this setting beyond that.) There’s Spelljammer, where people fly magical
sailing ships between worlds (including, potentially any of the ones I’ve
listed here.) There’s Planescape, where characters wander between universes,
including any of the ones I listed above.
If you want a D&D setting I can pin down to a specific moment
in history, the only ones that come to mind off hand are Urban Arcana, Dark
Matter and Shadowchasers, but those are both from D20 Modern, and by default
they’re set around 2002 (give or take a year.) (Strictly speaking, there’s some
Dark Matter supplements from back in the 90s, so that setting is a little
older, but it’s tenure as a D&D setting starts in 2002.)
And, honestly, that’s okay. Fantasy is rarely designed to
mimic specific moments in history. As a genre, it owes a lot to both J. R. R. Tolkien
and Robert E. Howard.
With Lord of the Rings,
Tolkien was specifically pulling inspiration from the literary epics like
Beowulf. He envisioned a forgotten version of Europe that existed in some
forgotten dark age long before recorded history. The technology is an incoherent
mix of different eras because, the idea goes, that much of this was lost, and
then later rediscovered.
The result is: Middle Earth is usually read as a self
contained world, with no relation to the real one. It’s treated as fantasy
world, segregated from reality, rather than a piece of fiction that takes place
in “the real world,” but this wasn’t Tolkien’s intent. Ironically, this
actually sets Tolkien into a fairly small subgenre of fantasy, with series like
Terry Brooks’ Shanara Chronicles, or Jack Vance’s Dying Earth (which became the
basis for D&D’s spell casting system.)
Robert E. Howard just loved history. Really loved it.
Apparently, to the point that he couldn’t pick a single favorite element, and
simply grabbed pieces of whatever wasn’t nailed down. If you’ve never read the
Conan stories from Howard, you really do owe it to yourself to take a look. More
than Tolkien, Howard set the tone for modern Sword and Sorcery as a genre. So,
while D&D inherits a lot of its ideas, like elves and dwarves from Tolkien,
it looks to Howard, when the time comes to pick from a moment in history.
So the end result is a massive collection of anachronisms,
and usually that’s acceptable. You have a fantasy setting, where different
concerns gave rise to different technological priorities, and some of the
things you take for granted in your daily lives just never happened.
It (sort of) makes sense that Forgotten Realms and Greyhawk
don’t have firearms. Magic is very prevalent, to the point that convenient
ranged weapons exist. Additionally, because of how gunpowder works, a single
wizard or sorcerer could (theoretically) ignite your batteries with a stray fireball,
which makes the entire idea of stockpiling powder a lot less appealing.
Of course, it’s also entirely possible you would have
gunpowder in your setting. Warhammer pulls heavily from the 15th century Europe.
Primitive firearms and all. Even with the danger of a Bright Wizard being able
to detonate handgunner’s powder on a whim (or on accident).
The only times you’ll see serious criticism of D&D’s
historical elements are when you try to do one of two things. Putting one of
the campaign settings together into a coherent whole while accounting for the
game’s rules and asking, “does this make sense?” No, the actual rules
(particularly in 3rd and 4th edition) are designed to facilitate play for the
party, and characters accelerate to godlike status (or outright godhood) with
Or, when someone looks at individual technologies in a
campaign setting and finds one that is dependent on a technology that never
happened. For example: Forgotten Realms’ sailing ships, which are based on 17th
century designs, which were heavily influenced by cannon fire.
When it comes to Pathfinder, I don’t know. What I’ve seen
suggests it mixes 14th and 17th century technology together with gleeful
abandon. I don’t know how fair that is, because I’ve never purchased or read a
Pathfinder book or game.