– Los Angeles, Vancouver and New York are some of the most filmed cities in the world, offering familiar backgrounds or serving as stand-ins for other locations. Minnesota and St. Paul rarely command attention from moviemakers. As a result, the area looks unexplored and fresh, which is one of the reasons why in the summer of 2015, Woody Harrelson, Laura Dern and Judy Greer joined director Craig Johnson in the Twin Cities to make “Wilson,” an amiable R-rated comedy of family dysfunction, opening Friday.

In January, the film had its world premiere in a packed 1,200-seat theater at the Sundance Film Festival. One head-scratching audience member spoke for many viewers charmed by its novel look, asking Johnson where he had shot it. “Was it filmed in Canada?”

“This was all filmed in Minneapolis-St. Paul,” he said, an answer provoking audible surprise. “And we had a wonderful time there.”

In retrospect, that atypical choice based on artistic and financial considerations alike made a great deal of sense, bringing the area the largest movie to be filmed locally since the Coen brothers made “A Serious Man” there in 2008.

“We were thrilled to shoot there,” Johnson said. “It had everything. We couldn’t believe it had the lakes we needed, the cityscapes we needed, the suburbs, the malls, the dive bars. It had everything. It was the perfect setting for ‘Wilson,’ ” in look and in social tone.

Where else can you capture your cast having slapstick confrontations inside the Mall of America, taking a family ride on the toddler-sized Como Town Amusement Park train and spending years in Stillwater’s Washington County jail? Where else can a character be cuddly and misanthropic?

“Wilson” is based on a sarcastic graphic novel by Daniel Clowes. His characters generally are suburban malcontents overcoming their introversion and figuring themselves out — quirky comic figures with cynical underbellies. His work has created the cult classic films “Ghost World” and “Art School Confidential,” set in disconnected areas neighboring Hollywood and Manhattan.

“Wilson” offers a notable change in character and location. The title figure is a windbag curmudgeon who discovers that he and his ex-wife had a daughter born after their separation 17 years earlier. When Clowes rewrote the comic into a film script, it turned optimistic in a way that his earlier adaptations were not. It’s set in an ordinary, evolving, anonymous town that very much resembles the Twin Cities.

Familiar territory

Johnson got to know the region before he thought about using it as a setting. He visited for a few days in 2014 to present “The Skeleton Twins,” his dark comedy starring Kristen Wiig and Bill Hader, as the closing night feature of the Minneapolis St. Paul International Film Festival. When he decided to bring “Wilson” to the screen, he felt that returning to Minneapolis to film it would give the story a much better setting than its proposed locale, gritty Oakland, Calif.

He saw the mild-mannered Twin Cities as the ideal environment to capture Wilson’s character. He’s an oversharing chatterbox who opens up to random strangers as they casually try to inch away, 10,000 Lakes style.

The setting also was a comfy return for the film’s star and the third time Harrelson has worked in Minnesota. His first feature here was 2005’s “North Country,” a dramatized account of a sexual harassment lawsuit by female workers at the Eveleth Mines on the Iron Range. He returned one year later to play a singing cowboy in Robert Altman’s final film, “A Prairie Home Companion,” a benign love letter to the declining radio show industry. In 1999, Harrelson directed his own play, “Furthest From the Sun,” at Theatre de la Jeune Lune in Minneapolis.

He found the state an ideal location for a summer semi-vacation. He called “getting the opportunity to do this out there in Minneapolis” an advantage comparable to sharing the screen with his excellent co-stars Dern and Greer.

“On episodic TV, you have, say, six months of your life with no social life and endless hours,” he said. “Whereas something like this, it lasts — what? — a month and a half. It was a glorious experience, and we got to have a social life. You’ve got to have fun, not just do something good.”

Have fun he did, attending some of the biggest rock shows of the season, from the Basilica Block Party to Rock the Garden, touring the Excelsior Brewing Co. and hosting the film’s wrap party at the CC Club in Minneapolis, one of many watering holes the cast and crew visited. There were so many on their list that the director and principal cast couldn’t recall them by name.

“We were so wasted,” Johnson said. “We had a little too much fun at them.”

“This was the gift of a lifetime,” said Dern, for herself and “all of us as a family. We really had this radical summer vacation together!”

She had a specific memory of the shoot that she said she would take with her like a postcard of the visit, a nighttime kissing scene with Harrelson at the glowing entrance of Mancini’s Char House in St. Paul.

“It’s after our first drink together and we come out of the bar. It’s our first embrace under that light with the sign of the bar we’ve been in,” a picturesque local landmark that hasn’t changed much since it opened in 1948. “It’s so beautifully designed by Craig, but it also pays great tribute to the genius of Fred Elmes,” the director of photography. “And to me it’s also that very iconic design in red.”

Harrelson a magnet

Casting Harrelson made building the main ensemble happen quickly. People appeared hoping to work alongside him as if “we had a bonfire,” Johnson said. “They were all so excited to work with Woody.”

But with a huge roster of small speaking parts, filling every role was a challenge.

“We have 54 speaking roles, and we’ve cast at least 60 percent of them locally,” said co-producer Jared Ian Goldman. The Minnesota talent includes Guthrie veterans Richard Ooms, Bill McCallum and Mark Benninghofen, who joined the cast after Goldman saw him in the theater’s staging of “Juno and the Paycock.”

David Rubin, the film’s casting director, took on what Johnson called the “gargantuan project” of finding local players who were perfect for quick performances.

“The wonderful challenge of working on Daniel’s material is that it’s episodic,” Rubin said. “You have people who have just a handful of lines being confronted by Wilson. And that takes a particular type of actor. Someone who understands that in one short scene you don’t have to play Macbeth. You can play the idiosyncrasies of a moment of a piece of behavior and completely score. So I’m enormously gratified by the talented cast we assembled, because that’s exactly what these sorts of panels in Wilson’s life required.”

The business side of show business also played a key role in the decision to make a movie in the Twin Cities.

“I try to stay blissfully ignorant of the financial side,” Johnson said, “but I do know that it really made sense for us to be there — the rebate worked for us,” as the state returned $1.5 million of the film’s $6 million shooting budget. Co-producer Mary Jane Skalski said the production employed a “mostly” homegrown crew, about 70 percent local by her estimate.

Johnson calls it a win-win deal. “We bring 200 people into town and all we do is spend money, that’s all we do.

“We go to every single restaurant you can imagine there; we attend local events. So I am a huge advocate in general for state tax rebates. And it’s a gift for moviegoers to see on-screen a place that’s not L.A. or Vancouver or New York.”