Resident Evil 2 will say goodbye to deprecated tech

As those following my recent twitter updates may have noticed, I’ve been rewriting a huge deal of code recently. So what does this translate to? Find out after the jump.

Like the title implies, I’ve been migrating Resident Evil 2 to more modern graphical and audio technology: I got XAudio2 in one corner for the sound and DirectX9 for the graphics. Long story short, it will not depend anymore on deprecated or non-working pre-Windows XP modules.

Here’s a list of what DirectX9 does compared to DirectDraw.

  • It provides native support to modern GPUs, instead of relying on some sort of hardware-software mixed emulation, effectively making rendering lightweight and more precise in general.
  • It allows to rewrite the whole rendering code in a manner closer to the original PlayStation sorted list approach, which removes the need of hacks used for approximated depth simulation. In other words, on PC it’s currently using a real z-buffer for depth while it’s internally emulating the PSX transformation engine (the GTE) and uses draw lists in order to keep everything in place.
  • Blending for texture mapping has been greatly revamped to support what the PlayStation was capable of. To give an example of the more advanced alpha blending used, here’s the player shadow (left original, right new one):The trick used on PlayStation with shadows was a grey texture that renders in reverse colors and subtracts what’s underneath it. The original PC blending approximates that by reversing the texture color in software and simply draws it as semi-transparent, while the new one can effectively produce subtractive blending and achieves the original intended effect. This applies to other effects, such as smoke clouds, water, etc.
  • It finally allows us to implement HD texture packs such as RE2 SHDP with very little effort or extra steps.

And now for sound with XAudio2, which replaces DirectSound:

  • In terms of raw power, the biggest advantage of XAudio2 is that it makes non-trivial tasks, such as looping music, completely painless. This will be used to fix a number of details that don’t quite match with the original sound, like a bunch of BGM tracks which can’t loop seamlessly by repeating the whole song.
  • The worst thing about the original engine is that it relied heavily on msacm (aka Windows Multimedia), a sorta deprecated Windows module responsible for codecs and other things. This module would be used to decompress and resample the game’s ADPCM audio. The problem with msacm is that it seems to fail in some scenarios for unknown reasons since it just won’t boot sometimes on Windows 8. This module was completely removed and replaced with a custom ADPCM decompressor and ffmpeg for resampling.
  • Native support for OGG decoding with ffmpeg and support for vanilla OGG with sound files that only have one sample (voices and BGMs). This used to be a little hacky before, since it would override the mmi modules (Windows Multimedia RIFF wave parser) and generated intermediate data, but now it’s entirely working with straight data feeding the XAudio2 driver, so it’s faster, uses less memory, and works even on audio files not intended for mods.
  • It removes the need to use sound quality settings, since stereo 44KHz sound is nowadays the most common audio format and isn’t that CPU intensive to process.

All this stuff will be coming to version 1.1.0 of RE2 Classic REbirth. Yes, I’m skipping 1.0.9 as this is technically a major milestone. Also, most of the code being used for this rewrite will be recycled on the first Resident Evil as well.

41 opinions on “Resident Evil 2 will say goodbye to deprecated tech”

  1. That’s VERY exciting news, kudos for everything you’re achieving! With all those technical improvements and the possibility to use SHDP’s backgrounds, we’re really close to being able to play the ultimate version of RE2.

    There’s something I wonder, could the EX Files from the N64 version be implemented into the PC version in any way? (whether it is by scattering them throughout the game like in the N64 version or by adding extra “pages” to the files the PC version already has)

    1. It’s halted right now because I hate it. Whatever new piece of rendering code done into this gets transferred over to RE3 when I decide to resume working on it eventually.

      1. Cool news for RE2 and also RE1. This Classic REbirth project is the coolest thing.

        Auch! for the “I hate it”, RE3 is actually my favorite Lol. Anyway I know you have good reason cause the game is a “satanic mess”. Hopefully RE3CR will get Tactical reload

      2. if the issues are wobbly vertex animations
        You should take a look at quake 2’s high poly packs for weapons
        but then i don’t know if RE2 and 3 started to use bones over vertex

        1. The issue is completely different. I already have a solution for that, but it requires a rewrite of some of the algorithms that generate polygon data. It’s already fixed for non-rigged models.

          1. It is possible to replace the models with better ones?

            it would be interesting to see community made assets for it

  2. Very excited for this update.
    Also would it be possible to add the ability to skip the realtime cutscenes?

    And have you ever looked at the pc port of resident evil survivor, I have read that it is terrible, so I was wondering if it can be salvaged in any way or if its better to just stick with the psx version.

    1. Cutscene skin is planned, but I’m too lazy to figure out some of the more complex cases. I’ll work on it again at some point with the assistance of MeganGrass. As for the PC port of Survivor, it’s plays so much like a bootleg I’m not gonna touch it.

      1. I see, Its a shame that the pc port is such a mess.

        I have also read that you are working on recreating the DC arrange mode for RE1, is this something you are actively working on or something you plan on doing later. Also do you think its possible to recreate the saturn battle game for a definitive version of RE1

        1. Was working on that just for fun, RE1 barely allows to inject new features correctly. Battle game is definitively possible.

    1. Well, they probably don’t even have anymore the sources of these ports, so imagine this on their business perspective. However, I wouldn’t mind if they decided to recycle my stuff and release it officially on GoG.

  3. Thanks for your work Gemini! Will the 1.1.0 patch be in a similar form as previous patches? Or does this level of code re-write need a new executable or anything?

        1. Yeah, I’m not a fan of overcomplicated patching methods. I like my stuff being as simple as possible and compact if it’s the case.

  4. I personally prefer OpenAL over XAudio2, especially with it’s superior support for 3D audio.
    With 3D audio support, you could have the Nintendo 64 soundtrack which was in Dolby Surround.

    1. Also, will RE1: Classic REbirth get a similar update?
      And will this tech be used for the upcoming RE3 Classic REbirth?

    2. OpenAL also has support for advanced EFX effects.
      OpenAL Soft is free and open source and would be great for Classic REbirth.
      And in my opinion, much better than XAudio2.
      It would also have superior HRTF support.

      1. Here’s the reason why I don’t want OpenAL: it’s not a Windows component in any version, while XAudio2 is standard in Windows 10 (and can be added with a simple DLL to 7, 8, and 8.1). As for the advanced features it provides, they are pretty much useless considering RE2 uses spatial audio based on left/right channels, no real 3D involved whatsoever. Anything more complex than panning would go wasted on those samples.

        As for RE1 and 2, yeah, they will receive the same treatment in some capacity.

  5. So are HD background texture packs like Resident evil 2/3 seamless HD possible with this or is it still a ways off?

    1. Okay after re-reading the post it seems i totally skipped over the part about it being now possible. Disregard and this is great news! you are a legend Gemini.

  6. So having this on dx9 does that mean we have a lot more possibilities with different resolutions. including different ratios or are you just not gonna allows us to play it in 16/9. I understand if you don’t like it and don’t get me wrong we all appreciate the work you have done for these games, they are amazing. but most tvs are 16/9 and and majority of people don’t really care about stretched pixels on a game that is like over 20 years old, it doesn’t affect the gameplay.

    1. I’m not implementing stretched 16:9 because it looks pretty ugly, but there are ways to force it via Reshade. There’s a shader that can expand the image in all directions.

      1. I tried to use that but it does noting unless its in dx9 is there another way? Also how come when I go into the ini page and change the aspect ratio it does nothing? Then when I look back at the ini it has reverted to default? Is there a setting that is stopping me from changing the x and y size? It may look worse in your opinion but I find black bars on the left and right breaks immersion and considering they are ps1 graphics doesn’t really make too much of a difference they are still early 3d polygons, For me you have giving me a perfect version or re 1 and 2 the only thing is left the option to chose aspect ratio/resolution.

      2. Dolphin-esque upscaling would be interesting but intensive I would imagine on DX9. I always upscale to 4k fullscreen 4:3 aspect ratio (with black bars).

  7. Also you should consider live streaming when you are working on these ports, I’m sure you would get a bunch of subs, just look at kaze he does it full time.

  8. Could you give us the option to change the “tactical reload” and “automatic aim target change” hotkeys? In most Resident Evil games, tactical reloading is done by Aiming + pressing the Run button, while in Classic REbirth it is set to Aim + Map button. Also, in the Playstation and Gamecube the automatic target change was done by Aiming + pressing L1/LB, while in Sourcenext it is done by Aiming + pressing the Run button. It would be very appreciated if an option to change those hotkeys was made

  9. I don’t know if it is possible to add support for the Chinese language. Now if you add Chinese directly, the game directly displays garbled characters.

      1. To my knowledge this is the only instance which this kind of error occurs. Do you think, for these old games can we benefit anything from graphic driver panel settings? Anything we should or shouldn’t tinkering with?

        1. The thing with these objects is that they render technically as semi-transparent, but have palette data that inhibits the transparency on some colors, making them effectively blend only partially. Doing that on fixed-pipeline is pretty much impossible because it requires 2 passes, but it’s hard to detect these special cases.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.