Producer Matt Tolmach wasn’t surprised that Sony Motion Picture Group chairman Tom Rothman wanted a sequel to “Jumanji: Welcome to the Jungle.” After all, the film didn’t just open big two years ago this month; its box office take actually increased 38.4% in its second weekend of release — a rare feat for a studio tentpole movie.

But Rothman wanted the sequel, “Jumanji: The Next Level,” for Christmas 2019. That gave Tolmach and Co. a short window to reassemble the movie’s busy stars — including Dwayne Johnson, Kevin Hart, Jack Black and Nick Jonas — and come up with a storyline that justified the film’s existence.

“We didn’t want to make the sequel because that’s what you do,” says Tolmach. The plot had to be “in keeping with the spirit of the first movie, but at the same time turn it on its ear completely.”

It’s not the first time Sony had faced a challenge with this property. The studio tried for years to formulate a sequel to 1995’s “Jumanji,” starring Robin Williams and adapted from Chris Van Allsburg’s children’s book of the same name, but it languished in development hell. Finally, screenwriter Chris McKenna came up with the central idea for “Welcome to the Jungle,” focusing on a quartet of high school students awkwardly inhabiting video game avatars that starkly contrast their real-world selves, both physically and emotionally.

Tolmach first presented the idea to Rothman in a meeting shortly after the latter became head of Sony Pictures in February 2015.

“I probably pitched him a couple of things, and he said, ‘maybe, maybe, maybe,’” recalls Tolmach. “Then I said, ‘Here’s the thing that I’m most excited about,’ and I pitched him ‘Jumanji,’ and he literally said, ‘I’m making that movie.’”

Jake Kasdan directed both “Welcome to the Jungle” and “The Next Level” and co-wrote the latter with Jeff Pinkner and Scott Rosenberg. The key to cracking the sequel was coming up with a new body swap twist, namely putting a pair of elderly men played by Danny DeVito and Danny Glover into the avatars of Dr. Smolder Bravestone (Johnson) and Franklin “Mouse” Finbar (Hart), respectively, giving the younger stars the opportunity to comically kvetch and marvel at their super-fit bodies.

“It’s a terrifically smart idea that takes the big idea that was in the first movie and takes it to a new place,” says Rothman.

The writers also expanded the Jumanji video game universe, creating a broader palette of filming locations. The first film was shot primarily on location in Hawaii, with bit of stage work in Atlanta at the end of the schedule. That was flipped for the sequel, which began principal photography in January with a two-month shoot in Atlanta, where the production used five soundstages as well as various practical locations. Then it hit the road for a week in Hawaii, a week in the snowy mountains of Calgary, Canada, and a few days in the desert of New Mexico, before decamping to the Glamis dunes at the southern tip of California to shoot a spectacular dune buggy chase.

Kasdan’s biggest challenge: a scene in which the heroes are chased by rampaging mandrill monkeys across rope bridges swinging over a bottomless ravine. The shot involved stage and location shoots, as well as countless hours of CGI work in post.

“It’s one of those things you work on every day for a year and a half,” says Kasdan of the sequence. “It took a level planning and pre-imaging and figuring out that I hadn’t done before.”

Tolmach can’t definitively say if and when work will begin on another “Jumanji” sequel, but he’s optimistic.

“I think we’ll probably let Jake lay down for a few minutes and take a breather, then I’m sure we’ll be back at it,” he says. “But right now, we’re just dreaming.”