NEW YORK — For Will Ferrell, the opportunity to play a stepfather “who is not a total jerk or a real meanie” was the hook to say yes to “Daddy’s Home,” opening Friday.

Another “huge plus,” explained the actor and comedian, was the chance to partner again with Mark Wahlberg, his co-star in the 2010 cop comedy “The Other Guys.”

In “Daddy’s Home,” Wahlberg plays the biological father of the two children Ferrell’s mild-mannered radio executive is raising with his wife, played by Linda Cardellini.

“What’s nice here is that there really isn’t a bad guy in the story,” said Ferrell, who also produced the movie. His Brad character is almost too nice, working beyond the call of duty to earn the love and trust of his wife’s kids. When Wahlberg’s sexy, super-cool, secret agent, motorcycle-riding Dusty re-enters the scene, the two men dive into a big competition, which Dusty initially appears to be winning.

Ferrell noted, “When both of these guys finally do stop acting like stupid competitive kids and start to act like adults and realize what’s best for the family, the movie delivers a funny but also sweet message.”

While Ferrell is the one known for his improv skills, both “Daddy’s Home” stars had ample opportunity to ad lib.

“We had a pretty good template with the screenplay and we did shoot what was on the page in the first half of the day,” Wahlberg said, “but then we’d come back after lunch and fool around and try some stuff. A lot of that ended up making it into the movie.”

Talking about a scene in which the ripped and obviously in-shape Wahlberg did a massive series of pushups and then pullups, Ferrell said his line in the film — where he comments that Wahlberg’s character didn’t even sweat — was based on truth.

“Mark really doesn’t sweat. It’s kind of weird and little bit scary,” he added with a laugh.

That prompted Wahlberg to note, “But Will? He sweats a  lot — I mean a LOT! If he took off that sweater he’s wearing right now…” Ferrell finished the sentence: “You’d have to wring me out!”

Leading Wahlberg to insert wryly, “There would be no more drought in Los Angeles.”

One of the biggest pressures the two actors faced shooting “Daddy’s Home” came when they attended a Los Angeles Lakers game.

“It was lucky the NBA allowed us to shoot during halftime at a Lakers-Pelicans game. We had like six minutes to get that done,” Ferrell said, pointing out that most film scenes take “hours to set up a shot, and then you reshoot it many, many times. That was not the way this was going to go down, for obvious reasons.”

However both men nodded vigorously when asked if that added pressure helped make the scene more believable and also enjoyable to film.

“It was thrilling,” said Ferrell, “to do that in front of a live audience and try to get it all down in one take. And we did it.”

Before we parted, I asked Wahlberg what he thinks is the secret to Ferrell’s seemingly natural ability to create comedy.

“Along with being simply one of the funniest people on the planet, what makes it more enjoyable for me is, with Will, his comedy comes from a nice place. He simply loves making people laugh, inspired by the commonplace absurdities of everyday life that people can relate to.

“So many actors and comedians I’ve met over the years are the very opposite of what they portray in their work,” said Wahlberg, who did not identify those individuals. “I like that with Will, his private reality is not far different from his public persona. That makes for a great environment to work in.”