I figured out how vehicle physics works

Discussion in 'General' started by RoboTek, Sep 27, 2009.

  1. RoboTek

    RoboTek Member

    Messages:
    323
    Likes Received:
    0
    Trophy Points:
    0
    Here is the basic gist of it.

    You have the mass, works pretty simply. It is placed wherever you choose, defaults from the center of the model. It works just like a real center of gravity. If you choose a center of mass outside of the vehicle it becomes substantially more prone to weird stuff happening.

    You have turning. Turning is exactly what it is described as, but doesn't include the effects of what I will call 'power-slide' turning. Generally there are two steering modes, one for fast speed one for slow speed.

    When simply turning, there is, to a limited extent, a suspension of front end-back end physics. That means that why you are 'turning' the game will be pretty forgiving about the fact that you should be spinning about like crazy. After the first 30 degrees or so it stops forgiving, but it is notable because it causes weird conditions.

    After you finish turning, your back end and front end are generally not aligned with your current velocity. This is especially true because of the torque factor that occurs when you are driving. More on that in a moment. Anyway, because of this, your back end will generally move more than your front end creating the well known fishtailing effect.

    The things which determine the extent of this fish-tailing are the mass, the position of the mass, the weight of the wheels, and the net torque.

    The torque is the effect caused by the horsepower of various engines. It is exactly what it claims to be, the power of the rotational force. Torque is applied at each axle based upon the torque constant in the vehicle file. This can be viewed as the rotational force applied to the vehicle.

    If one images a wheel, it is easy to imagine the back end being pushed up and the front end being pushed down. This is much the same way it will affect a vehicle. This results in the back end having very little effective weight, causing easy spin-outs.

    The general solution to this is to apply a counter-torque effect. This effect, however, is applied to the vehicle as a whole rather than the front and back separately. Additionally, it works regardless of how much of the vehicle is on the ground. This means high levels of horsepower combined with it cause vehicles to flip over easily on hills, drive up walls for no reason, or pop-wheelies when beginning movement.

    Drag is applied axle-by-axle and is a general resistance to any movement. Naturally, when applied to the back axle it makes it appear to fishtail less, as the back end has a lower tenancy to move. Rotational drag is similar, and mostly deals with the twisting of the vehicle as a whole (to my knowledge). It will also make the vehicle feel slightly sluggish, but its effects are generally less significant.

    More to come later. Perhaps some diagrams. I have already made jeeps that can function with almost any amount of horsepower. Am working an more tests. It should be noted there are limits to what can be accomplished, you should realize this if you ever drove a car at high speeds.
     
  2. Vessboy

    Vessboy Member

    Messages:
    1,519
    Likes Received:
    0
    Trophy Points:
    0
    I like the cut of your jib. this guy's alright. I look forward to seeing what your enhanced understanding yields.
     
  3. Omneh

    Omneh Member

    Messages:
    1,726
    Likes Received:
    5
    Trophy Points:
    0
    If you can make the jeeps not handle like bricks you will be my hero
     
  4. RoboTek

    RoboTek Member

    Messages:
    323
    Likes Received:
    0
    Trophy Points:
    0
    I have successfully made the NF jeep not handle like a brick. I have been able to make the BE jeep capable of withstanding extreme forces or not handle like a brick, but not both yet.
     
  5. Jephir

    Jephir ALL GLORY TO THE JEPHIR

    Messages:
    1,409
    Likes Received:
    6
    Trophy Points:
    0
    Protip: Don't accelerate while turning.

    That's about it.
     
  6. ScardyBob

    ScardyBob Member

    Messages:
    3,457
    Likes Received:
    30
    Trophy Points:
    0
    Post some vehicle scripts so we can try them out :)
     
  7. RoboTek

    RoboTek Member

    Messages:
    323
    Likes Received:
    0
    Trophy Points:
    0
    I am working on adjusting all vehicles to have different ideal engines with driving style largely dependent on the engine.

    Currently I have scripts for jeep, LT/AFV, med tanks, heavy tanks, and a new set of engines. When I finish everything in a day or two I will post them all.

    I tried to retain advantages and disadvantages for each vehicle, but overall they drive better. Hopefully people will appreciate that I managed to make some vehicles driver better with higher horsepower and some drive worse.
     
  8. spellman23

    spellman23 Member

    Messages:
    861
    Likes Received:
    0
    Trophy Points:
    0
    awesome. Someone finally got into the gritty parts of the horrid vehicle code.
     
  9. blizzerd

    blizzerd Member

    Messages:
    10,552
    Likes Received:
    60
    Trophy Points:
    0
    brrr, not touching that part of the code brrr
     
  10. =PVCS) Cpatton

    =PVCS) Cpatton Member

    Messages:
    1,822
    Likes Received:
    6
    Trophy Points:
    0
    "I figured out how vehicle physics works"

    Great. here is a cookie, and a gold star.

    I thought the vehicles were supposed to handle like bricks, it should take skill to drive, this isn't fucking mario cart on 150cc, ytanks aren't supposed to handle like sports cars -_-.
     
  11. blizzerd

    blizzerd Member

    Messages:
    10,552
    Likes Received:
    60
    Trophy Points:
    0
    even when asked to paint a simple illustration
    when the opportunity and chance arrives, paint a master work instead.
     
  12. Emp_Recruit

    Emp_Recruit Member

    Messages:
    4,244
    Likes Received:
    0
    Trophy Points:
    0
    AWESoME METAPHORE DAWG
     
  13. Tovarich Cookie

    Tovarich Cookie Member

    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    0
    patton needs to chill.
     
  14. spellman23

    spellman23 Member

    Messages:
    861
    Likes Received:
    0
    Trophy Points:
    0
    driving bricks that doesn't feel like realistic physics = fail.
     
  15. =PVCS) Cpatton

    =PVCS) Cpatton Member

    Messages:
    1,822
    Likes Received:
    6
    Trophy Points:
    0
    RAAAAAAAAAEG

    Feels like real physics to me ^^. How much offroading have you done in a tank? :P
     
  16. Chris0132'

    Chris0132' Developer

    Messages:
    9,482
    Likes Received:
    0
    Trophy Points:
    0
    It should be fun to drive.

    Because games are, you know, supposed to be fun?

    Right guys?
     
  17. Demented

    Demented Member

    Messages:
    2,337
    Likes Received:
    0
    Trophy Points:
    0
    So you like the idea of making driver and gunner separate? :|ove:
     
  18. =PVCS) Cpatton

    =PVCS) Cpatton Member

    Messages:
    1,822
    Likes Received:
    6
    Trophy Points:
    0
    @Demented: That idea is somewhat implemented, in the fact that a grenadier can always hop in the turret of a vehicle.

    Making them seperate would be a true testement to the actual team work nessecary and integrated into the game of Empires.

    Unfortunately, the game of empires is a WTFHEADSHOT FPS mod for LOLOLOLOLOL Half Life 2 and a close brother to Counter Strike Source which means valuable team work is so fuck all expected that forcing tanks to be pairs of people working together would just further deteriorate the fun of the game. SIMPLY because I can't expect some noob to be reliable for shooting the same damned target I'm maneuvering around or angling to kill. If one of the two people just fails hard, an entire tank is wasted, 2 people would be necessary to get and make a vehicle useful, the driver can pay attention to driving while the gunner shoots people up, people would be forced to work together....

    FUCK YEA! :|ove: That is an awesome idea. Would make vehicles a little less overpowered and a little more valuable as 2 infantry have to use one tank. Fuck yea.


    @Chris: Also, with regards to being fun to drive... yea ok, but *fun* and *easy* are two seperate and distinct words in the english language. For instance: where as WTFPWNAGE weapons on a tank that allow some noob who just joined empires 5 minutes ago and never played an FPS before in their life to shoot in some direction that is sorta kinda near an enemy tank and blows it up in one shot with a massive explosion and automated teabagging (**COUGH COUGH, WTF AWP-WHORE**)... would be epically fun for the NOOB, it would not be so much fun for the 2 year veteran of empires in that former enemy tank (now pile of smoking rubble) expecting some amount of skill to be involved in the prossess.

    NO, I do NOT. FUCKING. BELIEVE. That the vehicles should drive like traction is a god given right in any circumstance just because you can't handle driving appropriately==> as in you - as a driver - *CAN* spin out your vehicle and you must learn to balance your turning / speed / avoiding obstacles so that you DON'T fucking spin out. *THAT* is the realistic *FUN* of driving every vehicle in real life. You can't just hold W (push the pedal to the floor) and expect to be able to turn the wheel full tilt left at full speed with 3 phase (50-70 mph) and not fucking spin out. Fun should be synonymous with a good dose of challenging and the ability for *skill* to be useful.
     
    Last edited: Oct 2, 2009
  19. Vessboy

    Vessboy Member

    Messages:
    1,519
    Likes Received:
    0
    Trophy Points:
    0
    you know having two speeds would add skill. Like holding "w" is cruse speed and all vehical's and engins can reach that speed. but holding "shift + W" engages floor it speed where vehicals with faster engines leave the others in the dust.
     
  20. 0yv47

    0yv47 Member

    Messages:
    240
    Likes Received:
    0
    Trophy Points:
    0
    :|ove: :|ove: :|ove: :|ove: :|ove: :|ove: :|ove: :|ove: :|ove:
     

Share This Page