Warning: SPOILERS for The Batman.

The Riddler is the primary villain in The Batman, starring Robert Pattinson as the Dark Knight. Though he's been a major villain of Batman in DC Comics since his first appearance in 1948, this movie is perhaps his best showcase in the entire franchise. Still, this new version of The Riddler draws inspiration from some of the best The Riddler comic books ever.

RELATED: 10 Reasons The Riddler Is Batman's Greatest Foe

The Riddler has evolved tremendously since those early days, but at his core, he remains largely the same. His best comic book stories showcase his capacity for complex puzzles and plots, but also other dimensions to his character that keep him from being a simple one-note villain. Some of his best comics could also point to his future in live-action, as his story in the new movie isn't done.

The Riddler

The Riddler capturing Batman and Robin in cover artwork for Detective Comics #140

Detective Comics #140 is the first comic book featuring The Riddler and it's still one of the best. Much of the iconography of the classic villain is established here, including his costume, which would inform nearly every version that followed in the decades since.

Though the first appearance of The Riddler is a far cry from the monster in the new movie, he's nonetheless the harbinger of years of stories featuring complex puzzles and over-the-top traps that have come to define the character in every medium.

The War Of Jokes And Riddles

Batman's fingers holding a puzzle piece over an unfinished jigsaw puzzle of The Joker's face on a cover of The War of Jokes and Riddles comic series.

The War Of Jokes And Riddles is a recent comic book story arc but ranks high among those featuring The Riddler. In this storyline by writer Tom King, The Riddler goes to war with the Joker for control over Gotham after the Joker tries to kill him.

It's a great and natural battle between two of the best Batman villains in the comics, with one representing pure chaos and the other intricate design. It could make for an interesting movie, given the ending of the latest film.

The Last Riddler Story

The Riddler celebrates in DC Comics.

The Batman Adventures #10 is one of the best Riddler comics for being a near-perfect distillation of the character. Set in the continuity of Batman: The Animated Series, the issue essays Riddler's sense of inferiority about not fooling Batman.

His plan is simple, stealing jewels from the Gotham Museum, and in the end, Batman stops him. Except it's by happenstance and The Riddler is overjoyed that, at least in his own mind, he finally made a riddle that Batman couldn't solve.

The Riddler's Ruse

The Riddler attacks in Batman '66 comic book.

There are great versions of The Riddler throughout comics and other media, and Batman '66 #1 combines two of them. The Frank Gorshin Riddler from the 1966 live-action series gets perhaps his best showcase ever in the first issue of the comic continuation of the '66 universe.

RELATED: Batman's Comic Book Villains, Ranked From Most Laughable To Coolest

The Riddler's plot is suitably complex, but the story is so great because of the scale and stakes. Batman and Riddler clash in a major battle that was mostly impossible in the 60s, with the two fighting on the back of a flying biplane.

Zero Year

The Riddler attacks Gotham in DC Comics.

A young Riddler is the mastermind in Zero Year, a revised origin of Batman from the New 52 era, and one of the best modern Batman comics. Riddler's schemes almost prove too much for a younger and less experienced Batman brand new to the job.

The story by Scott Snyder and Greg Capullo may have had some influence on the new movie, as it features a Riddler who goes after Gotham's infrastructure in a major way. The city floods and regresses greatly under the tyrannical rule of the villain.

Dark Knight, Dark City

Batman confronts Riddler in DC Comics.

One of the best Riddler comic books ever is also one of the darkest. In Dark Knight, Dark City, The Riddler stretches out beyond his usual limits as a puzzle maker to use the occult to summon a demon named Barbathos in a moody story with outstanding art by Mike Mignola.

This story reveals Riddler is more than just riddles, and his arcane knowledge is potentially limitless. Barbathos would go on to play a key role in Grant Morrison's epic run on the title, some of the best Batman comics of the 2000s.

Run, Riddler, Run

Riddler smiling with a hand on his bowler hat in Batman comics.

One of the best Riddler stories also represents some of the best Batman comic book issues of the 90s. This story provides a lot of social commentary that is arguably ahead of its time when The Riddler conspires to demolish low-income neighborhoods in Gotham.

Run, Riddler, Run takes some twists and turns, ultimately bringing Batman and The Riddler together on the same side in a way that shows that Edward Nygma isn't a simple or silly villain out for money or power.

Hush

Riddler confessing to Batman he used a Lazarus Pit

Hush is one of many modern comics where The Riddler is behind the complex plot at the heart of the story. In the comic book, The Riddler is an accomplice of the mysterious Hush, and like in the movies, claims to know the truth about Batman's real identity.

RELATED: 10 Best Batman Vehicles From DC Comics

It's a great showcase for The Riddler and an example of why he makes such a good villain. Though he isn't physically strong or equipped in gangs or goons, his intelligence and riddles often prove more challenging for Batman than brute force.

The Long Halloween

The Riddler wielding a pistol in Carmine Falcone's office in Batman The Long Halloween

The Long Halloween is one of the best Batman comic book story arcs ever for a number of reasons, and it's one of The Riddler's best comic books as well. The Riddler isn't behind the mystery in this story, but in a unique way, an investigator.

The Riddler is hired by Carmine Falcone to solve the mystery of who the Holiday Killer is, a complete inverse of his relationship with the character in The Batman and an unusual depiction of the supervillain's talents in the comics.

E.Nigma, Consulting Detective

Edward Nigma inside the Batmobile chatting with Batman in Detective Comics 822

The Riddler lends a hand again in what is perhaps his best modern story. In Detective Comics #822, The Riddler gains new dimensions when he teams up with Batman to solve crimes in one of the most awkward and comical team-ups ever.

The Riddler has turned over a new leaf as a private detective, offering his services to the police department and anyone else. Written by Paul Dini, this issue is a fantastic new approach to The Riddler that shows there are many possibilities with him.

NEXT: 10 Best Batman Comic Issues Of The 1970s