Edward Nygma, the Riddler, is one of the most distinctive villains in the entire Batman mythos, with hundreds of appearances across films, television series, cartoons and video games. While most versions of the character arrive as a fully formed villain, the incarnation of the character who appears in Gotham has actually received a surprising amount of depth as he transformed from an awkward but well-meaning police scientist into one of the most dangerous men in Gotham City.

Now, CBR is taking a look back at the evolution of the character on Gotham, and how the performance by Cory Michael Smith has morphed over the years to become one of the most well-defined villains in the series.

RELATED: Gotham Goes to War in No Man's Land Finale Trailer

HOW EDWARD NYGMA BECAME GOTHAM'S RIDDLER

When audiences are introduced to Riddler, he's nowhere near being a super villain. Edward Ngyma is instead introduced as a forensics scientist working for the Gotham City Police Department. Instead of being a bad guy, he's just an awkward employee who tries to befriend the other people at his precinct with brain teasers and riddles. While it infuriates his co-workers, he helps them solve several crimes in the first season of the show.

The show also hints at his romantic attraction to his co-worker co-worker Kristen Kringle, but that would ultimately send Edward down the path towards villainy.

RELATED: Sofia Falcone: Gotham's Criminal Mastermind, Explained

Kringle had no interest for Ngyma or his inadvertently creepy attempts at flirting. His actual attempts to connect with her ingratiate him to her, and she soon introduces Ngyma to Tom Dougherty, her new boyfriend. When Nygma learns that Tom abuses her, Ngyma tries to confront Tom and accidentally ends up killing him.

This sends Ngyma off the deep end, and he develops a second personality that's more in line with the villainous version of the character that fans are more familiar with. He successfully hides the crime, but the second voice in his head doesn't let up. Things take an irrevocable turn when, after finally getting Kringle to date him, he accidentally kills her after revealing he murdered Dougherty.

GOTHAM'S PENGUIN AND RIDDLER

Riddler tries to hide his involvement in the murder, with the more villainous personality getting more and more opportunities to impact the real world. After hiding Kringle's body, Riddler saved and befriended fellow future Batman villain Oswald Cobblepot, the Penguin. Although Riddler was exposed as a murderer and sent to Arkham, his friendship with Cobblepot saw him released once Cobblepot's turned his attention to the mayoral office.

But while Cobblepot developed romantic feelings for Ngyma, Ngyma was drawn to a woman named Isabella (who reminded him of Kringle.) Cobblepot killed her out of jealousy, and their relationship understandably soured. Edward embraced his role as the Riddler, the pair went to war and constantly tried to kill each other, with the conflict only ending when Penguin had his new henchman, Mr. Freeze, freeze Ngyma solid.

RELATED: Gotham's Joker Officially Arrives in Series Finale Teaser (VIDEO)

Penguin put the frozen Riddler front and center in his Iceberg Lounge, but Ngyma was eventually thawed out by an admirer. The extended period of time under ice had caused him mental damage, which for Ngyma was as good as a death sentence. Struggling to rediscover the Riddler side of himself, he eventually ended up in the Narrows alongside former Penguin henchman Butch, who had been resurrected as Solomon Grundy and Leslie Thompkins, who ran a clinic in the underprivileged area.

After eventually rediscovering the Riddler persona, he buried the hatchet with Penguin. However, the side of him that still felt humanity ended up falling in love with Thompkins. The two had a brief relationship, but they eventually killed each other. Both were then brought back by Hugo Strange, so they could have roles in season 5's "No Man Land" story.

HOW GOTHAM REDEFINED THE RIDDLER

riddler from gotham season 4

The Riddler that has been developed across Gotham brings a lot of surprisingly nuanced ideas to the character. He's motivated to be evil because he thinks that its a "beautiful" idea that proves his intellectual superiority. He's also fueled by the mistakes he's made and embraces the darker side of himself to avoid confronting his crimes. He's also found a worthy opponent in Lucius Fox, who is clever enough to offer a genuine mental challenge to Ngyma. His connection with Leslie Thompkins has also hinted at a shred of decency in him, even after they attempted to kill each other.

RELATED: Gotham's Joker May Be The Most Twisted Take On The Batman Villain Yet

By the final season of Gotham, he's very much the recognizable villain comic fans were waiting for, but with a shocking amount of newfound depth. Many Gotham versions of characters twisted the Batman rouges gallery in strange ways, but Riddler was instead refined into one of the most compelling characters in the series and arguably one of the most interesting takes on the character across all media.

Returning Thursday, Apr. 18 at 8 p.m. ET/PT on Fox, Gotham stars Ben McKenzie as James Gordon, Donal Logue as Harvey Bullock, David Mazouz as Bruce Wayne, Robin Lord Taylor as Penguin, Camren Bicondova as Selina Kyle, Erin Richards as Barbara Kean, Sean Pertwee as Alfred Pennyworth and Shane West as Bane.