Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Halve game speed (for 60 FPS support) #2

Merged
merged 4 commits into from
Nov 15, 2015
Merged

Conversation

drdaxxy
Copy link
Collaborator

@drdaxxy drdaxxy commented Nov 14, 2015

As discussed, here's a patch that halves Zestiria's simulation speed, letting us run the game at 60 FPS in real time.

For reference / future game updates: addresses were found by looking around for 1/30 in memory and tracing through related code. There's two integer speed multipliers, initially set to 2 at SpeedResetCode3_Address, as part of a structure at a static address. I found they get copied over from an object, or reset if lower than 2, upon some state changes (e.g. loading a save or entering a cutscene), hence I patch the code that does this at SpeedResetCode_Address and SpeedResetCode2_Address to skip these particular multipliers.

The size of said structure is not hardcoded to allow for at least some flexibility to game updates - should its base address and the location and syntax of the code copying it stay the same, this patch will continue to function even if the structure gets expanded after the part we care about.

The patch is activated if the target framerate is above 45 and thus running the game at 50% speed gets us closer to real time than 100%.

In addition, I change the FudgeFactor internally (i.e. not saved to config) according to the target framerate, as I've noticed the default 1.666 is inadequate when targeting 60 FPS, causing slowdowns of about 1/6 in busy town areas.

Note this is not yet shippable, as the target framerate is hardcoded to 60 for now. As we talked about, this value should be looked up from BMF.

Once that is implemented, no further configuration changes than setting targetFPS=60 in BMF's config are necessary to activate this patch.

Best regards,
Niklas.

@Kaldaien Kaldaien self-assigned this Nov 15, 2015
Kaldaien pushed a commit that referenced this pull request Nov 15, 2015
Halve game speed (for 60 FPS support)
@Kaldaien Kaldaien merged commit f32b691 into Kaldaien:master Nov 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants