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!

Car Physics Constants


op9080
 Share

Recommended Posts

A list of constants I found that are used in the game's car physics.

 

General explanation:Constant: the type and address of the constantUnit: its units if any.Value: its value.Code used: the code place where it's used for the described purpose.Shared: whether this constant is shared by unrelated parts of the code.If a constant is shared it means that if you change it, you may getside effects in aspects of the game completely unrelated to the usediscussed.Non-shared constants are the best and are safe to change.  With sharedconstants, some testing is needed to see if the side effects aretolerable.  If not, an alternative is to modify the code at the placementioned to pick the value up from a different location.Some of the constants are only used during the loading stages(mostly the loading of handling.cfg).  This means you have to modifythem either by patching the exe file, or a loader that acts in theearly stages of the game.  If you modify them later, they'll have noeffect.  This is noted where applicable.All addresses refer to the US exe version 1.0.=====Constant: const double @ 0x86A950Unit: N/AValue: 0.4Code used: 0x5BE2B2Shared: noUsed only when loading handling.cfg.Multiplies fEngineAcceleration during the loading of handling.cfg.Change will affect the acceleration of all cars.=====Constant: const float @ 0x858EE8Unit: N/AValue: 0.4Code used: 0x6D078EShared: yesSide effect noticed: after making a big increase in it, I got a message about my respect going up.Multiples the acceleration during the calculation of car dynamics.Change will affect the acceleration of all cars.=====Constant: const float @ 0x8D3484Unit: N/AValue: 2Code Used: 0x6D0773Shared: noMultiplies the acceleration when the car is burning nitro.  Used duringthe calculation of car dynamics.  Change will affect the nitroperformance of all cars.=====Constant: const float @ 0x8D3480Unit: N/AValue: 1.2Code Used: 0x6D0760Shared: noMultiplies the acceleration when the "perfect handling" cheat is on.Used during the calculation of car dynamics.  It's also used under someother condition which I didn't decipher.[Note: if both nitro and perfect handling are on, you'll get thenitro multiplier, not both]=====Constants: const float @ 0x858C80, 0x858B90, 0x858B3CUnit: N/AValues: 5, 4, 3Code Used: 0x6D072B, 0x6D0737, 0x6D073FShared: yes, all threeDuring the calculation of car dynamics, the acceleration ismultiplied by the following gear boost:1 + u * (1 - (current_gear - 1)/(number_of_gears - 1))^2where u is one of the three constants above:0x858C80 is used if 1G_BOOST is enabled in the handlingFlags, else0x858B90 is used if 2G_BOOST is enabled in the handlingFlags, else0x858B3C is used in all other cases.=====Constant: const float @ 0x8631F0Unit: N/AValue: 2000Code used: 0x6F50E3Shared: yesUsed only when loading handling.cfg.Multiplies fCollisionDamageMultiplier from handling.cfg.  Changing itwill affect the durability of all cars.=====Constants: const float @ 0x872348, 0x870FCCUnit: N/AValue: both 1000Code Used: 0x872348 used @ 0x6F513D, 0x870FCC used @ 0x6B1096, 0x6A3007Shared: no, neitherBoth of these constants are used to divide fDragMult as follows:actual_drag = fDragMult * 0.5 / this_constant0x872348 - is used when loading handling.cfg to calculate the maximum forward speed of the car.0x870FCC - is used to calculate the drag when creating a new car from a given model.Changing these constants will affect the drag of all cars.=====Constant: const float @ 0x858EE4Unit: N/AValue: -0.3Code Used: 0x6F51E2Shared: yesUsed only when loading handling.cfg.If USE_MAXSP_LIMIT is off, used to calculate the maximum reverse speedof a car according to the formulamax_reverse_speed = max_forward_speed * 5/6 * this_constantTo make cars go as fast in reverse as they do forward, changethis constant to -1.2.[Note: you only have one reverse gear, no matter how fast you go]=====Constant: const float @ 0x85C654Unit: N/AValue: -0.25Code Used: 0x6F5196Shared: yesUsed only when loading handling.cfg.Similar to previous constant, except used when USE_MAXSP_LIMIT is on.=====Constant: const float @ 0x6F51B8Unit: 50 m/sValue: -0.05Code Used: 0x6F51B2 (constant is an immediate in code)Shared: noUsed only when loading handling.cfg.The maximum reverse speed of any bike (9 KPH).=====Constant: const float @ 0x871D50Unit: N/AValue: 0.6667Code Used: 0x6D04F6Shared: yesUsed only when loading handling.cfg to calculate gear data.This constant determines when a gear is switched up.  When the car'sspeed goes above 66.67% of the speed range of the current gear, thegear is switched up.=====Constant: const float @ 0x871D4CUnit: N/AValue: 0.42Code Used: 0x6D04E9Shared: noUsed only when loading handling.cfg to calculate gear data.This constant determines when a gear is switched down.  When the car'sspeed drops below 42% of the speed range of one gear lower than current,the gear is switched down.=====Constant: const float @ 0x859A3CUnit: N/AValue: 1/255Code Used: N/AShared: yesThis isn't really a car physics constant.  It's used to scale values inthe range [-255, 255] to the range [-1, 1].  I came across it becauseit's used to scale the gas pedal value from {-255, 0, 255} to {-1, 0, 1}.The interesting thing about it is that if you make it much larger, youstart to get funny graphics effects!  The screen becomes a lotbrighter, the colors turn very cartoonish, and you get a weirdyellow haze every now and then.

 

Edited by op9080
Link to comment
Share on other sites

wow op9080 you truly are amazing at this stuff gonna have a decent read of all this now and see if i can use any in my sa loader
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.