PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.73k stars 1.62k forks source link

[BUG]: Jak X afterburner detaches from vehicle during sharp turns #10936

Closed TheTechnician27 closed 4 months ago

TheTechnician27 commented 7 months ago

Describe the Bug

During Jak X, you can drift around corners. If you drift tightly enough, the afterburner effect on the back of the car starts teleporting off to the side of the vehicle. Ref actually fixed a regression not too long ago that made this bug worse, but it is still present, and I do not ever recall it happening on original hardware. Console log showed nothing, and it is not a GS issue. GS dump and screenshot below anyway just so there's something to see.

The afterburner will teleport to the side you're drifting against. For example, if you're making a sharp left turn, the afterburner will teleport to the left side of the vehicle, and vice versa. In terms of angle, the afterburner remains parallel with the vehicle (I could be misremembering, but I think the issue ref fixed actually did affect the angle). Although in the image below, the afterburner is only horizontally offset from the exhaust, it can become depth-offset as well (although I think it only ever teleports backwards, not forwards, in terms of depth). The depth and horizontal offsets can happen simultaneously, so it can move to the side and backwards, for instance, although it seems like these two are in contention with each other (i.e. a lot of horizontal offset seems to mean less depth offset).

The issue is present on vehicles other than the Road Blade (the one pictured).

Reproduction Steps

Go into a race and then drift (hold circle while turning) around a tight corner. This will show up in the first race of the game, Spargus City, plenty of times. The afterburner effect should sporadically teleport away from the vehicle.

Expected Behavior

The afterburner effect should stay attached to the vehicle's exhaust pipes.

PCSX2 Revision

v1.7.5584

Operating System

Linux (64bit) - Specify distro below

If Linux - Specify Distro

Manjaro – Flatpak

CPU

Ryzen 7 5800X

GPU

GTX 1070

GS Settings

Default

Emulation Settings

Default

GS Window Screenshots

Jak X - Combat Racing_SCUS-97429_20240316084925

Jak X - Combat Racing_SCUS-97429_20240316084924

Logs & Dumps

Jak X - Combat Racing_SCUS-97429_20240316084924.zip

TheTechnician27 commented 7 months ago

Update: Disabling Instant VU1 seems to fix or at least mostly fix this issue. I'd have to do more testing to be sure.

refractionpcsx2 commented 7 months ago

I thought there was already an issue for this, cos I've gone over this with somebody before....

refractionpcsx2 commented 7 months ago

Yeah I found it, it was you lol, so we disabled the instant dma hack which was seemingly making it worse, then instant vu off was fixing it completely, but I think. I think I got distracted with the whole memcard thing, I'm not sure if we should turn it off for this game or not, not sure on the performance impact.

Jak 3 was suffering the same problem.

TheTechnician27 commented 7 months ago

Yeah I found it, it was you lol, so we disabled the instant dma hack which was seemingly making it worse, then instant vu off was fixing it completely, but I think. I think I got distracted with the whole memcard thing, I'm not sure if we should turn it off for this game or not, not sure on the performance impact.

Jak 3 was suffering the same problem.

It was indeed me. I've been testing Instant VU1 off for visual issues but haven't found anything. I'm absolutely willing to test it for performance, however, to see what I can turn up. I know from having a Ryzen 1700 not too long ago that Jak X isn't the lightest game (although I will say it ran at 60 FPS there following some optimizations), so the last thing I want to do is lock people out from one of my favorite games by making it too slow. I'll test a few tracks and get back to you with numbers (I'm not on Windows, so this profiling will be more or less eyeballing the OSD).

TheTechnician27 commented 7 months ago

My eyeballed results were effectively as follows:

On Native resolution, the typical range for the percentages appeared to be around 180 to 225 with IVU1 off, and around 200 to 250 with IVU1 on. Frame dips seemed relatively rare, but they were present and seemingly of the same or similar magnitude both when IVU1 was on and off.

8x resolution was a similar story, where the game normally hovers around 180 with IVU1 on and around 160 with IVU1 off. I would say in general, you're losing around 12 FPS by turning IVU1 off. While I don't have my old Ryzen 1700 in a PC to test (~1933 STR), I believe this would be cutting it close in terms of keeping full speed.

Weighing against that, however, is how often this glitch occurs. This is just a very rough estimate: as a test, I raced on the first course of the game, Spargus: 2 laps for a final time of 3:30. With normal, expected gameplay and without trying to replicate the glitch, it occurred 23 separate times, for a total of once every approximately 9 seconds. I would say on average these lasted around 1 second apiece, because sometimes the glitch happens as a sort of "stutter" while other times it happens through the duration of a turn. This may happen less during less optimal gameplay because 1) you have less boost earlier in the game and 2) boosting through some of these turns is difficult.

I also tested the Dethdrome track, which has fewer sharp turns (more chances to boost continuously, but fewer turns where the afterburner is guaranteed to teleport horizontally), and I did an event which lasts exactly 3 minutes. I counted either 20 or 21 of these, so again about once every 9 seconds. Here, because the turns aren't very sharp, most of these instances involved the afterburner going far back behind the car, and while these were usually "stutters", several lasted a second or two, and at one point it happened continuously for 6 seconds. Making the (I think reasonable) assumption that these average 1 second apiece (split across basically two modes), it seems like, on average, I can expect to experience this glitch about 10% of the time while racing.

I tried one more lap on Dethdrome again to make sure this wasn't a fluke, and in fact, I did get different results, but not in the way I expected: during that 2-minute lap, the glitch happened easily more than 50% of the time (the afterburner was considerably behind the car), wherein multiple times the afterburner came detached for more than 5 seconds continuously. I think these figures could easily be halved with someone on a new game who isn't very used to boosting around turns or runs out of boost often, but it's still very frequent and quite prominent when it happens because of the boost's color, size, position relative to the center, importance to gameplay, and the speed with which it basically "snaps" into the glitched position.

I would be in favor of turning IVU1 off via the GameDB because it removes a highly distracting visual bug that could easily be seen 1000+ times during a normal playthrough, but there is a tradeoff to be considered.