Warning! Spoilers for Game of Thrones Season 6 follow.

'The Battle of the Bastards' was many things. It was Game of Thrones' most expensive episode, costing around $10 million, and it took 25 days to shoot — another record for the show.

And judging by how much of it my wife spent with her eyes squeezed nearly shut and her fingers in her ears, HBO succeeded at making one of the most tense, violent episodes of TV ever.

It was also something of a history lesson. The episode schooled us in the strategies and the horrors of warfare throughout the ages, from the Roman Empire's worst defeat to the American Civil War and its gruesome piles of corpses.

We've seen the carnage of war before on Game of Thrones, but mostly in the aftermath of big (read: expensive) battles that occurred off-screen. The mostly naval battle of Blackwater, the sieges of Castle Black and Riverrun, the Dunkirk-like evacuation of Hardhome: none of these were traditional meetings in the field. The Battle of the Bastards was different, with peaceful parlay ahead of time and a clearly executed strategy.

In this episode, we saw first-hand the relentless confusion of battle and the strategic blunders and the breakdown in battlefield communication, thanks to the Saving Private Ryan-style steadicam view.

In case you were too overwhelmed to notice the historical references on the show, here is what you missed:

Battlefield hostages

"And whatever you do, be sure you run in a very straight line." Image: HBo

Ramsay Bolton, it turns out, is pretty mild by historical standards. He only had one hostage, Rickon Stark, with which to taunt or compel his enemies. Charlemagne took hundreds of hostages at a time, casually killing them when they no longer served his political needs.

He might have kick-started the brutal tradition of taking hostages, but Richard the Lionheart took it to another level. At the battle of Acre in 1191, during the third Crusade, he took a whopping 3,000 men, women and children hostage to make sure his Saracen enemy, Saladin, stuck to the terms of a peace treaty.

When Saladin was slow to cough up the necessary money, Richard had every last one of his prisoners slaughtered in a day. (It's this level of brutality that reminds us today to think twice before using the word "crusade" in a positive context.)

The Acre massacre so angered the Saracen army that it threw itself at Richard's well-defended position — and into annihilation. Jon Snow is not the only battlefield commander to lose his head over the enemy's cruelty.

But the fact that Ramsay managed to goad his enemy into action by taking just one life makes him much more efficient.

The arrows of time

"Initially, we based the Battle of the Bastards on the Battle of Agincourt," episode director Miguel Sapochnik said in an interview Sunday with EW.

Budget constraints forced Sapochnik, who also directed the acclaimed "Hardhome" episode, to change his plans. But you can still see a lot of Agincourt's DNA on screen in the hundreds of soldiers who were killed or wounded in repeated storms of arrows.

Agincourt, easily the most famous of battles in the Hundred Years' War between England and France, marks the first major use of the longbow. This deadly, long-distance weapon helped to make lightly-armored, mobile archers the new dominant force in medieval warfare.

A small English force of archers and men-at-arms under Henry V were able to defeat a vast French army by keeping the air thick with thousands of arrows, sometimes fired at point-blank range.

A sanitized re-imagining of the arrow-filled horror of Agincourt. Image: wikimedia

Oh, and after the battle, the victorious Henry V was worried about a counter-attack, so he had literally thousands of French prisoners put to the sword. All of them, in fact, except the handful of nobles he could ransom back to their families for a high price.

Once again, a medieval English King makes Ramsay Bolton look positively gentle in his respect for the enemy.

Encircling

Tormund may not have understood what the hell it meant, but the double-envelopment strategy — also known as a pincer movement — has been known and feared on the battlefields of Europe and China for millennia. Even Sun Tzu, writing in The Art of War back in the 5th century B.C., had advice on how best to pull this strategy off.

When Jon, and hence his army, were goaded into battle, they charged forward like idiots. Then Davos and his cavalry, feeling useless where they were, fell into the same trap.

The night before, Jon knew his best chance was to stay where he was, where trenches protected his flanks. Being out in the open, he knew, risked encirclement by Ramsay's superior ground force.

And that, of course, is exactly what happened.

Oopsie. Image: HBO

Probably the most famous pincer movement in history was executed by the Carthaginian general Hannibal at the battle of Cannae in 216 B.C. It was this battle, more than Agincourt, that Sapochnik looked to for inspiration — largely because having a circle of Bolton shields blocking the horizon, and no horses in the shot, made filming a lot faster and cheaper.

But it's a good thing he did, because it allowed us to see with horrific clarity what is normally a dry and dusty description in history books.

Like Agincourt, Cannae involved an inferior force (Hannibal's army of roughly 45,000) defeating overwhelming odds (the Romans had around 55,000) with superior tactics.

The two armies met in lines of roughly equal length. But in defiance of conventional wisdom, Hannibal kept stretching his lines out — making his center surprisingly weak. He led the center in an apparent retreat, while the two sides casually shuffled forward into a semi-circle.

It soon became a circle. Too late, the Romans realized they were being drawn into a trap, just like Snow's ragtag army. At the battle's most intense moments, historians estimate, 600 legionnaires were cut down every minute.

Even the machine-gun-filled battle at the beaches of Normandy couldn't match that rate of slaughter. Nobody knows how many Romans survived, but it may have been as few as 3,000 out of 55,000 men. One grisly detail: Hannibal told his men to merely cut the Romans' hamstrings, so the Carthaginians could come back later and finish them off at leisure.

Technically, the Boltons didn't even need a pincer movement. Snow's force was in such disarray, it fell victim to a single envelopment of disciplined men-at-arms jogging around them with spears and shields.

Usually, single envelopments require a natural barrier — mountains, say, or ocean — to pin the enemy down. In this case, the "natural" barrier was a pile of dead bodies.

Jon Snow really, really didn't deserve to win this battle.

Then again, Ramsay's overconfidence was a strategic weakness too. In The Art of War, Sun-Tzu advised generals not to completely encircle the enemy, basically because it'll make them go all "This is SPARTA!" and fight to the death.

Better to leave a small gap in the circle, making your enemy think there's a chance of retreat. Then you can either cut them down as they head for the exit, or pursue them as they flee for the hills.

Better luck next time, Ramsay! Oh, wait.

Waterloo! Couldn't escape if you wanted to

The arrival of the Knights of the Vale: A damn close-run thing. Image: HBO

If Jon is murderously bad at battlefield strategy, Sansa Stark is worse. Can anyone explain why she failed to tell Jon she had asked Littlefinger to bring his Knights of the Vale to the battle?

One explanation, of course, is that the writers wanted to amp up the drama. But last-minute cavalry arrivals do have plenty of precedent in the history books.

No battle illustrates that fact better than the one that finally defeated Napoleon: Waterloo. On that fateful day in 1815, an army under the Prussian Prince Blucher arrived late in the afternoon to save the Duke of Wellington from Napoleon's attack.

Wellington attributed his victory to the nick-of-time arrival of Blucher's forces, and later called it "the nearest-run thing you ever saw."

Well, that is until Stannis Baratheon saved Castle Black from the Wildlings at the end of Game of Thrones Season 4.

Not only is the show plagiarizing some of the greatest battles in history, it seems — it's also plagiarizing itself.