Denis

Denis 

Bringing old games back to life on modern systems.

0subscribers

1post

goals2
0 of 200 paid subscribers
This should cover most of the cost of the tools I'm using.
1 of 2

Max Payne WIP/ ENGLISH

The Max Payne patch is in progress. It's an old Remedy game utilizing obsolete APIs, such as DirectSound and DirectX 8, but still a classic, beloved by many.
The target of this particular fix is to fix the modern systems compatibility, implement widescreen support and fix certain high FPS bugs.

The startup. 

First on our list, the original 1.05 game can't properly read CPU capabilities, leading to a startup crash (the infamous "JPEG error"). That is fixed now. I also redesigned the original game launcher, allowing for GPU/Display selection, and primary display with its native resolution as default, no more 640x480 default. I've also removed odd resolutions from the list, such as 1280x1440, keeping only the ones with native aspect ratio. I don't know why 2001 needs GPU selection, it could run fine even if Windows have decided to run it on an integrated toaster, but, here it is.

The API

Second problem is the API the game uses. Back in 2001 it was humble DirectX 8 that can still run games on modern systems. Older architecture comes with its own set of rules and limitations though. Especially lack of modern Windows presentation and driver overhead that could limit the performance making you question why this 2001 game runs only at miserable 200 frames per second. So, it now uses optimized Vulkan renderer, with native borderless fullscreen as default. Alt+Tabbing have never been so easy with this game. I've also implemented the mailbox presentation, known as "Fast V-Sync", which avoids typical V-Sync framerate to refresh rate limit, while keeping the image tear-free. G-Sync and FreeSync also work. There's also a custom frame limiter up to 240 frames per second.
Another obsolete API is the DirectSound. This is the sound API (duh) that was used on Windows until it was replaced with XAudio2 with the release of Windows Vista. So, it's like old. And it also caused problems, such as some of the sounds not playing at all. No one wants to play a half-muted game, so I fixed the underlying DirectSound input, and also added a modern XAudio2 path, which is enabled by default.

The Widescreen.

Max Payne was developed in the era where a 4:3 square monitor taking half of the apartment was a standard. So, the game was designed around that aspect ratio, but, rather than designing around it, Remedy hardcoded it into the game. The first offender is the main menu, that gets visibly stretched to fill the screen. Thankfully, the main menu and loading screen arts utilize 4:3 textures letterboxed to 16:9 image, leaving empty black bars at the top and the bottom. So, the easy solution is just to fix the rendering aspect, scale the menu until it fits the horizontal edges. Now you have a proper 16:9 UI that was inside the game the whole time, cramped into 4:3.
Now there's the famous visual novel that gave Max Payne its character. So, it deserves a special treatment. Unlike the menu, it doesn't have any space to crop the screen vertically, the 4:3 area is fully filled in the original screen. 
What do we do if the UI doesn't fit the screen? We re-arrange it. The comic texture uses 2:1 aspect ratio, so it can be expanded to fit the screen width, leaving just enough space underneath the controls. 
I also remastered the fonts and HUD icons, using the original Univers font as a base. The original atlases were designed for 640x480 resolution, so, they didn't look good at 4K. The game now uses vector HUD assets, rasterizing them at game initialization to selected resolution, so it should look great throughout FullHD to 4K.

The Framerate

The games scales well for high framerates, most of the stuff, including character movement uses frame delta time for calculations, but there are certain bugs that can still occur even if dT is accounted correctly. The most glaring issue is shoot dodge jump height and distance, and Vinnies inability to jump from one roof to another. Usually that requires a 60fps lock to fix. I've found the underlying collision check issue, that was pulling Max, or any other NPC, back to the ground at certain height threshold. It's not an obvious problem, the physics calculations look right, but, at 60 fps a jumping character leaves that threshold in a few frames, at 240 fps it takes them 4 times more frames to clear that, and the pulling force is applied every frame. The game now checks correctly for that, so, shoot dodge and Vinnie's jump are working as intended at any framerate now.
 
The patch is gonna be released soon, available here, as a separate download at https://mogga.space or trough MOGGA Windows app. 
Subscription levels4

Old-school Enjoyer

$1.28 per month
You just want the game to game.

DirectX Redistributable Collector

$3.2 per month
I have installed more DirectX 9.0C packages than I'm willing to admit.

DLL Enthusiast

$6.4 per month
Yes, I will gladly put some dude's DLL into my game's folder!

Ultrawide Supporter

$12.8 per month
Just like a Samsung Odyssey, your generosity has no borders. 
Go up