Hollywood has long struggled when it comes to big-screen adaptations of popular video games, making Warner Bros. and Legendary’s “Detective Pikachu” and its $54.5 million debut in North America all the more impressive.

Even with “Avengers: Endgame” still turbocharging the box office, “Detective Pikachu” came dangerously close to dethroning Marvel’s latest juggernaut, which collected $65 million in its third weekend in theaters — an outcome few might have predicted weeks ago. “Detective Pikachu” also enjoyed the best opening weekend ever for a video-game adaptation. (Though all things considered, that’s not a particular high bar in a genre that’s filled with more misses than hits.)

Entrenched fans and passionate gamers have long dismissed adaptations like “Super Mario Bros.” and “Doom” for failing to bring justice to the source material. Likewise, narrative storytellers have struggled to remain faithful to the video game experience without capturing the feeling of playing one.

“Most adaptations lose something in the process of going from one platform to another,” said Shawn Robbins, an analyst at Boxoffice.com. “Sometimes it’s an overemphasis on special effects and not a much focus on character.”

With “Detective Pikachu,” Warner Bros. was able to capture a world that felt recognizable to fans of the Pokemon universe without isolating audiences who weren’t as familiar with what goes down in the fictional world of Ryme City. Some credit for the mostly positive reviews undoubtedly belongs to Ryan Reynolds, the voice behind the cuddly yellow Pokemon. His casting raised eyebrows, but soon became a stabilizing and excitement-driving force with each phase of marketing.

Reynolds harnessed the snarky wisecracking humor that made “Deadpool” so popular, and essentially watered it down for a younger crowd. The wit of the animated sleuthing Pikachu made his on-screen relationship with Justice Smith’s live-action character all the more charming.

“Ryan Reynolds is key in the success. His presence in the movie created that crossover appeal,” said Paul Dergarabedian, a senior media analyst at Comscore. “Having his voice gives it a level of familiarity that audiences really bonded with.”

“Detective Pikachu” also played more in line with a broad family film, rather than a movie geared toward gamers. Males accounted for 59% of moviegoers, with 49% of ticket buyers under the age of 25. The fantasy-adventure wasn’t exactly counterprogramming to “Avengers: Endgame,” but it was one of the few PG options currently in theaters that is aimed toward younger moviegoers. Word of mouth will be crucial in dictating how “Detective Pikachu” will resonate beyond opening weekend. Competition, especially on the family front, will begin to pick up as the summer moviegoing season heats up. Over the coming month, kid-friendly options like “A Dog’s Journey,” “Aladdin” and “The Secret Life of Pets 2” will hit theaters.

“Initially, the numbers we are seeing so far are reflective of a big fan base,” Robbins said. “It’s a shorter, PG movie compared to ‘Endgame,’ which is PG-13 and three hours long. It was a smart time to put it out.”

Even less adored video-game adaptations like Dwayne Johnson’s “Rampage” and the “Tomb Raider” reboot with Alicia Vikander were able to salvage any embarrassing write-downs thanks to overseas appeal. Both films tripled their domestic grosses at the international box office. “Rampage” made $428 million globally, with $327 million of that coming from foreign markets. And “Tomb Raider” ended its domestic run with $274 million, as North America accounted for a paltry $58 million of that haul.

“Detective Pikachu” kicked off overseas with a mighty $103 million. It had the biggest bow in China ($40 million), followed by the United Kingdom ($6.6 million). The film still looks to earn a bulk of its sales internationally, but the margin between North American theaters could be smaller than other movies in the genre. That’s due in part to the generation-spanning appeal of the Pokemon brand. Look no further than the recent and occasionally dangerous popularity of “Pokemon Go.” The augmented reality mobile phone app gave a resurgence to the Nintendo game. It’s prevalence was ubiquitous.

“There are parents who grew up with the game and now have kids old enough to see this movie,” Robbins said. “The brand as a whole hasn’t gone away. That’s why it stands apart from other movies that have seen a bigger share of its popularity coming from overseas.”

Cracking the code on video game adaptations is more than just a chance for Hollywood to reap the benefits of lucrative ticket sales. These days, a movie is much more than just box office receipts, or even home entertainment and streaming deals. This particular adaptation offers a chance to introduce new fans not just to the Pokemon video game that the movie was based on, but also the popular trading card game and cuddly plush toys.

“It could be a boom area for the business,” Dergarabedian said. “It could be worth billions of dollars to the industry, like superheroes are now.”