Machiavelli said:
Yes, shields were pretty much the only reliable defense against arrows, because GOOD arrowheads almost always kept pace with GOOD armor, such that any armor (helmet included) which was impenetrable by a bodkin arrow (the very narrow-headed kind) was also too expensive and cumbersome to equip more than a few troops with. Certainly armor that is less than "impenetrable" offers some protection, as arrows rarely strike at the optimum angle to penetrate, but big wooden shields were the only cheap and reliable way to stop an arrow.
Of course, a shield only offers protection for the portion of the body that it covers, meaning that a soldier and his unit must be well-trained in using their shields to provide cover for themselves and each other, or else they must use truly massive shields. Massed groups of spears also deflect and reduce the lethality of arrows if they are raised into the path of incoming arrows and are moved around a bit. The key is training.
Basically, an army's best hopes against arrows were to close with the enemy very quickly to reduce the volleys that can be launched against them, stay out of range completely, or equip their troops with the best armor, shields, and training that money could buy. That left cavalry and heavy infantry (both quite expensive) as the best defenses against archers, unless a tactical advantage could be gained by clever maneuvers and ambushes.
Training archers was expensive, though, and their effectiveness was heavily reduced in inclement weather or extreme terrain, so despite their offensive effectiveness they were not usually used very heavily in the Iron Age (when D&D settings usually are).
You can get a rather accurate feel for the strengths and weaknesses of various units relavent to D&D by becoming familiar with Medieval: and Rome:Total War. Reading about it is nice, but nothing beats ordering around armies in a quality simulation.
While this may be true of a locked in uniform Medeival period from 1100-1200 or so, much changed and evolved from then on. If one looks at the time periods of D&D, there are many confluences of technology from bronze age gladius' to renaissance rapiers and even blunderbuss'.
Here is some historical information about armor, rapiers, and sabres and how arrows, crossbow bolts, and musket ammo actually helped evolve plate armor to eventually use steel!
Armor was worn well into the 1600s well past the advent of firearms. It took a couple of hundred years before the accuracy and power of gunpowder ammunition could make heavy metal armor obsolete. Even in the 1800s there were known accounts of heavy metal armors used against firearms.
Heavy cavalry continued to use breast- and back-plates into the early 20th century in elite cuirassier units.
Conventional wisdom says that plate armour faded away on the battlefield soon after firearms were introduced. This is very much not the case. Crude cannons were being used before plate armour became the norm. Soon, in the 1400s a small, mobile "hand cannon" was being used by horsemen. Improved crossbows, and the first pistols and pre-musket long arms, began to take a heavy toll on the mail clad, and partially plated knights and foot soldiers. Rather than dooming the use of body armour, the threat of small firearms intensified the use and further refinement of plate armour. There was a 150 year period, that more and better metallurgically advanced steel armour was being used, precisely because of the danger posed by the gun.
In the early years of pistol and muskets, firearms were relatively low velocity, the full suits of armour, or breast plates actually stopped bullets fired from a modest distance. The front breast plates were, in fact, commonly shot as a test. The impact point would be encircled with ingraving to point it out. This was called the "proof" . It was not uncommon for a man in armour, mounted on a horse, to ride up closer to the enemy, in a tactical Manoeuvre called "The wheel", and discharge his hand-cannon or later, pistols, right into the faces of the adversary at close range. Cross-bow arrows, if still used, would seldom penetrate good plate, nor would any bullet but one fired from close range. In effect, (and this has long been misunderstood), plate armour actually came to replace chain mail because it was relatively, "musket ball proof". Plate would stop all of these at a distance. Hence, guns and cavalry in plate armour were "threat and remedy" together on the battlefield for almost 400 years. For most of that period, it allowed horsemen to fight while being the targets of defending musketeers without being easily killed. Full suits of armour were actually worn by generals and princely commanders right up to the second decade of the 1700s. It was the only way they could be mounted & survey the overall battlefield with safety from distant musket fire.
Gradually starting in the mid 1500s, one plate element after another was discarded to save weight for foot soldiers, but breast and back plates continued to be used though the entire period of the 1700s through Napoleonic times in many (heavy) European cavalry units, all the way to the early 20th Century. Rifled muskets from about 1750 and later, could pierce plate, so cavalry had to be far more mindful of the fire. At the start of World War 1 the French Cuirassiers, in the thousands, rode out to engage the German Cavalry who likewise used helmets and armour. By that period, the shiny armour plate was covered in dark paint and a canvas wrap covered their elaborate Napoleonic style helmets. Their armour was meant to protect only against sabres and light lances. The cavalry had to beware of high velocity rifles and machine guns like the foot soldiers, who at least had a trench to protect them. Machine gunners in that war also occasionally wore a crude type of heavy armour.
The two main points are:
1.
Rather than dooming the use of body armour, the threat of small firearms intensified the use and further refinement of plate armour. There was a 150 year period, that more and
better metallurgically advanced steel armour was being used, precisely because of the danger posed by the gun.
2.
Gradually starting in the mid 1500s, one plate element after another was discarded to save weight for foot soldiers, but breast and back plates continued to be used though the entire period of the 1700s through Napoleonic times in many (heavy) European cavalry units, all the way to the early 20th Century.
The advent of stronger crossbow bolts and firearms evolved the materials & stopping power of armor. Also, armor was lorn less and less because of weight issues with the newer heavier plate armors required for stopping stronger missile weapons. So missile weapons gradually wore away the use of armor, but not because the armor would not stop the missiles, it was because the steel armors became to heavy to wear full plate on the battlefields for long durations.
The rapier was a very effective weapon against armored opponents-why? Because it had evolved as a weapon type from the time when armor was commonplace and it was used on the battlefield, to a time when the rapier was used mainly as a dueling weapon and not a battlefield weapon per se. The early rapiers were thicker with sharp cutting blades on each side as well as the point. The newer rapiers became thinner with only point blades. Eventually the rapier became a specialized weapon used for duels and decoration, as the power and accuracy of gunpowder increased to the level that they were more effective against armor.
So if one is describing an early style rapier, the heavier one with side blades, so it could pierce & cut, then yes it can be effective against armor. A later rapier would be thinner, with no side blades for cutting, would be less effective. Although the newer rapier would be extremely manueverable and precision strike would still enable it to be effective against armor. Rapiers feel almost weightless in real use.
Here is some history on the sabre, a sword tha was used well into the 19th century well after firearms were accurate and powerful:
The sabre first appeared in Europe in the 10th Century and was used until the 19th century.
The sabre saw heavy military use in the early 19th century, particularly in the Napoleonic Wars, where Napoleon used heavy cavalry charges to great effect against his enemies. The sabre faded as a weapon by mid-century, as longer range rifles made cavalry charges obsolete