hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.05k stars 2.15k forks source link

Grand Theft Auto: Vice City Stories "White Lies" mission bug #13200

Open ghost opened 4 years ago

ghost commented 4 years ago

There is a game-breaking bug in the mission "White Lies" where you use a Bovver'64 to collect drugs that Lance drops in the ocean of Vice City... The mission is completely broken because the Bovver'64 gets stuck to the ground unless you use explosives which makes it unstuck but the Bovver'64 would explode causing the mission to fail... You can unstuck it by punching it and pushing it to the sea but at that time the drugs are already lost and the mission will fail...

jcchikikomori commented 4 years ago

Have you've tried this on the real PSP? You can provide comparisons of it

crazyrexz commented 4 years ago

maybe anyone who facing this too kindly report in here, im pausing this game after mission racing with atv, so cant tell you the issue

ghost commented 4 years ago

In the normal PSP, it doesn't get stuck.... So this is a bug...

Domiiniik commented 4 years ago

Can confirm the problem and i finished the game on both PSP and PPSSPP, only happens on the emulator.

crazyrexz commented 4 years ago

thanks for feedback guys

hrydgard commented 4 years ago

Sounds like a CPU emulation math bug, or possibly a timing issue. Tricky.

NABN00B commented 4 years ago

You can "fix" it by reversing and turning at the same time for a few seconds. Definitely annoying, but it doesn't "lose time" to do so because the mission is an "autoscroller".

EDIT: Another known "fix" is to pause and unpause the game (not the emulation) while holding X.

sum2012 commented 3 years ago

Can anyone try this build (Need Windows 64 bit) ? https://drive.google.com/file/d/1O7EoOxVH5L_kCVLgsqvm3KiFu22dZIFh/view?usp=sharing This apply special angle and double precision

NABN00B commented 3 years ago

Can anyone try this build (Need Windows 64 bit) ? https://drive.google.com/file/d/1O7EoOxVH5L_kCVLgsqvm3KiFu22dZIFh/view?usp=sharing This apply special angle and double precision

Issue persists.

sum2012 commented 3 years ago

Can you share near game save ?

在 2020年12月7日週一 上午4:54,Tamás notifications@github.com 寫道:

Can anyone try this build (Need Windows 64 bit) ?

https://drive.google.com/file/d/1O7EoOxVH5L_kCVLgsqvm3KiFu22dZIFh/view?usp=sharing This apply special angle and double precision

Issue persists.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hrydgard/ppsspp/issues/13200#issuecomment-739562295, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQTT7FEXOJE4DY77WGRGTDSTPVR7ANCNFSM4PHNKN7A .

ghost commented 3 years ago

Wait, not only it happens in missions, it happens everytime...

NABN00B commented 3 years ago

Can you share near game save ? 在 2020年12月7日週一 上午4:54,Tamás notifications@github.com 寫道: Can anyone try this build (Need Windows 64 bit) ? https://drive.google.com/file/d/1O7EoOxVH5L_kCVLgsqvm3KiFu22dZIFh/view?usp=sharing This apply special angle and double precision Issue persists. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#13200 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQTT7FEXOJE4DY77WGRGTDSTPVR7ANCNFSM4PHNKN7A .

Sure. Check save 30 from this pack. https://drive.google.com/file/d/1YQsFXqm2MNKJ1M1yutaPRMjL1TGkuIGl/view

alvinyeboah commented 3 years ago

You can "fix" it by reversing and turning at the same time for a few seconds. Definitely annoying, but it doesn't "lose time" to do so because the mission is an "autoscroller".

EDIT: Another known "fix" is to pause and unpause the game (not the emulation) while holding X.

Yess!!! The Pause X thing works on the emulator too

Back2Life888 commented 3 years ago

I do can confirm that it also happens outside of missions. Hrydgard, change the title from "White Lies" mission bug to Bovver' 64 bug

unknownbrackets commented 3 years ago

Does it work in some older version of PPSSPP or in JPCSP? Or has it always been broken?

-[Unknown]

Back2Life888 commented 3 years ago

Does it work in some older version of PPSSPP or in JPCSP? Or has it always been broken?

-[Unknown]

Always has been.

points gun at Unknown

ghost commented 3 years ago

If someone will give me a save file I could see how it works in JPCSP. Need some directions too though.

NABN00B commented 3 years ago

If someone will give me a save file I could see how it works in JPCSP. Need some directions too though.

https://github.com/hrydgard/ppsspp/issues/13200#issuecomment-740035692 Just go to the 'L' icon.

Domiiniik commented 8 months ago

Bug still occurs aa of the latest dev release, really annoying

Domiiniik commented 5 months ago

Wish someone could look into it 😕

Parik27 commented 1 month ago

I looked into this issue. Some brief background information. The game in order to prevent stationary vehicles from moving randomly, if the vehicle's move speed is below 0.005 in a frame and the vehicle is not being accelerated or reversed (referred to as the gas pedal variable), the game will set the vehicle's move speed to 0.

Now, for planes (hovercraft is a plane internally), in VCS, this gas pedal variable is always 0. It isn't set. So the game only checks if the velocity of the vehicle is below 0.005 (in all of the 3 coordinates). However, unfortunately the hovercraft doesn't quite reach 0.005 on PPSSPP. It goes up to 0.0045 when moving forward on land. The calculation of what move speed the vehicle will have each frame is dependent on the time step variable. Therefore, with a lower FPS, this issue won't be present as the time step is higher and you pass that 0.005 threshold. Similar thing probably also happens when you pause/unpause.

Now, this is a bug with the game itself. It doesn't happen as often on a PSP because of the higher time step there, but in perfect conditions, it's possible to reproduce this bug there as well.

NABN00B commented 1 month ago

Here is how I reproduce the bug on real PSP with the hovercraft: Go to the airport and find a spot with consistent max framerate (I used CheatDevice Remastered plugin for measurements). Switch to first person camera -- this camera prevents most of the laggy dust particles that the hovercraft creates from appearing on the screen. Bring your hovercraft to a complete stop. Now when you hold X, depending on your location, it will either take several seconds before you start accelerating or you won't be able to accelerate at all.

I mentioned it previously but it's good to reiterate that this bug also affects the Biplane vehicle.

hrydgard commented 1 month ago

Quite interesting! So if you can monitor the speed with cheatdevice, you know where the variable is in memory - can we do a little cheat code or function replacement to change the 0.005 threshold to a smaller value?

Parik27 commented 1 month ago

Quite interesting! So if you can monitor the speed with cheatdevice, you know where the variable is in memory - can we do a little cheat code or function replacement to change the 0.005 threshold to a smaller value?

Yeah it's possible to change the threshold to a smaller value, it's two instructions at 0883c6b8 and 0883c6bc (on ULES00502),

lui a1, 0x3ba3
ori a1, a1, 0xd70a

A proper fix would be to set the gas pedal variable properly. The proper value is stored in another variable in the vehicle struct at offset 0x78c and the gas pedal is at 0x25c.

So we can assemble opcodes at 0x089da48c: (again, these addresses are for ULES00502)

lwc1 f12, 0x78c(s0)

and at 0x089da494 to also fix this issue.

swc1 f12, 0x25c(s0)
hrydgard commented 1 month ago

That's good stuff!

I'll try to come up with a clean enough way to patch this. Alternatively, I suppose we could detect particles, calculate the amount of pixels they'd fill on the real hardware and slow down the game accordingly, but in this case I think fixing the game itself is motivated.

hrydgard commented 1 month ago

Does anyone still have the savefile pack? It seems to be gone from google drive.

NABN00B commented 1 month ago

Does anyone still have the savefile pack? It seems to be gone from google drive.

https://drive.google.com/file/d/1zx5luiJtR4CXY_QvXGK7bDxM0ubRAvaZ/view

NABN00B commented 1 month ago

I'll try to come up with a clean enough way to patch this. Alternatively, I suppose we could detect particles, calculate the amount of pixels they'd fill on the real hardware and slow down the game accordingly, but in this case I think fixing the game itself is motivated.

Are you planning to implement the fix in a way that it can be disabled in compat.ini?

hrydgard commented 1 month ago

I haven't decided what I'll do yet exactly. See #19379 for some related discussion, but any such patches will need to be optional, yes.