Writing A Story For An Existing Canon
First: Make sure to pack the papers together, so that they fire as a single projectile instead of just scattering everywhere
Whenever existing franchises have their debut in the world of video games, the matter of story is often an interesting one. People love the stories in their favorite books, movies, and shows, so when those books, movies, and shows become games, writers have an awkward balance to strike between giving fans what they want and keeping them from getting bored.
I've noticed that, generally speaking, whenever a series needs to be adapted for a game, there are basically three core strategies that can be used:
Strategy #1: Throw Canon, and Chronology, In The Dumpster

The most recent game to use this strategy is also the game that inspired this post: Jojo's Bizarre Adventure: Eyes of Heaven. Promising a story set in the long-running JJBA franchise, Eyes of Heaven delivers a Jojo's story by taking anything remotely resembling chronology and throwing it into a dumpster before lighting the whole thing on fire and, presumably, posing.
Thanks to the narrative trope of "time travel, alternate universe bullshit", Eyes of Heaven gets to simultaneously connect to every single part of the series at its most interesting. Noteworthy characters who died (multiple times, in some cases) come back for basically no reason. Old and young versions of the same character fight side by side, as do characters who are technically the same person in two different parallel universes.
This kind of story is sort of the Greatest Hits album of a series: all of the best moments, without a shred of context or framing. You just get to see all of your favorite cool guys do a bunch of cool stuff, but no one's going to say the story is emotionally engaging or even meaningful. It's essentially just a montage. Ultimately, this kind of game is extremely appealing as a massive "What If?" simulator for hardcore fans, but people new to the franchise are going to be utterly lost, if not repulsed entirely.
Strategy #2: The Same, But More

A strategy I feel like was more popular in the 90s and 2000s, this strategy basically involves remaining as faithful to the source material as possible, while adding content that extends the lifespan of the game, while not significantly modifying the story. Obviously, this was more common in the eras where it was commonplace for studios to poop out a crappy tie-in game with every big-budget movie.
The benefits of this strategy are obvious: your writing work is reduced immensely. Basically, rummage up the original manuscript or screenplay, Ctrl-C, Ctrl-V, done. Your level designers get the basic structure and order of the levels handed right to them, and your artists have mountains of reference material to go off of. Basically, all you have to do is extrapolate on the contents of the original work to get that bonus material. If your characters know each other before the start of the original work, cover that origin story in your game. Everywhere the camera cuts from one action scene to another, cover the in-between in the game.
Of course, this is a double-edged sword. Your project has expectations to meet in the minds of people familiar with the project. You need to hit the right story beats, show the right places, show the right events happening in the right way, and you need to strike the same mood and tone. If you don't, your game isn't faithful, and you're going to make fans mad, and you're going to create tension as people who know the story through your game struggle to communicate with people who know the story through the original. That's not what you want, you want a project of this nature to harmonize with the original work, to bring in new fans cleanly, and to expand the experience of new players.
Strategy #3: A New Entry Entirely

Sometimes, games come out that have the gall to simply declare themselves a part of a series as important as the founding works. I think that Ghostbusters: The Video Game is one of the most interesting renditions of this idea: it just stood next to two of the most beloved comedy movies of all time and said "Yeah, I'm the sequel".
This is really the dream of all of the fans on your team, which is hopefully everyone on your team. You get to produce a brand new work using this series or work that you already love, creating a new project, a new entry. It's the dream of every fan, because you basically get to work side-by-side with the original creator, even if not concurrently.
The down side, however, is obvious, especially to anyone who's read Harry Potter and the Cursed Child: you have a standard that you have to meet. Instead of with Strategy 2, where you have a fairly tangible set of requirements your adaptation has to meet (Harry needs to have a scar, Hogwarts is in Britain, etc.), now you have this much more ambiguous requirement that you meet the level of quality of the original works, and that you be "true" to the original works. Existing characters need to act like the original writer would have them act, and new characters need to feel like they belong, and the same goes for everything else. All of a sudden, you have a pedigree to match.
No matter what strategy you implement, your goals for adapting an old canon into a game are basically the same two, which are what I'm going to leave you with:
Celebrate the original work, and revel in the things that make people like it
Allow people to enjoy the original work in a new and interesting way