IbizaPocholo
NeoGAFs Kent Brockman
https://www.pcgamer.com/how-sega-brought-shenmue-back-to-life-on-pc/
When did you start work on the project?
We first took possession of the Shenmue archive back in October 2015. Ramp up was slow while we picked through the massive data archive and planned the approach we would take to porting the project. Over the lifetime of the project, probably at least 20 people have touched the code, although the peak team size was probably around 10 developers.
Was bringing a 20-year-old game to modern PCs difficult?
Incredibly difficult! At D3T we have worked on some very challenging projects, but this was by far the toughest. For example, there was no source code for the Dreamcast libraries, but luckily the Shenmue 2 Xbox version had source for the ported Xbox libraries.
It was definitely not a case of dropping the Xbox libraries in and building Shenmue, but it gave us a good starting point. Even with that there were still many files missing which we had to reverse engineer from assembly code.
The Dreamcast and Xbox had 32-bit processors, but PS4 and Xbox One are 64-bit. This has a big implication with how memory and data are handled. It was a massive engineering effort to convert the code and resulted in many obvious and many subtle bugs, some of which were still being found close to release.
Working on a Japanese-developed game must’ve been tricky too...
The original code was written by Japanese developers, so all the comments are in Japanese. We used Google Translate a lot to try and get a handle on what the code was doing, but it’s often not clear. Shenmue 1 had the additional problem for us that the game logic was written in a separate scripting language and ALL the function names and variables were in Japanese too!
Interestingly, we found that once the resolution was increased existing bugs became more apparent. There’s also the issue of widescreen, with the game being designed to run in a 4:3 ratio. This meant many of the cutscenes didn’t work correctly, so we had to add black bars at the sides.
The original games were technical marvels and they were highly tuned for the specific hardware platforms, which didn’t give us as much performance headroom as we were expecting, given their age.
Were there any quirks of the Dreamcast hardware that made getting the first game working on PC especially difficult?
The Dreamcast hardware had some features which would prove difficult to emulate, particularly the audio and graphics systems.
The audio on the Dreamcast is mainly driven by a completely different chip to the main CPU. This chip is loaded with different programs defined by the original developer, specifying things such as loop points, reverb, volumes, envelopes, etc. We didn’t have the source data for this, which meant a lot of reverse engineering to get it sounding okay.
Regarding the graphics, the Dreamcast GPU had some powerful and unique features not found on modern cards. The two features which caused us the most headaches were the modifier volumes used for shadows and light volumes, and the ability to sort transparent geometry on a per pixel level. The lack of modifier volumes on our target platforms led us to use a hybrid stencil shadow approach similar to the Xbox version of Shenmue 2. This is different to the original and artefacts can occasionally be seen because of this.
Did you find anything interesting in the source code?
The moon in Shenmue 2 is not a texture. It’s an actual 3D object in the distance correctly lit by the sun direction. This produces accurate phases. We were surprised by this level of detail! The Lucky Hit games adjust the physical behaviour of the ball based on the weather and temperature, calculated by the time of day. For cutscenes, the game switches to high definition heads and hands, which allow for more expression. In Shenmue 1 the game logic is all written in a scripting language. For Shenmue 2 they got rid of it and wrote the logic in C code directly.
More at the link.
When did you start work on the project?
We first took possession of the Shenmue archive back in October 2015. Ramp up was slow while we picked through the massive data archive and planned the approach we would take to porting the project. Over the lifetime of the project, probably at least 20 people have touched the code, although the peak team size was probably around 10 developers.
Was bringing a 20-year-old game to modern PCs difficult?
Incredibly difficult! At D3T we have worked on some very challenging projects, but this was by far the toughest. For example, there was no source code for the Dreamcast libraries, but luckily the Shenmue 2 Xbox version had source for the ported Xbox libraries.
It was definitely not a case of dropping the Xbox libraries in and building Shenmue, but it gave us a good starting point. Even with that there were still many files missing which we had to reverse engineer from assembly code.
The Dreamcast and Xbox had 32-bit processors, but PS4 and Xbox One are 64-bit. This has a big implication with how memory and data are handled. It was a massive engineering effort to convert the code and resulted in many obvious and many subtle bugs, some of which were still being found close to release.
Working on a Japanese-developed game must’ve been tricky too...
The original code was written by Japanese developers, so all the comments are in Japanese. We used Google Translate a lot to try and get a handle on what the code was doing, but it’s often not clear. Shenmue 1 had the additional problem for us that the game logic was written in a separate scripting language and ALL the function names and variables were in Japanese too!
Interestingly, we found that once the resolution was increased existing bugs became more apparent. There’s also the issue of widescreen, with the game being designed to run in a 4:3 ratio. This meant many of the cutscenes didn’t work correctly, so we had to add black bars at the sides.
The original games were technical marvels and they were highly tuned for the specific hardware platforms, which didn’t give us as much performance headroom as we were expecting, given their age.
Were there any quirks of the Dreamcast hardware that made getting the first game working on PC especially difficult?
The Dreamcast hardware had some features which would prove difficult to emulate, particularly the audio and graphics systems.
The audio on the Dreamcast is mainly driven by a completely different chip to the main CPU. This chip is loaded with different programs defined by the original developer, specifying things such as loop points, reverb, volumes, envelopes, etc. We didn’t have the source data for this, which meant a lot of reverse engineering to get it sounding okay.
Regarding the graphics, the Dreamcast GPU had some powerful and unique features not found on modern cards. The two features which caused us the most headaches were the modifier volumes used for shadows and light volumes, and the ability to sort transparent geometry on a per pixel level. The lack of modifier volumes on our target platforms led us to use a hybrid stencil shadow approach similar to the Xbox version of Shenmue 2. This is different to the original and artefacts can occasionally be seen because of this.
Did you find anything interesting in the source code?
The moon in Shenmue 2 is not a texture. It’s an actual 3D object in the distance correctly lit by the sun direction. This produces accurate phases. We were surprised by this level of detail! The Lucky Hit games adjust the physical behaviour of the ball based on the weather and temperature, calculated by the time of day. For cutscenes, the game switches to high definition heads and hands, which allow for more expression. In Shenmue 1 the game logic is all written in a scripting language. For Shenmue 2 they got rid of it and wrote the logic in C code directly.
More at the link.