lundi 23 octobre 2017

The Untold Story of Xbox One Backwards Compatibility


It’s been a longer, stranger road than you could’ve imagined.

Quick: name your favorite E3 ever.

Time’s up! Can you even pick one? Hopefully they’re all fun in their own way for gamers, but for 28-year Microsoft veteran Kevin La Chapelle, the answer to the question is both instant and unlikely to ever change: 2015.

That’s the year you heard some of the loudest cheering ever at Microsoft’s Xbox E3 media briefing. And those cheers weren’t for new versions of Halo or Gears of War, or even Project Scorpio. Instead, the Galen Center erupted in applause when Head of Xbox Phil Spencer announced what La Chapelle’s team had spent months working on: backwards compatibility.

Microsoft partner software engineering manager Kevin La Chapelle recounts the early days of the Xbox One backwards compatibility program.

Microsoft partner software engineering manager Kevin La Chapelle recounts the early days of the Xbox One backwards compatibility program.

“It was literally the proudest moment of my career,” La Chapelle told me, his face fighting back emotions at the mere recall of the story.

“It was literally the proudest moment of my career,” La Chapelle told me, his face fighting back emotions at the mere recall of the story. “The room erupted. I teared up. It was perfect validation of all this effort.”

La Chapelle’s right hand and principal software engineering lead, Jonathan Morrison, was sitting next to La Chapelle and the man that green-lit the initiative, Microsoft VP of Xbox software engineering Kareem Chouhdry. “For me [the memorable moment] was when the words came up on the teleprompter. You heard an audible gasp [in the room] right before Phil said it. The hair on my arms stood up.”

The fan-first feature has evolved from an experiment conducted by two separate Microsoft Research teams into a service planned for Xbox One’s launch – complete with hardware hooks baked into the Durango silicon – until the well-publicized changes to the Xbox One policies (namely, stripping out the always-online requirement for the console) forced it to be pushed to the back burner.

Microsoft principal software engineering lead Jonathan Morrison (right) explains the process of getting Xbox One backwards compatibility off the ground as Xbox platform lead Bill Stillwell (left) looks on.

Microsoft principal software engineering lead Jonathan Morrison (right) explains the process of getting Xbox One backwards compatibility off the ground as Xbox platform lead Bill Stillwell (left) looks on.

Even the Xbox One X is getting involved, with a handful of Xbox 360 games getting Scorpio-powered enhancements.

It’s obviously back for good now, and expanding into original Xbox compatibility of select titles on Xbox One (the first batch of which we announced today). Even the Xbox One X is getting involved, with a handful of Xbox 360 games getting Scorpio-powered enhancements like 10-bit color depth, anisotropic filtering, and up to 9x additional pixel counts displayed on screen

I spent a day with the Xbox backwards compatibility team to find out who they are, why they did this, and where they’re going with it. And my two biggest takeaways were that A) The story is much more interesting than you think it is, and B) The engineers responsible for you being able to play Xbox titles from a generation or two ago on your Xbox One today care more deeply and passionately about their work than you can possibly imagine.

A Parallel Experiment

Microsoft is a big company. And while many teams closely collaborate and share knowledge, it’s a large enough outfit that plenty of its groups operate quietly on experiments and research projects until they’re ready to be spun up into larger, more resource-intensive tasks. So it was that Choudhry and Xbox core platform group program manager Kevin Gammill found two such groups that might help the compatibility effort they were already readying for the successor to the Xbox 360 – which itself emulated select original Xbox titles via an emulator known internally as Fusion.

It was 2007. One of those teams was working on PowerPC CPU emulation – getting 32-bit code, which the 360 uses, to run on the 64-bit architecture that the third-generation Xbox would be using. The other team, out of Beijing, started writing a virtual GPU emulator based on the Xbox 360 GPU architecture. “These were like peanut butter and chocolate,” Choudhry recalled. “[So we thought,] ‘Why don’t we put them both together?’”

The atrium of Studio D on the Xbox Campus in Redmond, Wash., where the Xbox compatibility team works.

The atrium of Studio D on the Xbox Campus in Redmond, Wash., where the Xbox compatibility team works.

“We had to bake some of the backwards compatibility support into the [Xbox One] silicon.”

Choudhry did just that, and so the first steps to Xbox One backwards compatibility were taken, long before the console had a name or anything remotely resembling final specifications.

As Durango crystallized, so too did plans for Xbox 360 compatibility on the new machine. “This was primarily a software exercise, but we enabled that by thinking ahead with hardware,” Gammill explained. “We had to bake some of the backwards compatibility support into the [Xbox One] silicon.” This was done back in 2011. Preliminary tests showed that support for key Xbox middleware XBA audio and Textureform was extremely taxing to do in software alone, with the former, Gammill noted, taking up two to three of the Xbox One’s six CPU cores. But a “sock,” as Gammill called it – basically an Xbox 360 chip inside every Xbox One, similar to how Sony put PS2 hardware inside the launch-era PS3s – would’ve not only been expensive, but it would’ve put a ceiling on what the compatibility team could do. “If we'd have gone with the 360 sock, we likely would've landed at just parity,” he said. “The goal was never just parity.”

Back on the Horse
Xbox software engineering VP Kareem Choudhry discussing Trioxide and Microsoft's early Xbox One backwards compatibility project.

Xbox software engineering VP Kareem Choudhry discussing Trioxide and Microsoft's early Xbox One backwards compatibility project.

“I was a fool to think that writing the emulator was going to be the hardest part,” Choudhry said.

After Spencer replaced Don Mattrick atop the Xbox division in early 2014, he and Choudhry restarted the compatibility program. “For me it was unfinished business for years,” Choudhry said, referring back to the “Trioxide” research projects he’d had his eye on years prior. But there were unexpected challenges. “I was a fool to think that writing the emulator was going to be the hardest part,” Choudhry told me, before asking rhetorically, “How do you go and re-ship IP that you don’t own on a new platform?”

He started by recruiting La Chapelle, a literal hard-driving Microsoft lifer (his Audi R8 has custom Xbox-green brake calipers, an Xbox-centric vanity license plate, and he has a framed ceremonial speeding ticket he got at a fully police-sanctioned event that allowed him to get the R8 up to 200mph hanging on the wall outside his office). He, in turn, hand-picked Morrison, and they managed to track down and recruit Barry Bond, a member of the original Trioxide project who happened to still work at Microsoft, to their team. Morrison then proposed a guinea pig game to start experimenting with.

“We needed to pick a game that was reasonable in a sense that we could do it in a reasonable amount of time,” he told me. “Something that had Xbox Live networking stuff.”

Microsoft's Xbox Campus in Redmond, Wash. in October 2017.

Microsoft's Xbox Campus in Redmond, Wash. in October 2017.

La Chapelle, operating in total secret, tried to find someone he could talk to at The Behemoth. He reached out through LinkedIn.

And so they chose Castle Crashers, the wildly popular, four-player Xbox Live co-op beat-’em-up made by San Diego studio The Behemoth. But naturally, it’s not easy to emulate an old game on a new platform. “We pretty quickly realized we had a problem,” Morrison said. “When we'd hit a problem we'd hit a screen full of numbers.” These numbers were symbols – codes for the developer to indicate the rough origin of the issue. Symbols, of course, that they didn’t have a “decoder ring” for.

And so La Chapelle, operating in total secret since no one outside of his team knew about the compatibility project, tried to find someone he could talk to at The Behemoth. He reached out through LinkedIn (“pre-[Microsoft] acquisition,” he noted with a laugh), got in touch with the CEO, and after getting them under NDA, acquired the symbols. "They were awesome,” La Chapelle said. “They were super helpful." He added that his team was able to work ten times faster with those symbols in hand.

Through the Eye of the Needle

But that didn’t solve another problem: testing later levels with save files that didn’t work on a new platform. So they had to play the games manually, by themselves, in order to get any and all data they needed. “We had no way to use a save game,” Morrison remembered. “Kevin became our save game machine.” Noted La Chapelle with a laugh, “You wouldn't want to play me for money in Castle Crashers.”

“We had one game that ran at 1fps [at first],” La Chapelle recalled. “And the tester made it through anyway.”

After that problem was taken care of with a system that could transfer save files from one developer profile to another, the team was committed to an E3 announcement and a Fall 2015 launch. The first batch was done, but they’d been publicly promised to deliver 100 by the end of that year. Except that, heading into E3, a bunch of games just wouldn’t work. Or they ran very poorly. “We had one game that ran at 1fps [at first],” La Chapelle recalled. “And the tester made it through anyway.”

La Chapelle, Morrison, and the 25-person compatibility team wracked their brains over the issue, until Morrison had an epiphany. What, he wondered, was fundamentally different about how the Xbox 360 itself ran versus the Xbox One’s Fusion emulator? The scheduler – basically the CPU’s internal traffic cop that tells data where to go and how fast – operated at one speed on the 360, but Fusion had been running to the Xbox One’s default scheduler spec. When Morrison shared his apparent breakthrough during E3, La Chapelle told him, “Well, I know what you’re doing when you get home!”

A poster, signed by the Xbox compatibility team, commemorating 100 games shipped in the first year of the program.

A poster, signed by the Xbox compatibility team, commemorating 100 games shipped in the first year of the program.

The change to the scheduler worked – better than they could’ve even hoped. The team rallied around Morrison to get the new scheduler ready in time, and they shipped 104 backwards compatible games in that first year.

“Halo Reach was the first game where we fell down on that promise. That's where we learned that the subjectiveness of our testing wasn't good enough."

But Halo Reach was initially problematic on the Xbox One. "We don't hide the fact that we were wrong with Halo Reach,” Stillwell explained. “The method we had was not the method we wanted going forward." The compatibility team was devastated. “Our goal all along was to reach [Xbox] 360 parity,” La Chapelle said. “Halo Reach was the first game where we fell down on that promise. That's where we learned that the subjectiveness of our testing wasn't good enough. So we built an objective set of tooling.”

Reach got updated fixed, thanks in part to principal software engineering lead Brian Spanton’s Xbox Compatibility Performance Analyzer (aka XCPA) tool. “It's a struggle to figure out what actually is a bug,” he said, referencing that some errors were in the original game, and some were introduced by the emulator. Spanton showed me the tool, which shows two windows running the game – here it was Gears of War 3 – and a line graph that measured frame timing. Lower is better, and he brought up a scene where frame timing being too high resulted in an otherwise difficult-to-discover error in the game that the team likely wouldn’t have been able to catch before.

Moving Forward by Going Back

With hundreds of Xbox 360 games under their belts and their process honed to a ‘T’ – the crew wrote a white paper for Xbox developers on how to best write code that will stand the test of time going forward, compatibility-wise, and is also leveraging the Xbox One X to make a handful of 360 titles even better on the latest Xbox – the team was ready for a new challenge: making original Xbox games work on the Xbox One. The project was given an internal name of Fission, and principal software engineer Spencer Perreault jumped at the chance to make it happen in November of 2016.

“One day [Perreault] came to me and said, ‘I think I can make this work,” La Chapelle said. “[So] we turned him loose. It was his labor of love that delivered it to our community.”

Perreault started at Microsoft in 2009 right out of college, working first on the original Kinect team and then on the Kinect 2.0 team. When the opportunity arose to join the compatibility team in 2014, he jumped at the chance. “I’ve had a personal interest in emulation for a long time,” he said.

He first thought of trying to emulate the Xbox 360’s Fusion emulator, assuming it would fail. It did, and it did so “quite predictably,” Perreault added. The original Xbox manages its memory in 4 kilobyte increments, whereas the Xbox One does so 64k at a time. That proved to be a challenge that needed solving, as did the fact that the first Xbox used a 32-bit CPU, and the One a 64-bit. “Every waking moment,” according to Perreault, was spent either working on or thinking about OG Xbox compatibility.

Microsoft principal software engineer Spencer Perreault, the person perhaps most singularly responsible for enabling original Xbox game compatibility on Xbox One.

Microsoft principal software engineer Spencer Perreault, the person perhaps most singularly responsible for enabling original Xbox game compatibility on Xbox One.

Dolphin, a developer tool that was on every original Xbox debug and developer kit, was the first thing he was able to get running.

Dolphin, a developer tool that was on every original Xbox debug and developer kit, was the first thing he was able to get running. “It didn't look right [yet], but it was Dolphin and it was swimming,” he said with a smile. And so La Chapelle brought in a bunch full of original Xbox games from his personal collection at home. His “hit rate” – percentage of games that actually worked – was 10% at first, he estimated. Some worked, while others had severe graphical issues. I was shown a video of an early attempt with Forza Horizon. The HUD elements worked, but the actual gameplay was nothing but a black screen.

After a month or two the hit rate was getting up to 90%. “Trying a bunch of different games was helpful in getting things running,” Perreault said. Indeed, 13 original Xbox games will be available starting tomorrow, including top-shelf classics like Ninja Gaiden Black and Star Wars: Knights of the Old Republic. And even better, they’re not just compatible. They’re better. All the games run in 1080p with higher and/or smoother framerates. I played KOTOR side-by-side with the original (yes, running on an original Xbox), and the difference was obvious. Ninja Gaiden Black looked almost modern thanks to its native widescreen support, and you can mix and match Xbox systems in a System Link multiplayer match of Crimson Skies: High Road to Revenge; I played on an OG Xbox using a Duke controller against one person on an Xbox 360, another on an Xbox One S, and the fourth on an Xbox One X.

"This detail has always been there but the technology of the day was holding it back," said principal software engineer Eric Heutchy.

"This detail has always been there but the technology of the day was holding it back."

Unfortunately, legalities are almost certainly going to limit the overall number of original Xbox games we eventually get on Xbox One, as some of the publishers of those games literally don’t exist anymore, other titles have lost contracts because they’d been done on actual paper, and still others have music or other licenses that may have expired. The compatibility team was careful to under-promise, but hopefully, in time, they’ll be able to over-deliver.

As to what fans can do to try and get more games added to the list? “Support the program,” said senior director Xbox console marketing of Albert Penello, suggesting that publishers will look at that data. “Getting the fans of these franchises out is going to help unblock some of these [legal] challenges.” Stillwell agreed. “Fans hold the key here. We're doing the work. In some cases there are legitimate business reasons it can't happen. But the more that fans can drive that message back to the [publishers], the more we can do. That said, we can't complain. We've had great support.”

Ryan McCaffrey is IGN’s Executive Editor of Previews and Xbox Guru-in-Chief. Follow him on Twitter at @DMC_Ryan, catch him on Unlocked, and drop-ship him Taylor Ham sandwiches from New Jersey whenever possible.

Let's block ads! (Why?)

Aucun commentaire:

Enregistrer un commentaire