PCSX2 version:
PCSX2 1.5.0-dev3032
How to reproduce the issue:
Start a new career in Stuntman, finish the first three levels, then attempt to finish the fourth level.
Last known version to work:
While the game is marked playable, there is no evidence that the game was ever checked that it was able to be completed. The game is pretty resource-intensive, and it is more likely that the first level was tested at most by most testers.
Attached is a picture of the lead car failing to make a turn on the "Chop/Zero" setting.

I attempted to try this PR and while the AI gets even further on interpreter, he still fails a turn later.

Try to set also VU clamping/rounding. This game use both FPU, and VU to calculate physics there.
Problematic calculations results are from in game functions dyForwardDynamics, and dyStepRunge1 to dyStepRunge5 (0x211E60 to 0x2127AC for US release).
This also happens in Driv3r (and probably Driver: Parallel Lines).
Could be the same issue since all of them were made by Reflections.
I know it probably isn't fixed, but can this be tested on a recent master to see if it's any better?
Yes, issue is still present on latest master.
Edit:
I made few tests, and looks like game don't like hardcoded DIV/SQRT/RSQRT nearest rounding on FPU. Although removing it help only little bit, you still can't finish level that way. That's for recompiler, interpreter seems to be broken even more on that game.
Here are settings, and explanation where you can get with them.
FPU / VU (All test done with removed hardcoded FPU nearest hack)
Negative / Zero
Best result, car crash at the wall in the end.


Nearest / Zero
Result like on Souzooka picture.
Positive / Zero
Crash earlier, car goes too much on right side.
Negative / Positive or Nearest
Close to first picture, but crash to wall at left little bit earlier than on VU Zero. There is no way to test properly VU negative rounding because that mess VU1, and picture. But setting it for moment make car path worse when we set it back. Tried also negative div hack, seems to have no effect. So that suggest sqrt/rsqrt nearest rounding make it bad.
Edit2:
Looks like i missed that pcsx2 use different file for doubles, and didn't removed hack there previously.
So results stay as above, but now we can get to "best result" even on Zero/Zero rounding. Still no way to finish stage.
I did some more testing with the PAL version of this game and compared the behavior of the AI car to an actual PS2.
I used a later level (Woopin and a hollerin) and by setting the EE rounding to nearest I get the AI to behave closest to actual PS2 AI. EE rounding to zero, positive or negative make the AI drift further sooner from the game on PS2. For all other settings (VU rounding and EE/VU clipping) I could not see the effect on the AI car.
Tested with v1.7.0-dev-546-g64010cf79 (latest GIT build).
Game plays nicer on PCSX2 than on my PS2+TV, I think because of the better analog sticks of the Xbox360 pad combined with less input lag.
areinap, if you can send me a save of your game to the Woopin and a hollerin mission as well as a savestate before the car get stuck I would appreciate it, thanks.
Stuntman_debug.zip
I have uploaded a memory card with the 100% completed career from my PS2.
I have only completed the PAL version and the debugging was also done with the PAL version.
You can try the Woopin mission (nr.2 corkscrew) by loading the game "Arie" from the main menu and then go into the filmography in the career menu. For your convenience, I attached a save state of doing just exactly that. The save state is at the beginning of the mission, the cars path is affected right from the start. By changing the EE FPU settings you must restart to see the full effect (the path of the cars drifts earlier / later).
Thanks a lot for uploading booth the memorycard and save state, I will look into the game.
I can make the car almost right with 4 settings, EE Rounding to negative - EE Clamping to none - VU Rounding to nearest and VU clamping to none. It will however stops in the middle of a straight road.
No setting the EE rounding to negative makes the car go further in the level, but its behavior is much different compared to the path it takes on the actual PS2. In the level you are testing, the car on the PS2 goes between the van and the car after the right hand corner. With EE rounding to negative it makes the car go left of both.
I am pretty sure it is related to the FPU rounding of the recompiled EE code. The VU rounding might also contribute a bit, but from trying the settings I could not see the effect. Would it make sense to make some homebrew code to exercise the DIV/SQRT/RSQRT instructions and compare the outcome of the actual PS2 HW versus the recompiled code?
@arienap Did you try my FPU rounding PR when I had it open? DIV/SQRT/RSQRT are forced to "nearest" rounding by default in PCSX2, that PR removed that so you could change the rounding for the EE and it would actually affect it.
You mean this PR: https://github.com/PCSX2/pcsx2/pull/3816 ?
I have not set up the toolchain to build PCSX2 myself, so I was using the available dev builds from master (PCSX2 v1.7.0-dev-546-g64010cf79 in this case).
I still see significantly different behavior when changing EE settings, so I guess there must be more to it than just the DIV/SQRT/RSQRT instructions. I am happy to do more testing, but I need some time, so I can figure out how to build PCSX2 myself.
Each PR has its own builds at the bottom, however when it gets closed they get removed so of course they're gone now.
I guess, i can make you a build temporarily.
pcsx2-noforceround.zip
Here, try this, you should be able to adjust the EE rounding modes with this and have more impact. Chop/Zero will actually be Chop/Zero for those commands now, so be sure to try that too.
Edit: Also be sure to try all rounding modes with Full clamping as well, as full clamping actually changes the FPU to use doubles which is completely separate code for handling FPU.
I tested the build, thanks for providing this.
I tested with multiple levels (stunt drivers, ice river drive in Switzerland).
The AI drivers are driven by the game in open loop, giving throttle and steering inputs.
The EE rounding mode messes with the physics which in turn mess up the AI drivers path.
It is a little bit misleading to judge the correctness of the emulation by the progress of the AI driver, as the AI driver has very little margin. In some cases the even more inaccurate emulation allows for the AI driver to progress further. Especially in the Switzerland level, the most accurate mode lets the AI get stuck the earliest.
I tried many different settings for the EE clamping / VU rounding / VU clamping modes, but I could only really detect changes with the EE rounding mode.
All four EE rounding modes behave differently, but by comparing them to the actual PS2 I would rate them the following (accurate to least accurate):
The EE rounding positive gives more errors than just the AI driver, you feel more grip (I can achieve faster lap times in the speed tests with EE rounding to positive) and the sound gets messed up.
Okay well the rounding that is forced is forced to nearest, so I guess we're already doing the best we can. Apparently the AI on the PS2 isn't spectacular anyway, but I assume it doesn't get stuck
Actually VU clamping to none improves the ia somewhat too, but it get stuck one turn on the another still.
OK I moved to the NTSC version for some more testing. The NTSC version seems affected more by the emulator compared to the PAL version. This may be due to the physics running at a higher frequency (60Hz vs 50Hz). The first chase in the "Live twice for tomorrow" seems perfect for testing as the AI does not slide around as much, so it can drive for much longer without crashing. I do see an improvement by using the EE clamping mode "Full" compared to normal, so this setting is affecting the physics code albeit much less compared to the round mode. I will do an extensive test with all combination of settings later and provide the data.