NFSAddons Forums

Main Menu

[NFS3] Restoring unused Pursuit Diablo for AI

Started by rata_536, Mar 13, 2024, 8:33 PM

rata_536

So it's old news that the game has a little silly folder inside CARMODEL/TRAFFIC/PURSUIT/ path, that contains a copy of the Pursuit Diablo SV for AI to use.


Older news is that this car is never used, unlike the original PSX version. Damn PC devs, they took that away from us! But why would they want to do that? Well, maybe they didn't. The answer is very obvious when we look at the game's exe:


Okay I'm kidding, nothing could be easily seen there. That's why we're using Cheat Engine to see a disassembly of the code in real time:


This can be explained easily. Here we can see the IDs of the police interceptors, 504 for the Corvette and 505 for the Diablo SV. So if both are there, why does the Diablo never show up?
Well, the answer is there. What we see there is the game looking for MadLand cheat code, and if it is enabled, then use the Diablo. That's what the op TEST DL,20 does, and if it is false, then it continues normally using the previously selected Corvette, as the op JE nfs3.exe+73900 indicates. But the one silly mistake is that the RAM adress where it's looking for it is 0055EB2E, but the cheat codes are in another castle! -Err, I mean, address:


This is great news, so this means that fixing the issue is as simple as looking to the right place!


How can you apply this permanently then? It's very simple, you just need a hex editor and replace the bytes. If you don't have a hex editor, don't worry cos you most probably have one already! VIVWizard has hex editing capabilities, even though it doesn't have usability features. Simply import the exe into a blank .VIV and switch to Hex mode (there's a button on the toolbar). There, you have to go to the address offset 0x072CA0, which is where I'm showing these pics.
Whatever hex editing tool you use, just make sure you're only overwriting these bytes, rather than adding them. VIVWizard doesn't need this caution cos it cannot add. Save the file (export if you're editing it with VIVWizard).


And that's it! The Diablo SV for the AI police is successful! Enjoy!


Well, that's a bit of a bitter ending, huh? You didn't need cheats on PSX to have the Diablo chasing you, you just had to play on hard. Well don't worry, there's an extra step we can make to easen that. We just need to search for difficulty instead! This is easily done by changing -again- the RAM address where we're looking, the method we're using to check, and what we're looking for.


So now, if we set the opponent's difficulty to Hard, the Diablo will be used. If we play on Normal, we keep the Corvette. How to implement it in the exe then?


Again, save and now you can enjoy the harder pursuits!

DrSpeed

Thanks, this works like a charm!
Out of curiosity, would it be possible to change the pointer for the Empire City cop car, without affecting the Hometown one?

rata_536

#2
Quote from: DrSpeed on Mar 23, 2024,  2:31 AM
Thanks, this works like a charm!
Out of curiosity, would it be possible to change the pointer for the Empire City cop car, without affecting the Hometown one?

Yes, but it's a lil bit more complex because of how they initially set it up. The game first checks for Redrock/Canyons, if true sets the Talon. If false, checks for Atlantia/Aquatica, if true sets the Falcon. If false it checks for Rocky/Summit, if true sets the Discovery. Then there's no more checks, so it simply sets the Crownvic as general use, that means Hometown/Woods, Empire City, and the buggy and inaccessible track 09.

So the way to make the distinction between Empire City and Hometown/Woods is to replace the SN assignment (that part is right after the interceptor) with a jump to an area with more space, and do the final check for track 8 which would be Empire City (or any past 08 for what matters, even), assign the Talon if true, and assign the Caprice if false. Also this will require a new serial number to fit the additional local cop, which by default it will be called CVIC (when I say Talon for Empire City I don't mean the Talon that is on vanilla Redrock, that would be SN 501 and we want another SN that we can use separatedly). I've done that in my test build already (well and much more actually), but the reason why I didn't make a tutorial for it is because the end result (code-wise) is way less elegant, so until I set it up with a nicer way to do it, I'll keep it on hold.

DrSpeed

Oh wow, yes that is very complex indeed. I guess using Cheat Engine is the easier choice for now.