Isabella Grace Olivo (left) stars as Princess Zoe in Riverwalk Theatre’s production of “The Princess Who Saved Herself.” Olivo, seen here with the Troubadour (Alex Forger), learned to play the electric guitar for her role.

Photo by Ariniko O'Meara

“There was a castle by a waterfall/with a pink and purple wall/ with a princess living there,” opens “The Princess Who Saved Herself,” a 2010 song by singer/songwriter and geek culture icon Jonathan Coulton.

Coulton’s song, which tells the story of an unconventional young heroine and the clever ways she handles angry dragons and evil witches, comes to the stage this weekend at Riverwalk Theatre thanks to local playwright and actor Edric Haleen.

“It’s a clever, cute, intelligent song that suggested a bigger universe,” said Haleen, who wrote and directs the family-friendly play of the same name.

Haleen’s adaptation follows Princess Zoe (Isabella Grace Olivo), an imaginative and compassionate girl who uses her intelligence to take on scary opponents — and forms a rock band along the way. Olivo and fellow cast members Lee Purdy, who plays an angry dragon, and Nicole Craven, who plays en evil queen, learned to play guitar, bass and drums for their roles.

In order to expand the world presented by Coulton’s song, Haleen had to work through some tricky questions.

“Why is she a princess?” he asked himself. “If her parents are gone, she’s either the queen or has older brothers and sisters in the line of succession. But why aren’t they the ones dealing with the antagonists?”

Beyond matters of world-building, Haleen wanted to write a play where the heroine doesn’t rely on magic or special powers. Princess Zoe uses math and reason to solve problems, which the playwright backed up with research. Haleen even uses a set of numbers known to mathematicians as a Mandelbrot set, which is referenced in another Coulton song.

“The mathematics of the Mandelbrot Set will be accurate when Princess Zoe is in class,” Haleen said. “There’s logic and reason embedded into everything.”

Keeping with the theme of education and reason, all children who attend the play will receive a free book courtesy of local nonprofit Reading is Fundamental and the fundraising efforts of Haleen and his family.

Logic and reasoning act as social themes in the story as well, encouraging audiences to think critically about the world around them. One character, the evil witch, uses natural events to trick the kingdom into thinking she has magic powers.

Haleen hopes that the thoughtful themes capture the attention of parents as well as kids.

“Every good children’s show plays on multiple levels,” he said. “It plays to the adults who drive the kids to the show as much as the kids who the show is purportedly aimed at. (It’s) either the most mature children’s show or the most child-oriented adult show.”