Let's figure out how the NYM HC IGT timer works!
7 years ago
Illinois, USA

Hello, I am CJacobs. I run the game on NYM HC and am an amateur game-popper-opener. I've taken Max Payne 3 apart piece by piece and I can almost put it back together! And maybe you can help me.

New York Minute Hardcore is a relatively unique mode in that it's the only one that measures your ingame time (which it gives to you at the end of the run). I want to figure out how it does that so that we can know what counts as gameplay. The problem is, I'm not very good at reading code, and I think it'll be a lot easier to figure this stuff out if I have more eyes helping me comb through it! The information might be hard coded and thus un-viewable by us, but let's hope it's not!

You can help me by downloading a program called OpenIV, found at OpenIV.com. It's the designated Rockstar Games game dismantler, and while Max Payne 3 is a bit different than GTA 4 it runs on relatively the same engine and so a large portion of the file hierarchy is exactly the same. You'll need the PC version of Max Payne 3 and the current patch (which you should have if you own the game on Steam!) and that's about it.

So far I've found values and references for normal NYM that allow the timer to pause as it does during cutscenes, and I think NYM HC probably doesn't have its own file hierarchy and just piggybacks off of a lot of that code.

edit: As a warning, if you are going to mess with anything, right click on the relevant file and export it to make an easy backup first. Max Payne 3 is a very fickle 40GB beast held together with bubblegum and duct tape and it will collapse under its own celluloid if you poke it too hard.

Edited by the author 7 years ago
BigPapi and JOEdrinksBEER like this
United States

This is a great idea. I am all for dismantling everything and figuring out how the clock works to test its reliability. Currently I am working on projects related to other Max Payne games but I intend on turning my focus towards Max Payne 3 in the near future.

Keep us updated with what you find and let's keep this thread going.

Illinois, USA

So, a couple of miscellaneous finds so far:

First, here are all the various things you can do in gameplay and how much they slow down time. These values are linear on a 1:1 scale, so 1.0=100% speed, 0.1=10% speed and so on. These values are found in Common.rpf/Data/Tune/Timewarp in Timewarp.xml, as well as Update/Common/Data/Tune/Timewarp (which is a different directory used for pairing DLCs to the game).

http://puu.sh/uxyE1/b207616335.png

However, this is just the flat rate, called 'WarpScale'. These values are modified by a couple different variables further down in the file called 'WarpBlendRate' and 'WarpLifetime'. These two APPEAR to control the ramp down from realtime to the speed set by 'WarpScale' for the various actions you can perform, but I'm not sure. Either way, these values are freely editable including "none" which is just realtime, and you can change them to your liking to affect the game in silly ways.

Next, I found the following references in the various New York Minute UI files that refer to a variable called "Arcade.TotalTime" as well as the ticker itself that displays your time (the one in the top left corner) having a special ID for other things to refer to it by.

https://puu.sh/uwnBz/9bf1f6b6b2.png

https://puu.sh/uwnE3/74f15b882d.png

What I'm hoping this means is that the ticker shown at the END of a chapter has an ID of its own, meaning there will be references to NYM Hardcore to be found pointing toward it.

http://puu.sh/uxzxB/6b13e91405.png

There's also this file in the arcade folder which contains some properties for displaying the timer at the end of the level in NYM mode. The display for the NYM end slate UI contains the following:

http://puu.sh/uxzQh/ae6f3d1eb3.png

So let's run through it part by part. In descending order, the strings are:

  • ArcadeLevelEndHeader & AM_NEW_YORK_MINUTE (AM from hereon stands for 'arcade mode' I assume), which is just the text above the timer that says 'new york minute'.
  • A blank string with no text to display? Could just be filler space.
  • ArcadeLevelEndTime, which is presumably the timer that displays your total time. In NYM this is your time remaining, in NYM HC this is your ingame time.
  • ArcadeLevelEndComp & AM_LEVELCOMP, the text that says 'level complete!' at the end of a normal NYM run.
  • ArcadeLevelEndTimeClock, the little clock graphic that appears next to your time.

Then there's an invisible divider followed by AM_CONGRATS, which appears to refer to the "Congratulations!" that appears when you beat New York Minute Hardcore (and nothing else).

Which we can deduce two things from: First, NYM and NYM HC do use the same file hierarchy since both UIs are here and combined. Second, NYM HC must somehow still use 'ArcadeLevelEndTime' since there is no specific timer block for it in the UI, perhaps it is repurposed in the code only when you're playing NYM HC.

http://puu.sh/uxAFD/075141d814.png

Oh, and there's also this reference to an action called "PauseTime" in the NYM ticker UI file, but I haven't found references to it anywhere else yet.

Edited by the author 7 years ago
BigPapi likes this
United States

CJacobsSA: Do you think it's possible to make a load remover for Story Mode to pause the timer during cutscenes? I don't know how familiar you are with LiveSplit, but you seem to have a great sense of the game files.

Edit: Yeah this is a bit off topic from NYM, and I would like the conversation to stick to that, but I had to ask.

Edited by the author 7 years ago
Illinois, USA

It might very well be possible! What I'd need is a memory address that the game uses every time you are in a cutscene, which most likely exists. All I'd need to do then is have it say "when this address is true, pause the timer, and when it's false unpause it". What I could do is use existing load time removal addons (the Dishonored one by Fatalis seems to be a common base?) and just tweak it to use MP3's values instead.

I'll look into it! The only problem is getting Cheat Engine or another memory scanning trainer to work with Max Payne 3. Thanks to Rockstar's kinda-sorta-DRM, the game really really doesn't like code injection. If you try to hook it up to something like cheat engine or another trainer, half the time the game just won't load at all. But I might be able to get around that, unless they've loosened the reins now that the multiplayer is deceased in which case I won't have to!

In NYM HC news, I asked on the OpenIV forums if you can open Max Payne 3's .sco files (scripting files) but there is no decryption method for them yet. Max Payne 3 is kinda low on the OpenIV development totem pole because GTA 4 and 5 are much more popular for modding, so it's not a planned feature right now. So if any of this stuff requires accessing the .sco files, unfortunately we're outta luck I think.

Edited by the author 7 years ago
Illinois, USA

https://puu.sh/uEm75/a84b74ee51.png

I found a value for the ingame timer using Cheat Engine! Note that this is NOT the NYM HC-specific timer, it's just a float value that determines how long you have been in gameplay. Here are my findings based on some testing:

  • First and most importantly, it automatically stops counting up when you are not in control of Max, in absolutely any situation. And I mean ANY situation: The short transitions from cutscene to gameplay, while doing a scripted melee kill, bullet cams, cutscenes, anything. Basically, it only counts up when your crosshair is visible on the screen and never anywhere else.

  • This specific timer resets to 0 at the start of every level, so it probably couldn't be used for keeping time in a speedrun unfortunately.

  • It is NOT based on your framerate, it is framerate independant.

  • It DOES slow down and speed up with 100% accuracy (I compared it to the NYM ticker to make sure)

So we're one step closer to solving the puzzle. Now that I know there's a gameplay timer, I can search for it while playing New York Minute Hardcore and see if it carries over between levels. Since it's a float value, it changes position when you close/reopen the game, so I'll need to see if there's something I can do to make it stick around as well. Signs are pointing toward the NYM HC timer being 100% accurate to real-time, but we'll see!

Edited by the author 7 years ago
JOEdrinksBEER likes this
Game stats
Followers
239
Runs
456
Players
77
Latest news
Arcade Mode and run comments news.

Hello everyone. Following the recent UI changes within speedrun.com, it is now possible to host the Arcade Modes on the main Max Payne 3 leaderboard, as it is now possible to set the difficulty filters for individual categories (they used to just apply to all categories), so this means the Arcade Mo