Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

Figuring out if the vehicle's a truck


ikt
 Share

Recommended Posts

I've been trying to determine if a vehicle is a truck or not. A special thing about trucks is how their engines rev to max RPM and the truck still keeps accelerating. I've tried looking around in the handling and vehicles.meta, but I couldn't find anything that really pointed out that this behavior should happen.

 

Somebody pointed out that if you change the vehicle audio/engine sound of any other vehicle to a truck's sound, the same revving behavior happens: This can be tested with Menyoo. So it's probably related to sound. I have no idea where to start searching though. Can anybody help?

 

 

Link to comment
Share on other sites

If you have access to the memory map of the Vehicle instance - and I believe you do - then you can inspect the hash of the AI handling at the appropriate offset.

 

For the current version (1_0_1180_2) the offset and hashes are:

offset: 0x13C string          hash------------    ----------"AVERAGE"       0xBE32B83A"SPORTS_CAR"    0xA4A256CF"TRUCK"         0x428100C5"CRAP"          0x856B2468

Of course, for such a test to be useful it assumes that R* consistently assigned a TRUCK AIHandling to every truck, and not AVERAGE or CRAP.

I haven't checked for this :D

 

Btw I couldn't reproduce the behaviour you are talking about.

If you get the chance, indicate a procedure and vehicle that demonstrate this quirk.

Link to comment
Share on other sites

Well, here:

 

 

Note the Blista keeping RPM maxed out but still accelerating after that, especially in second gear. Also note how the Biff, when assigned the Blista's sound, also shifts up before the RPM is maxed out.

 

Thanks for that offset :) I'll need to do some testing to see if Menyoo changes this too, but I somewhat doubt it.

 

Update - Nope. The Packer has the Average AI handling assigned, while the Sandking SWB has Truck assigned to it. It is accurate for vehicles like the Benson or Biff, but not sure enough. Also Menyoo doesn't change the handling. Does sound have a similar hash thing?

 

I could also just decide that the vehicle is a truck after determining its real shiftpoint is beyond the first gear's range, but I'm afraid that would also give false positives, and needs some user interaction.

Edited by ikt
Link to comment
Share on other sites

darkphoenixxx

What is this interface with wheel thing (if its not a secret)?

Edited by darkphoenixxx
Link to comment
Share on other sites

Thank you for this instructive video.

But now I'm even more confused :)

 

 

Note the Blista keeping RPM maxed out but still accelerating after that

From what I've seen to this day, RPM saturating at 1.0 before the shift is VERY common on low gears, if the vehicle has a decent driveforce.

As an example look at this 18 seconds run of a stock Z-Type:

 

1508868724.png

 

Straight line, no steering, standing start, perfectly flat terrain (stunt race track)

Blue line is speed, measured in m/s on Y axis. Red line is RPM * 20.0

Now look at the first 3 seconds:

 

1508868803.png

 

RPM gets maxed at 1.25s and stays so until 1.8s, while the car still acquires speed

Then RPM drops down to 0.85, reached at 2.0s, this is when upshift starts.

 

I think that you overestimate the importance of RPM in upshifting. From what I've seen, in the automatic gearbox upshifting is determined mostly - if not completely - by speed.

I believe that the RPM signal is simply cosmetic, derived from the speed through some digital filtering. Look at the spikes in RPM around the instants of upshifts: typical.

At least, they show that RPM is more likely to be derived from speed than the other way around.

Only a hunch, of course, but I'll try to post another evidence - a stronger one.

 

I agree that having the physics changed just by changing a sound is surprising. But it goes along with the unknowns inherent with using Menyoo :/

Does the Blista keeps its own FinalDriveMaxFlatVel (InitialDriveMaxFlatVel * 1.2) or does it inherit the Biff's FinalDriveMaxFlatVel?

Can you agree with me that the two possibilities would impact shift points quite a bit?

Link to comment
Share on other sites

The cars seem to keep their own top speeds, it's just that the gear behavior changes.

Also in your graph you can see the acceleration becoming less over a gear's RPM range, which is rather odd. The first gear just doesn't behave like a gear. As for the RPM spike around upshifting, it seems like Rockstar tried to make it appear like a manual shift somewhat. If you override this behavior by implementing an own shifting thing, it's much smoother.

 

I don't think RPM is (purely) derived from speed. Vehicles can downshift if you get on the gas early, or shift up sooner if throttle is lifted, and you can often spot the vehicle shifting down to a low gear when braking.

 

The vehicle class has some values you can use to determine top speeds per gear, or where the RPM should be max. This info is at the vehicle class +0x818 (on 1180), starting at gear 0 (reverse) and going up to gear 7. In trucks, the audio and acceleration just seem to ignore this RPM and related speed value. So yeah, stuff's weird.

 

Also I didn't realize there was just a native for setting vehicle audio: AUDIO::_SET_VEHICLE_AUDIO, so it might be worthwhile to make a simple audio switcher.

Link to comment
Share on other sites

Also in your graph you can see the acceleration becoming less over a gear's RPM range, which is rather odd.

I disagree, this is realistic. Real world cars have this speed profile. There's a natural trade-off between rotational speed and torque.

It's actually something that R* did well, imho.

 

 

I don't think RPM is (purely) derived from speed. Vehicles can downshift if you get on the gas early, or shift up sooner if throttle is lifted, and you can often spot the vehicle shifting down to a low gear when braking.

Here is an 8 seconds excerpt from a run in a stock Turismo on the freeway, downtown LS. At this point RPM is around 0.9 and the car is on its highest gear.

As you know, there are many bumps, manholes and metal grilles on these freeways, in comparison to highways or Route68.

 

1509282069.png

 

Red line is RPM * 50

First thing to notice is how similar the curves are.

Around t=5s the Turismo runs over a manhole, which gives it a speed boost. It's a well known "feature" in GTA physics. You can hear its effect on the wheels / tyres / suspension when it occurs...

 

My point here is that this kick comes from the terrain. As such, it should NOT be visible in RPM.

This is what makes me believe that RPM is derived from speed.

 

 

The Packer has the Average AI handling assigned

I've made a quick function based on the info from my first post, and I detect its AI handling as TRUCK.

 

 

The vehicle class has some values you can use to determine top speeds per gear, or where the RPM should be max. This info is at the vehicle class +0x818 (on 1180), starting at gear 0 (reverse) and going up to gear 7.

Yes I know these, they are the closest to what can define shift points in GTA's automatic gearbox :)
Link to comment
Share on other sites

 

Also in your graph you can see the acceleration becoming less over a gear's RPM range, which is rather odd.

I disagree, this is realistic. Real world cars have this speed profile. There's a natural trade-off between rotational speed and torque.

It's actually something that R* did well, imho.

 

Whoops, I worded that wrongly. It's odd that the first gear acceleration curve doesn't follow the pattern of the rest of the gears.

 

 

 

I don't think RPM is (purely) derived from speed. Vehicles can downshift if you get on the gas early, or shift up sooner if throttle is lifted, and you can often spot the vehicle shifting down to a low gear when braking.

Here is an 8 seconds excerpt from a run in a stock Turismo on the freeway, downtown LS. At this point RPM is around 0.9 and the car is on its highest gear.

As you know, there are many bumps, manholes and metal grilles on these freeways, in comparison to highways or Route68.

 

1509282069.png

 

Red line is RPM * 50

First thing to notice is how similar the curves are.

Around t=5s the Turismo runs over a manhole, which gives it a speed boost. It's a well known "feature" in GTA physics. You can hear its effect on the wheels / tyres / suspension when it occurs...

 

My point here is that this kick comes from the terrain. As such, it should NOT be visible in RPM.

This is what makes me believe that RPM is derived from speed.

 

Yes, RPM should be extremely tightly coupled to speed. I don't know why I phrased it like that previously. The shift points are still very dependent on throttle input, but aside from trucks and the final gear, the vehicle stays in the expected speed-for-RPM-range pretty well. Just trucks in the first two gears bug me.

 

 

 

The Packer has the Average AI handling assigned

I've made a quick function based on the info from my first post, and I detect its AI handling as TRUCK.

 

 

The vehicle class has some values you can use to determine top speeds per gear, or where the RPM should be max. This info is at the vehicle class +0x818 (on 1180), starting at gear 0 (reverse) and going up to gear 7.

Yes I know these, they are the closest to what can define shift points in GTA's automatic gearbox :)

 

Could be a handling mod, I'm not sure which mod exactly replaced vehicles.meta.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.