A Room That’s a View

Now the officers can drink in Full HD
Now the officers can drink in Full HD

You might think that remastering the rooms and sprite animations for Wing Commander IV would be a similar task to remastering the videos – I certainly did before I started – but it’s actually a very different beast.

A composite of some first-pass WCIV rooms and sprites

For a start, all the “shapes” (as the game files call them) are static images. I was expecting that for the room backgrounds, but not for the sprite animations (Eisen and Maniac on the bridge, Vagabond in the bar etc.). Yet when Pedro extracted the files from the original game and sent them my way, there they were – eight thousand, five hundred and thirteen TGA files, comprising the rooms, hangars, computer consoles, buttons, toggles and every individual frame for every character animation.

An Avenger on the Flight Deck of the BWS Intrepid
An Avenger on the Flight Deck of the BWS Intrepid

Upscaling static images using AI is quite different to upscaling video footage. When you have an image sequence in a video file, the AI can analyse groups of frames, identify similarities and changes between them, gather and analyse depth information from parallax motion and interpolate a lot of data to add to the image. With a static frame, you don’t get that.

Here We Go ESRGAN

My previous workflow using Topaz Labs Video Enhance AI was out. Instead, I started looking into ESRGAN (Enhanced Super-Resolution Generative Adversarial Network) – an open source Neural Net that a lot of game remastering enthusiasts use. If you’ve seen any of the Doom remasters with higher resolution textures or the Final Fantasy VII HD mod, they use ESRGAN.

Being an open source program, ESRGAN isn’t exactly user-friendly. In its native form, it’s a command-line program – so there’s a lot of learning involved to really utilise its greatest strengths. There is, however, a dedicated community creating AI models specifically for use in ESRGAN, so I have a considerable amount of granular control over the entire process.

That said, I did begin to tire of typing out and logging endless command-line scripts to see the results – so I did a little digging online and found that a user called ptrsuder had created a GUI that can be installed alongside ESRGAN called Image Enhancing Utility (IEU) – which saves a lot of time and finger work!

Image Enhancing Utility for ESRGAN by ptrsuder
Image Enhancing Utility for ESRGAN by ptrsuder

It’s Technobabble Time Again

Once I had my balance of AI models figured out, the process for remastering the Wing Commander IV rooms and sprites was a lot simpler and easier to automate than the video remaster was. I downloaded and tested a lot of AI models, and eventually hit on the winning combination of:

Cinepak_Alt does an impressive job of removing the banding, dithering and compression artefacts from the highly-compressed source images and Nickelback upscales the image by 400%. The Nickelback model is especially good at upscaling photographs and realistic images, so it was perfect for Wing Commander IV’s real-life sets.

Once they’re selected in IEU, I drop the original TGA files in the IEU_input folder in my ESRGAN intallation directory, kick the application off and… wait. A lot. It’s an agonisingly slow exercise to process 8,513 distinct images (and they all have to be processed twice – once for Cinepak_Alt and once for Nickelback), but once they’ve all been processed, the results of both models get combined into the IEU_output folder and we have our ramastered results!

Of course they’re all exported as uncompressed, 32-bit PNG files, which are practically useless to Pedro for inclusion in the actual game. So one of us then has to go through another laborious process to batch convert them into BC7 format DirectX DDS textures.

Next, I get to figure out the entire process again for Wing Commander III, with its early 90s CGI sets. That will be another very different beast…