ikt Posted October 17, 2017 Share Posted October 17, 2017 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 More sharing options...
frakka Posted October 22, 2017 Share Posted October 22, 2017 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 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 More sharing options...
ikt Posted October 22, 2017 Author Share Posted October 22, 2017 (edited) 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 October 22, 2017 by ikt Link to comment Share on other sites More sharing options...
darkphoenixxx Posted October 24, 2017 Share Posted October 24, 2017 (edited) What is this interface with wheel thing (if its not a secret)? Edited October 24, 2017 by darkphoenixxx Link to comment Share on other sites More sharing options...
ikt Posted October 24, 2017 Author Share Posted October 24, 2017 What is this interface with wheel thing (if its not a secret)? https://www.gta5-mods.com/scripts/manual-transmission-ikt darkphoenixxx 1 Link to comment Share on other sites More sharing options...
darkphoenixxx Posted October 24, 2017 Share Posted October 24, 2017 (edited) Thanks! Edited October 24, 2017 by darkphoenixxx Link to comment Share on other sites More sharing options...
frakka Posted October 24, 2017 Share Posted October 24, 2017 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: 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: 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 More sharing options...
ikt Posted October 28, 2017 Author Share Posted October 28, 2017 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 More sharing options...
frakka Posted October 29, 2017 Share Posted October 29, 2017 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. 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 assignedI'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 ikt 1 Link to comment Share on other sites More sharing options...
ikt Posted October 29, 2017 Author Share Posted October 29, 2017 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. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now