Closed Polymega closed 1 year ago
Hyper spray 004a4a10
or whatever this effect is
@illusion0001 Check out this video for easy testing: https://youtu.be/JgFjuwrQ1FY
Kill all but one Lying Figure here, then bait the last one to do a spray attack while you're on any stair of the pool. If you time/position yourself right, the creature will stay in place and keep spraying infinitely without moving. This video also shows the Hyper Spray (spray can weapon) in action along with monitoring those two addresses I mentioned.
After giving yourself the Hyper Spray and killing two of these enemies, make a Quick Save (F5) so you can Quick Load (F9) back to this spot quickly, if desired.
I suggest doing a playthrough [to test
006BC194
for water/flame animations] to ensure it's not changing anything we don't want to be changed. But my guess is that it's fine.
Did a full playthrough and everything was fine. This value is safe to change.
Oh, while playing, I noticed the physics of the spray from the Hospital puzzle box is not affected by framerate. I don't know if we can use this to our advantage with fixing the Lying Figure's/Hyper Spray's spray, but thought I'd point that out.
My memory has gone a bit rusty. That spray effect for the Hospital puzzle box is moving twice as fast. I was streaming a test playthrough when myself and the chat were convinced this particular spray wasn't affected.
Assuming finding a fix for one spray physics doesn't globally fix it for all spray physics, this particular scenario is not important at all. It's fine to be left alone. Just the Lying Figure (enemy) and Hyper Spray (weapon) sprays are important to look into.
I thought [...] saving it as a blank wav file would be enough though
Are you just renaming a blank .txt to .wav or something? That would be the problem why, then. You'll need an actual, legit silent audio .wav file for it to work.
You can open a short .wav file in Audacity, select the track , click the "silence" button , and save it out as
sddata349.wav
. Just be sure to save it as mono and not stereo.Edit: Here's a roughly 1-second silent .wav file for you to use: sddata349.zip
Hello, I am using that file along with splitbin/mergebin to put together an sddata.bin with a 'silent' bullet/shell casing, but even after I replace the file with the blank sddata349 and merging the files, the shell casing audio still plays. Is sddata349 the ONLY sound effect of shell casing, or is it possible there are more depending on floor type? I am testing this in nightmare hospital and the sound is still glitching.
Thanks.
I thought [...] saving it as a blank wav file would be enough though
Are you just renaming a blank .txt to .wav or something? That would be the problem why, then. You'll need an actual, legit silent audio .wav file for it to work. You can open a short .wav file in Audacity, select the track , click the "silence" button , and save it out as
sddata349.wav
. Just be sure to save it as mono and not stereo. Edit: Here's a roughly 1-second silent .wav file for you to use: sddata349.zipHello, I am using that file along with splitbin/mergebin to put together an sddata.bin with a 'silent' bullet/shell casing, but even after I replace the file with the blank sddata349 and merging the files, the shell casing audio still plays. Is sddata349 the ONLY sound effect of shell casing, or is it possible there are more depending on floor type? I am testing this in nightmare hospital and the sound is still glitching.
Thanks.
No, It should just be that one sound bite.
I thought [...] saving it as a blank wav file would be enough though
Are you just renaming a blank .txt to .wav or something? That would be the problem why, then. You'll need an actual, legit silent audio .wav file for it to work. You can open a short .wav file in Audacity, select the track , click the "silence" button , and save it out as
sddata349.wav
. Just be sure to save it as mono and not stereo. Edit: Here's a roughly 1-second silent .wav file for you to use: sddata349.zipHello, I am using that file along with splitbin/mergebin to put together an sddata.bin with a 'silent' bullet/shell casing, but even after I replace the file with the blank sddata349 and merging the files, the shell casing audio still plays. Is sddata349 the ONLY sound effect of shell casing, or is it possible there are more depending on floor type? I am testing this in nightmare hospital and the sound is still glitching. Thanks.
No, It should just be that one sound bite.
I wonder why it's not working then. Do I need to enable anything in the configuration? Is it rejecting the custom sddata.bin?
Could you please share your sddata.bin file with the blank casing effect? Thanks!
Hi there, I was lurking and thought it'd be fun to implement a couple of the solutions found so far. For now I wrote the solutions found by @AeroWidescreen for the fog and bullet shells, here's a build if you'd like to try it. d3d8.zip
And here is the branch I'm experimenting on if you want to see the code!
I'll try and help with other issues!
Oh, and here's a Release build, last one was Debug. d3d8.zip
Could you please share your sddata.bin file with the blank casing effect? Thanks!
No problem Here's the link to my sddata file. It's called sdata.bin60fps. If you want to use it, remove the "60fps" at the end of the .bin The file also needs to be placed in the custom sound folder of the sh2e folder. I'd recommend making a copy of the original sddata.bin file too just in case you want to play the game at 30fps again and want to keep the shell casing sfx.
Oh, and here's a Release build, last one was Debug.
Wonderful! Thank you. It looks like the fog speed fix is working as intended, but the bullet casing fix is still bugged.
It looks like the fog speed fix is working as intended, but the bullet casing fix is still bugged.
Yeah I noticed, tomorrow I'll check my implementation and report back!
Edit- I literally halved the value for the bullets instead of doubling it, I'll fix ASAP. 😅
It looks like the fog speed fix is working as intended, but the bullet casing fix is still bugged.
Yeah I noticed, tomorrow I'll check my implementation and report back!
Edit- I literally halved the value for the bullets instead of doubling it, I'll fix ASAP. 😅
Oooh can't wait to try that. Does it fix the bullet casings from hugging the floor?
mmm I'm not sure actually. Here's a build with the right value for the bullets d3d8.zip
@mercury501 I'll check it out. Thank you.
Here's a new build with flashlight, flames and red cross fixes d3d8.zip
Everything looks good so far except for the bullet casing fix; shooting the handgun will instantly crash the game back to desktop.
You are absolutely right, I got confused with the offsets to find the functions, before I had them hard coded! There you go d3d8.zip
Sweet! Thank you 👍
Hi all,
I was rummaging through memory looking for other values when I stumbled upon this one, I think it's a float and it seems to control game speed. Maybe it can be useful to somebody! Here's the address 932d34
Cheers
Hey all, I have an attempted fix for the "Ritual" prison monster footsteps in an experimental branch here, following mercury501's example on how to create patches. d3d8.zip (Working only for US V1.0 for now, but I will look into other versions soon.)
0x004AE615:
jmp PrisonerTimerFix
PrisonerTimerFix:
sal dword ptr [esi + 0xA0],1
ret
Hi @Murugo , just tested it now and seem to work!
one thing @Polymega I was shooting in the cell just for funsies, basically I: shot a shotgun shell kept holding the aim button
and the sound for the shell hitting the ground kept playing, and at a high speed. Did anyone else notice this?
Hi @Murugo, What a great surprise to wake up to! Thank you very much. I'll test this out as well when I return home from work. We really appreciate you coming in to help with this cause. 😊
@mercury501 Were you testing with a build using the 60 fps fixes you've integrated so far? I believe Murugo's 60 fps test branch (above) was forked from Elisha's repo, so it wouldn't include the 60 fps fixes you've integrated into your test branch.
@Murugo Awesome work here! The ritual prison monster has never sounded better! 😄
Good to hear! One downside is that this kind of patch will only work when FPSLimit = 60
. In general, is there a need to support frame limits other than 30 or 60?
Just the original 30 and new 60 will be supported, so we're good here. :) The main reason for this is the exact reason you stated here.
Plus, this is a slow, story-driven game, so the bump to 60 fps will more than suffice.
Would love to see in the near future after 60fps is fixed that 120fps could be worked on as well? Having unlocked framerate would most likely completely kill everything but fps in multiples of 30 or 60 should seemingly work fine
Some notes on the Lying Figure spray and Hyper Spray effects:
FUN_4A3EC0
: Update function for a Lying Figure spray particle. Controls the location, size and alpha of the particle each frame.FUN_4A4A10
: Allocates a new Lying Figure spray particle struct and sets initial values. Called once per frame while the effect is active.FUN_4A43F0
: Update function for a Hyper Spray particle. Very similar to the update function for the Lying Figure.FUN_4A5090
: Allocates a new Hyper Spray particle struct and sets initial values.Dividing float values by 2 that control speed in FUN_4A3EC0
and FUN_4A43F0
can fix the visual range in 60 FPS. However, because FUN_4A4A10
and FUN_4A5090
are called every frame, the effect will have up to 2x as many particles compared to 30 FPS.
The workaround I'm using is to add logic to the beginning of FUN_4A4A10
and FUN_4A5090
to skip allocating a new particle every other frame. The fix should not interfere with other effects since it is very specific to the Lying Figure and Hyper Spray.
(IMO, the Hyper Spray looks a bit nicer with twice as many particles :) but the spawn rate fix is good for accuracy.)
Here's a build so far with patches for both effects (1.0 only, branch). Made a quick fix for the spawn rate code when multiple spray effects are on screen, but this could still use more testing. d3d8.zip
@Murugo you're on fire!! Another great email to wake up to! 😄
Thank you so much for taking this initiative. A fully treated 60 fps mode is becoming more and more real each day... Gives me goosebumps... 😍
I'll try and test myself in the near future. I'm currently engulfed with hosting provider issues for the site that's demanding a lot of my free time. I'm eager to test but, in the meantime, if anyone else can help Murugo test that would be helpful. 👍
@Murugo Amazing! We're quickly narrowing down all of the important issues thanks to the help of you and all of the others that have contributed so far. 👍
@Polymega I don't remember if I shared the code for this before, but I believe the best solution for 60fps FMVs is to unlock the framerate while an FMV is playing. This unlocked framerate should theoretically allow you to use any combination of FMV. 60fps with 30fps FMVs. 30fps with 60fps FMVs. Or a mix of 30fps and 60fps FMVs. It shouldn't matter anymore.
Assembly:
0043DD90:
nop
nop
nop
nop
nop
Cheat Table: Save as .CT and open in Cheat Engine.
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="42">
<CheatEntries>
<CheatEntry>
<ID>0</ID>
<Description>"Unlocked Framerate (FMV)"</Description>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>[ENABLE]
"sh2pc.exe"+3DD90:
nop 5
[DISABLE]
"sh2pc.exe"+3DD90:
call 004F6CE0
</AssemblerScript>
</CheatEntry>
</CheatEntries>
<UserdefinedSymbols/>
</CheatTable>
The intensity/effectiveness of the motion blur is reduced by half.
Thank you to @AeroWidescreen for his original research on this way-back-when and confirmation on this very simple adjustment.
When played in 60 fps, change MotionBlurValue
from 0.25f
to 0.125f
.
This unlocked framerate should theoretically allow you to use any combination of FMV. 60fps with 30fps FMVs. 30fps with 60fps FMVs. Or a mix of 30fps and 60fps FMVs. It shouldn't matter anymore.
That's great! Thank you for this.
Enemies that hold you in place for attacks do twice as much damage. This is due to damage being accrued per frame. This can make the final boss unbeatable in certain situations.
- Enemies that hold you in place: Flesh Lips, Abstract Daddies, Final Boss (tentacle choke and moth attack [?]).
Maybe something in here? (Find out what accesses 01FB111C
while having an enemy attack hold you in place)
01F8FD20 byte
changes to a 1
whenever you're held in place by an enemy attack. It'll sometimes flicker to 1
when being attacked "normally", but doesn't happen often from what I could tell. This wouldn't be elegant, but perhaps a Hail Mary could be reducing damage input by half whenever this value is 1
if we can't find a more reliable way to detect "stun lock attacks?"
There is a chance that 005359E8
is only executed during a stun lock attack (setting a breakpoint might help confirm). This updates James' HP (01FB113C
) by subtracting enemy damage (01FB111C
) every frame, but only if damage occurs while player movement is paused during an enemy attack ([01FB8118] == 1
). If this is the case, then dividing enemy damage by 2 at this point might work:
inject: // 005359D5: D9 86 3C 01 00 00
jmp update
update:
fld dword ptr [esi+0x11C]
fmul dword ptr [] // Multiply damage by 0.5f
fld dword ptr [esi+0x13C]
fsub st,st(1)
fstp dword ptr [esi+0x13C]
mov edx,[esi+0x13C]
push edx
jmp sh2pc.exe+1359EE
Thanks so much, Murugo. We'll investigate 005359E8
soon. Hopefully that'll be the ticket and your work here will be good to go as-is!
Another question/favor: You've kind of taken on the lead role with 60 fps work, and we thank you dearly for this. I'd like to properly add your name/details to the project's credits. In other words, we'd love to have you and add you to the team roster. 😃
May I ask you to send me a message through this form so I can get more info from you?
then dividing enemy damage by 2 at this point might work:
When we implement this in the code, I think we should be using a formula for this type of thing rather than statically dividing by 2. For example we should use a formula like this:
divisor = X / 30 (where X is the currently set FPS)
I see that most Issues are fixed and implemented, The FMV at 60 FPS will be a piece of cake in comparison to all you've have done, Your work is awesome team, I'll be ready to test it intensively when it's ready to be tested.
May I ask you to send me a message through this form so I can get more info from you?
Will do, thanks!
When we implement this in the code, I think we should be using a formula for this type of thing rather than statically dividing by 2.
Yes I agree. I've also seen FUN_00447830
used in several places that acts as a delta time function, i.e. returns a float 1 / FPSLimit
, which could be used in place of the static factor.
Yes I agree. I've also seen
FUN_00447830
used in several places that acts as a delta time function
Perfect. 👍
@Murugo
@AeroWidescreen checked over 005359E8
and found this will be safe to use for our purposes in fixing damage-per-frame stun lock attacks. :blush:
A huge thanks to Bigmanjapan for his research on this. It led me in the right direction to find (what should hopefully be) the addresses to fix this.
The water drains twice as fast at the end of the RPT Apartment boss fight.
0089C1A4 float
tells the game how many steps/increments to lower the water in the Apartment Stairwell.
Default value is 10f
. Change to 20f
to fix speed at 60 fps.
The water rises twice as fast when the Alternate Hotel elevator door opens.
006BC1F4 float
tells the game how many steps/increments to rise the water in the Alternate Hotel Elevator.
Default value is 10.66666698f
. Change to 5.333333492f
to fix speed at 60 fps.
@AeroWidescreen
May I ask you to verify 0089C1A4
and 006BC1F4
are safe for us to use/adjust?
The animation process whenever James transcribes notes onto his map is twice as fast (too fast).
Some useful addresses for the map animation:
0094D934
: Current map animation state
0094D8DC
: Current active marker state
0094D8D4
: Pause frame counter (used by active marker states 1 and 4)FUN_0049E060
: State handler for the map animationFUN_0049C610
: State handler for the active markerThe following active marker states need to be patched to play the animation at the correct framerate:
0049C6A8
)0049C6FA
)0049C722
)There are also some 1-frame state transitions that could be extended to 2 frames while in 60 FPS to help match the original speed of the animation. For example, active marker state 2 moves directly to state 3 if the map is already zoomed in.
While testing the above, I found that the pause between each fade-in & fade-out transition is faster by roughly ~150 ms when playing in 60 FPS. This also affects fade transitions between rooms (comparison video). Maybe this has been noticed before?
I'm guessing most players will either not notice the difference or appreciate the speed improvement. Speedrunners might find that they can save a lot of frames going between rooms when playing at a higher framerate. This might give them an unfair advantage over anyone speedrunning the game at 30 FPS.
Thanks again, Murugo!
While testing the above, I found that the pause between each fade-in & fade-out transition is faster by roughly ~150 ms when playing in 60 FPS. [...] Maybe this has been noticed before?
While testing high framerate issues I've noticed a fair amount of minor discrepancies like this but, since we have to "hand fix" these issues one-by-one, I decided it was best to just list the worst offenders for us to work on. By "worst offenders" I mean issues that affect actual gameplay or are super-noticeable in the audio/visual department.
When the 60 fps feature goes live, I will quickly make mention in the update video that there are surely other minute high framerate issues but we won't be addressing them; we just wanted to fix the worst offenders.
However...... In regards to the fade-in/-out speeds between entering new rooms, I also noticed at 60 fps you can sometimes see Maria "spawn in" to the next room you enter. The fade-in is just quick enough to catch this if you know what you're looking for.
So, @Murugo, I leave this ball in your court: If you know of an easy way to keep fade-ins/-outs the same as with 30 fps and it's relatively easy to do, then by all means please share!
The flames in Angela's staircase move twice as fast. The water animates/moves twice as fast.
I believe I found the address to fix this. Check it out here.
To slow down the flames: Change
006BC194 float
from0.0333f
to0.0165f
.To slow down the animated lighting effects: Change
0070AE40 float
from0.0005555444513f
to0.00027777222565f
.
Hi all, so I've added this fix to my branch, the value is correctly overwritten but I can't manage to see the difference, here's the build: d3d8.zip
Oh and great work, @Murugo ! That is some advanced stuff. How did you find the map related values and functions, it's so hard to find a way to isolate those with something like cheat engine
@Murugo @AeroWidescreen checked over
005359E8
and found this will be safe to use for our purposes in fixing damage-per-frame stun lock attacks. 😊A huge thanks to Bigmanjapan for his research on this. It led me in the right direction to find (what should hopefully be) the addresses to fix this.
The water drains twice as fast at the end of the RPT Apartment boss fight.
0089C1A4 float
tells the game how many steps/increments to lower the water in the Apartment Stairwell. Default value is10f
. Change to20f
to fix speed at 60 fps.The water rises twice as fast when the Alternate Hotel elevator door opens.
006BC1F4 float
tells the game how many steps/increments to rise the water in the Alternate Hotel Elevator. Default value is10.66666698f
. Change to5.333333492f
to fix speed at 60 fps.@AeroWidescreen May I ask you to verify
0089C1A4
and006BC1F4
are safe for us to use/adjust?
Should I add these fixes to my branch?
Should I add these fixes to my branch?
If you wouldn't mind, that would be great! It might be good to merge Murugo's 60 fps branch into your branch at some point so it's all together.
So, @Murugo, I leave this ball in your court: If you know of an easy way to keep fade-ins/-outs the same as with 30 fps and it's relatively easy to do, then by all means please share!
Wait, could this be as easy as changing a value in FastTransitions
found in the line below?
Change from 0.5f
to either 0.25f
or 1f
?
This feature is part of the Widescreen Fixes Pack (WFP). I believe this project pulls in the WFP code as an external resource. (See here ) Knowing all that, does it make sense/is it plausible to change the value here when in 60 fps mode?
Wait, could this be as easy as changing a value in FastTransitions found in the line below?
Thanks for pointing this out! It looks like this feature speeds up the fade itself. The fade speed is actually the same between 30 FPS and 60 FPS - the discrepancy is in the number of frames in between while the screen is black. Setting 1.0f
appears to be too slow, unfortunately. There might be some value close to 0.5f
which can help offset the difference.
I'll start with patching map transcription animation first and see if I can come back to this a bit later.
Oh and great work, @Murugo ! That is some advanced stuff. How did you find the map related values and functions, it's so hard to find a way to isolate those with something like cheat engine
IIRC, I was able to find the alpha value of the current marker using Cheat Engine, then got lucky searching adjacent memory for anything that seemed related to the animation :)
Thank you @Murugo for your explanation! We can merge the branches anytime, and however you want. Here's a build with the water level speed fix, tested it on RPT apartment fight and seems to work, couldn't find the save for the elevator tho. d3d8.zip
Water level speed fixes and fire animated lights are good (at least for v1.0)! Will still need to confirm all these addresses are safe to use in the future.
The flashlight dies out twice as fast in the prison bug room.
I don't believe this is correctly fixed using the global flashlight on/off speed fix. See video below:
The lens flare timing looks correct, but the actual light is still dying out twice as fast. I believe to fix this we need to change 006C10A8 float
from 0.18666666597f
to 0.093333332985f
.
This appears to be a special address for instruction sh2pc.exe+10AA66 - fsub dword ptr [006C10A8]
. Although note that I have not tested to see if this address is used elsewhere in the game.
Are you looking for playtesters for 60FPS yet? I can test on Linux like I did for the mouse controls.
You can use this save folder to reference some of the framerate issues mentioned below. Go to
<path-to-game>\data\save\
and make a backup of yourFolder 01
folder within here. Then, completely replace yourFolder 01
folder with this new one.Important (noticeably affects audio, visuals, gameplay)
Data 57
,Data 58
,Data 59
,Data 60
to test. There are many water spots throughout the Labyrinth and Alternate Hotel areas.Data 61
to test.AudioClipDetection
can crash the game when playing in 60 fps.Data 62
,Data 63
,Data 64
,Data 65
to test.Data 66
,Data 67
to test. These are just two motion blur example spots.PS2CameraSpeed
moves twice as fast (too fast).Data 70
to test.Data 70
to test.Data 1
to test Flesh Lips. Load save fileData 2
to test Abstract Daddies. Load save fileData 3
to test Final Boss.Other
Data 68
to test.Data 69
to test.Data 57
to test. Defeat Pyramid Head to make water drain.Data 4
to test. Go in the elevator and go to the Basement (B) Floor.FMVs
<path-to-game>\sh2e\movie\
, make a backup oftoilet.bik
, then replace it with this test 60 fps version. You can easily test this FMV by starting a new game or by watching "James in the Restroom" through the game's "MOVIE" menu found on the title screen.To help visualize the to-do list a bit easier:
AudioClipDetection
can crash the game when playing in 60 fps.PS2CameraSpeed
moves twice as fast (too fast).