Search Unity

Vehicle Physics, TrackMania remake, Power-Slide drifting

Discussion in 'Physics' started by sTorrr, Nov 15, 2018.

  1. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    Hi, I am in a process where I am trying to remake the vehicle physics from TrackMania Nations/united. More specific the Power-Slide effect, as shown in video below. Where drifting/sliding occurs when entering a turn with full accel and pressing break when weight has transferred over on outer wheel, holding accel break and turn simultaneously. I have tried three different assets. Two witch use Wheelcolider and one that use Ray cast. I have not managed to find anything similar to the TrackMania arcade like feel, but I am quite sure they use normal mass, approximately 1200 units. Apart from that, I believe it is rear wheel drive and hat the majority of breaking appear on front wheel. The drift function most be less sensitive than for a realistic car to prevent oversteer, I think. Any tips is much appreciated!



    Assets that I have tried:

    https://github.com/JustInvoke/Randomation-Vehicle-Physics

    https://www.assetstore.unity3d.com/en/?stay#!/content/119484

    https://www.assetstore.unity3d.com/en/?stay#!/content/32351

    Other inspiration:



    I was told that edy's Vehicle Physics is to realistic and not easy to tweak this way.
     
    michealcaj likes this.
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,510
    Why don't you try it yourself? ;)

    https://www.edy.es/dev/vehicle-physics/demo/
    (give it one minute to load and start the scene)

    Press Tab to switch between different vehicles with different setups.

    Here you have a brief doc with hints on how to configure the vehicles to your liking:
    https://evp.vehiclephysics.com/faq/
     
    xorpheous likes this.
  3. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    Nice demo! Are you confident you can recreate this effect in your asset, Edy?

    Maybe reduce steering angle and drifting angle as function of speed.
     
  4. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,510
    You may configure the car to slide more or less. In the demo you can drive three sport car variants. All them slide at different conditions.

    However, the precise gameplay is up to you. As you can guess, braking and sliding in car racing won't likely give you a better time (specially in the kind of car / track featured in the video). So you may monitor the user input, check for some conditions (i.e. when the brake is briefly hit while steering at some speed) and then modify some parameter in the car instead of actually applying brakes. Edy's Vehicle Physics exposes many parameters and most of them may be modified in runtime.
     
    sTorrr likes this.
  5. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    how does it look?

     
    sTorrr likes this.
  6. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    Is this Edy's vehicle physics? It looks perfect to me. Or, after looking closer its not the same. In Trackmania its impossible to oversteer. It looks like your straiting out wheel mid turn to avoid oversteer. Also in trackmania vehicle is reaching verry high speeds.

    TrackMania stadium is free on Steam, I think. you could try to make a powerslide at high speed to see what I mean. just go full speed and turn and start baking whill speeding and turning

    I see they reach 500 km/h easely. If Track mania use real physicks I think the vehicle mass is a flat plate slightly above wheelheight, maybe center of gravity is lowered a bit too and suspension is attached to something that is not having a real mass?
     
    Last edited: Nov 16, 2018
  7. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    no its my custom solution and its not similar to trackmania since i didnt aim to mimic trackmania physics. by using a customizable vehicle solution you can achieve most kinds of physics and i think it would be easier to make unrealistic vehicles.
     
    sTorrr likes this.
  8. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    Is it not wheelcolider, but raycasting? Can i try it? It looks verry nice, but kind of too realistic.
     
  9. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    actually it is not that realistic but a middle between arcade and sim. it is currently under development, you may follow my thread in work in progress forums.
     
    sTorrr likes this.
  10. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    I can see this is well built and has potential, but have you tried TrackMania Stadium powerslide?

    Do you think it is similar? Anyways, thanks for teasing me with your nice setup :p
     
  11. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
    i do not have the time to try it but if you are talking about stuff like the video below then i can say that it is doable with some of the vehicle solutions in the asset store but i cant say anything about wheelcollider since i never used it.

     
    sTorrr likes this.
  12. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    What I find difficult using the wheelcolider is that the wheel size, area of contact with ground, seems to matter as well as placement of vehicle body mass. You can probably add weightless shell to make it look like your tall vehicle.

    What is also significant for the trackmania vehicle physics is that the car will never slide unless you brake or if you land at an angle after a jump.

    Once you turn and weight is shifted over on outer wheel car will start to drift if you hit brake and velocity is high enough. But car will never oversteer. Only when speed is reduced significantly car will start to do burnouts.

    TrackMania is free on steam, and you should try it for inspiration, because it is the perfect physics arcade physics.
     
    michealcaj likes this.
  13. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    191

    Hi storrr, you can try the easy vehicle system on the assetstore

    Hey is a a demo you Can play test on your PC
    https://drive.google.com/file/d/1AZwBq3aw-8juQiakQ_vaFI0pNL-10Akf/view?usp=drivesdk

    Watch this


    To get this package on the assetstore go to link below

    https://assetstore.unity.com/packages/tools/physics/easy-vehicle-system-110675
     
    sTorrr likes this.
  14. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    191


    You could try to check from code when the brake key is pressed and at what angle your vehicle is facing ,if these two condition are meet bam drift

    Then for height thing, you could check the height from which it was last on the ground like if it goes higher than a certain level bam get ready to do drift when it lands again Well all these features you need the "Easy Vehicle system" posses them all

    For example
    Code (CSharp):
    1. If (Input.GetkeyDown(keycode.space) && angle>12))
    2. {
    3. Dodrift();
    4. }
    5.  
     
    sTorrr likes this.
  15. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    Nice, lots of great tips. Does "easy vehicle system" use real mass and wheelcoliders?

    This one also looks quite realistic and the drifting is oversteering and doesnt have much speed. But is it possible to make it go five times faster with more sliding controll? So that it wount spin around even if you hold turn throughout entire turn. Only time you drift is to slow down slightly and to reduce the radius slightly. If you drift without accelerating you decreas radious even more, but you never have to controll oversteer.
     
    Last edited: Nov 18, 2018
    michealcaj likes this.
  16. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    191

    Hey storrr, yes to all, expect for the radius resize thing ,when drifting you control your drift with steer angle like real vehicles
     
    sTorrr likes this.
  17. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    But then again drifting would be controlled by reducing steerangle for increasing velocity. Is the steering sensitiv as if using a joystic you can choose not to go full turn unless joystic or simwheel is maxed out?
     
    michealcaj likes this.
  18. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    191
    Okay bro watch this I created it with easy vehicle system



    That's drifting bro