NFSAddons Forums

Mar 28, 2024, 11:45 AM

Using ghost files to customize a race [NFS4]

This is a discussion for the topic Using ghost files to customize a race [NFS4] on the board General NFS.

Author Topic: Using ghost files to customize a race [NFS4]  (Read 87086 times)

Reply #15
on: Oct 02, 2016, 9:08 AM
Sr. Member
Posts: 79 Joined: August 06, 2016

  • ***
  • Personal Text
    Retro racer excellence
Quote from: XJ220
Though I'm wondering now where all the hard-coded counterparts are stored, e.g. foldernames. Inside the game's exe?
Had a quick look inside the nfshs.exe and found the following:
0018F8B7 - AI names (Single player, Police officers and Carrer mode)
00192B80 - Traffic folder names
001C1AA0 - Vidwalls
There's probably more interesting stuff in there.

One thing to point out with 2 player mode, the game doesn't create a gst file. What you have to do is to copy a piece of data from config.dat into a gst file.
Thanks for testing out the number of laps. What I wonder now it how the game stores the "Top 10 Times" for a 3 lap race (if it can write to RECORDS.DAT).

Thanks for helping out Zalcus!

Reply #16
on: Oct 02, 2016, 11:44 AM
Sr. Member
Posts: 163 Joined: March 22, 2014

  • ****
          OK. I just figured out how to get the racers to show up correct on the starting line in a player cop vs. 8 opponent line up in Hot pursuit mode. I'll give you a step-by-step procedure.

         You will need the expansion pack 4.0 as this displays the pit menu options in the records tab of the race results screen. I have an updated version of the pit menu options that adds the ability to change the hot pursuit game modes from classic to getaway or time trap (see the attachment).

1. Launch NFS and start a single race with full-grid of opponents (NOTE: It has to be a SINGLE RACE or this
method will not work).

2. As soon as the announcer says GO! quit to race results and save the ghost file.

3.Go back to the Game Setup screen and click LOAD.

4.Load the Ghost you just saved.

5. As soon as the announcer says GO! quit to race results again.

6. From the race results screen, go to options --> Records --> Pit Options (Sometimes the game may crash which means you will have to start over. I know that's annoying).

7. You will see the option to switch from Single Player to Hot Pursuit, Knockout, or Tournament. Choose Hot
Pursuit (If you are using my Pit Options menu, make sure you set the Hot Pursuit mode to Classic as I have only
tested it with this).

8. Click Race Again.

9. As soon as the announcer says GO! quit, but this time quit to desktop.

10. Go to SaveData and find the ghost.gst file which recorded your last game played.

10. Use Dr. Speed's method to change your car into a cop car and make whatever changes you want to the other cars. Then move the .gst to the Saves folder inside of the SaveData folder. Don't forget to backup just in case!!!

11. Launch the game, Load the .gst you just edited and enjoy!

Hope this works for you. Here are some screens.


 

Reply #17
on: Oct 02, 2016, 1:52 PM
Sr. Member
Posts: 163 Joined: March 22, 2014

  • ****
Oops  :( I forgot to mention that when editing the ghost file you have to edit the number of tickets and ticket quota for the game mode to function correctly. So if you are taking down 7 perps, you have to set your ticket quota (line 000010A4 ) to 7 and the number of tickets (line 000010A8) to 1 since each perp gets arrested on their first catch (just like nfs3).

Also typo in the earlier post: it's supposed to be 7 perps and 1 player cop, not 8 perps and 1 player cop. Sorry about that.  :D

EDIT: The PitOptions.mnu files goes into Data/Menus of your NFS folder. As always, make a backup just to be safe.  ^-^
« Last Edit: Oct 02, 2016, 1:55 PM by Zalcus20 »

Reply #18
on: Oct 03, 2016, 4:27 AM
Hero Member
Posts: 423 Joined: May 21, 2006

  • *****
  • Personal Text
    Ramms+ein fan
This is quite fascinating. How did you figure out you have to quit the race twice? Sheer luck?

Reply #19
on: Oct 03, 2016, 7:10 AM
Sr. Member
Posts: 79 Joined: August 06, 2016

  • ***
  • Personal Text
    Retro racer excellence
@Zalcus20
That's a very creative way of fixing it. Thanks for sharing.

I've prepared a gst file with 16 cars activated. It's a Hot Pursuit race on Aquatica with 4 laps.
You're driving the Bonus Porsche against a La Niņa. The police team have 8 different police cars and the road is also populated with 6 traffic vehicles.

I do hope it'll work, but if it doesn't, you can always open the file and compare the data that you have.
Have fun!  :police:

Reply #20
on: Oct 03, 2016, 9:20 AM
Sr. Member
Posts: 163 Joined: March 22, 2014

  • ****
@XJ220: The reason why the race has to be quit a second time is so that NFS can save that race automatically as a .gst file. This makes it possible to edit the game by using DrSpeed's method.  ;)

@DrSpeed: Thanks for sharing your gst file but I'm using a customized list of cars via NFS MIXER. So I won't get the same cars that you have programmed (serial #49 in my list is not a cop car so the cop car in game will use whatever car #49 is i.e. Porsche Carrera GT). I'll still try it out though.  :D

     I've been playing around with this and I was able to activate all 16 cars, too. I was able to do 8 cops vs. 8 racers without traffic. It was pretty chaotic but way more fun that the default cop modes. At the end of the race I was shaking from the adrenaline. LOL  :D ;)


Reply #21
on: Oct 03, 2016, 10:52 AM
Sr. Member
Posts: 163 Joined: March 22, 2014

  • ****
UPDATE: I found the location of Transmission and Convertible Option switches in .gst file.

00001180 = Transmission
 0=Manual 1=Auto

00001184 = Convertible Option
0=Top up 1=Top down

Now I'm trying to see if it's possible to correct the "sinking in the ground" effect that happens when you change the player car using the Hex editor. 

Reply #22
on: Oct 03, 2016, 11:16 AM
Sr. Member
Posts: 79 Joined: August 06, 2016

  • ***
  • Personal Text
    Retro racer excellence
Great findings, I've added them in the first post.  8)

Reply #23
on: Oct 03, 2016, 2:54 PM
Sr. Member
Posts: 163 Joined: March 22, 2014

  • ****
OK. Good news and bad news.

Good news: I found the location that controls the player car's virtual size (shown by the shadow. see the attached screenshots) which can be used to fix the "sinking in the ground" problem.

000011B7-000011C3

The game reads it as a distance (in x,y,z) from the center of the car (measured in degrees?).

000011B8-000011BA = virtual size of car  from center horizontally or  x (How wide the virtual car is) 

000011BC-000011BE = virtual size of car from center vertically or y (this is what causes the "sinking in the ground" or "hovering above the ground" effects)

000011C0-000011C2 = virtual size of car from center lengthwise or z (How long the virtual car is)

NOTE: The values below are to be left untouched. They tell the game where the x values begin/end, where the y values begin/end and where the z values begin/end.  If you change these values, expect insane results in-game (and by insane I don't mean cool).

000011B7 = X (always set to hexadecimal 3F)

000011BB = Y (always set to hexadecimal 3F)

000011BF = Z (always set to hexadecimal 3F)

000011C3: Additionally this is always set to hexadecimal 40.

Bad news: if you change your car for another one (via hex editing the .gst file) and you find that it is sinking in the ground (or hovering above it) it will be very complicated to center that car on the road.  The only workaround I found so far is to copy the data of a player car from line 00001170 and lines 000011B7-000011C3 of another .gst file that contains the car you want to drive, and replace the same lines in the data of the .gst file you are using.  Additionally, you can copy the data from the AI racers in the same or another .gst file and replace your data. That work's fine, too.  Just remember to change line 0000117C (defines AI type) from 02 (AI racer) to 01 (Player racer)(or 09 if you are in Hot Pursuit and want to be the cop). The game WILL crash if this isn't done.

Just on a sidenote if you copy all the data from lines  00001170-000011C3 you will retain the transmission used, the convertible option, and the car's color. 

Hope this helps.  :) ;) :)

Reply #24
on: Oct 03, 2016, 3:06 PM
Sr. Member
Posts: 163 Joined: March 22, 2014

  • ****
Note how big the shadow is (I highlighted the shadow in green). This determines the actual size of the car in-game. If you were to crash the car into an object head-on you would notice the contact point would be a little after where the shadow starts but no where near the front bumper (where it is supposed to make contact).

Reply #25
on: Oct 03, 2016, 3:09 PM
Hero Member
Posts: 3,210 Joined: January 22, 2008

  • *****
  • Personal Text
    I keep trying so far... Hmm 😶‍🌫️ ☮️ 😎
Really, is that all it is, Budd, in the Exe?  :D  8) How do you edit the Exe open it up?.
I been busy pre-paring for Fall weather on my place. People are so,,nice to me, were I Live,, / u know.
Wished, thanks for Lmk this Zalcus
Edit: what shadows,? I want Stay above Ground... Kwim here.  ;)
« Last Edit: Oct 03, 2016, 3:12 PM by _WiLL_ »
Let's have a better day...?

Reply #26
on: Oct 03, 2016, 3:20 PM
Sr. Member
Posts: 163 Joined: March 22, 2014

  • ****
You can open the exe with a hex editing program. DrSpeed and myself use HxDen. That's the easy part. The hard part is finding where the data we want to find is stored as it is in coded language.

Be advised that these modifications here are made to the .gst file, not the exe. I did not touch the exe at all.  8)

Reply #27
on: Oct 03, 2016, 3:32 PM
Sr. Member
Posts: 163 Joined: March 22, 2014

  • ****
OK. I think I'll call it a day now. I'll do more experiments later.  ;)

Reply #28
on: Oct 04, 2016, 4:18 PM
Administrator Hero Member
Posts: 504 Joined: November 03, 2005

  • *****
I have to say this is pretty intriguing, much respect for figuring this all out (even if it sometimes goes a bit over my head - I couldn't hex edit if my life depended on it) Thanks for sharing all your findings. :)

Reply #29
on: Oct 04, 2016, 6:01 PM
Sr. Member
Posts: 163 Joined: March 22, 2014

  • ****
@Remko:       It's not as complicated as it appears, trust me.  ;)
             
                  I believe the thing about hex editing that intimidates people ( it intimidated me when I was first learning about hex editing) is the hexadecimal system which uses numbers and letters instead of just numbers.  Basic Hex editing is simply just taking a number in a file that represents a certain code and changing it to another number which represents another code. It's just done in another "language". Hexadecimal language.  :)

Google taught me everything I know about basic hex editing. If one can take the time to learn, it is quite simple to master.  =D

« Last Edit: Oct 04, 2016, 6:04 PM by Zalcus20 »

 


Support NFSAddons: