Unity3d Car Racing Physics

Поделиться
HTML-код
  • Опубликовано: 18 янв 2025

Комментарии • 82

  • @LIVIU_ALEXANDRU
    @LIVIU_ALEXANDRU 6 лет назад +8

    your gameplay is beautilful man . You know what is a gameplay for a game :) THANK YOU !

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад +1

      thank you! I had fun playing it, maybe I can even upload it if If I have the build somewhere...

  • @rikbanerjee3888
    @rikbanerjee3888 6 лет назад +11

    great project. best unity race physics/game i have ever seen

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад +1

      Thank you! I am having hard times finishing this tho, because of lack of authentic media

    • @PHLYogi
      @PHLYogi 5 лет назад +1

      @@raveltammeleht6278 what type of media exactly? I'd like to help out and maybe share some ideas!

  • @Testtestnotest
    @Testtestnotest 3 года назад +4

    not going to lie, this looks so much fun

  • @riftiro4427
    @riftiro4427 6 лет назад +45

    Hi! This is incredible! I want to ask 3 questions:
    1. How did you simulate a 40/60 weight distribution?
    2. How do you manage to make the car have a seamless shift without a sharp drop in RPM while shifting?
    3. Are you using Wheel Colliders or your own wheel physics?
    Thanks in advance!

    • @jaulloa21
      @jaulloa21 5 лет назад +1

      Euron from what I’ve seen, you can actually adjust the mass in the rigid body component. And use forcemode.velocity to the wheels.. but I’m no programmer

    • @mikejzx
      @mikejzx 5 лет назад +6

      I think I'd be able to answer those for you:
      1.) The Rigidbody.centreOfMass can be adjusted to 40/60 by making it 60% towards the rear of the vehicle. (This can be approximated by specifying the length of the vehicle. 50/50 should be directly in the centre of this length. This all assumes the vehicle model is not offsetted and has a pivot point in around exact center, if it isn't and you want accuracy, it would need to be adjusted)
      2.) His RPM calculation is most likely not coming *directly* from the wheels, but is instead a velocity that is being added to and subtracted from at run time, this results in smoother RPM's, instead of using the wheel's rotation speed directly people do with wheel colliders. The old 3.x Car Tutorial (now removed from asset store) took this approach in the ~AlternatePhysicsModel section.
      3.) He is using his own custom wheel physics, with an implementation of the Pacejka tyre friction model. (I believe the '89 version, from a forum thread of his I read a while back)

    • @sefatunckanat
      @sefatunckanat 5 лет назад

      @@mikejzx can you write forum thread link of Pacejka tyre model? I couldnt find it

    • @mikejzx
      @mikejzx 5 лет назад

      @@sefatunckanat
      This is the forum post I mentioned, but it doesn't give much information specifically about the Pacejka tyre model:
      forum.unity.com/threads/motorsports-dynamics-engine-a-k-a-modyen.126046/
      In the 'List of Key Features" under the "Tires" sub-heading in the main post he mentions his use of the 1989 version of the tyre model. He might have changed it since then, but unlikely.
      If you want the actual Pacejka formulae; Edy wrote a great article on the 1994 tyre model here which I've used personally:
      www.edy.es/dev/docs/pacejka-94-parameters-explained-a-comprehensive-guide/
      For a game you don't really need anything newer than that. Newer models like PAC-2002 are just overkill for a **game** .

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад +9

      @@mikejzx Thanks, great reply! Here are some corrections. 1. There are slightly different approaches to the center of mass, but the one that I use, sums up the distance of front and rear axle (results in wheelbase) and divide it by half. Then you get the 50/50 actual center of mass, with some minor tweaks, you can then change it from 50/50 to 40/60 with ease.
      2. My RPM calculation is actually similar to the 3.x ~AlternatePhysicsModel it uses wheel angularvelocity to calculate the RPM of a wheel directly (angularVelocity * (PI/30) = RPM) The seamless shift, is due to the fact that I actually simulate clutch as a rotational part aswell. So the velocities of the engine and wheels (through gearbox) have to match up first. Like in a real car hey!
      3. I have my own wheel physics that is true. The physics model currently supports Pacejka89 and Pacejka94 (tho most of the data you can find is Pac89) I also recently integrated MF5.2 which has a noticable impact on friction. But as said for a game, might be a overkill.
      I also like to note out that My physics simulation relies on Runge - Kutta 4 Solver model, which enables high accuracy on lower refresh rates. For instance you can now have highly stable vehicles at 60hz. Previously you required 1000hz in order of realistic physics. Now thanks to Runge - Kutta 4 solver, each millisecond, the main calculation gets divided into 4 sub calculations, that are summed together in the end. The reality is that there are 6 calculations. 1 initialization 4 steps and 1 final step. This is what makes the simulation stable. Previously there were small errors that broke the whole simulation at low friction.

  • @josephwyze
    @josephwyze 5 лет назад +2

    Hey man
    Great work... working on a racing game myself but as you already guessed my vehicle physics is nothing compared to this...
    How can I have such great physics and camera response in my game.
    Thanks in advance

  • @tokyowarfare6729
    @tokyowarfare6729 6 лет назад +5

    It could also be because steer input is oversensitive with gamepad. Ive to revisit the steer code to add a sensitivity curve or something like that. Specially the first 1/4 of the range feels too sensitive. Or finetume the steer sensitivity damped by speed.

  • @kuyands
    @kuyands 5 лет назад +1

    That nurburgring norfdschlief

  • @Armand__
    @Armand__ 6 лет назад +1

    This is beautiful. It's could make a great racing game

  • @piszczel414
    @piszczel414 5 лет назад +9

    Man i want to play this game :P

  • @siapitapit3605
    @siapitapit3605 6 лет назад +1

    Holyshit i hope mobile gaming could be like this in no time

  • @tokyowarfare6729
    @tokyowarfare6729 6 лет назад +5

    Cool as ussual
    Your setups tend to slip a bit too easily. I believe its due to your passion for drift XD. Please try a setup that prior to drift the weight transfer is more visible aswell the tires are seen to hold greater grip because they usually slip as soon as they seem to have a bit of extra load.

  • @vikashsakiv3862
    @vikashsakiv3862 8 месяцев назад +1

    Where did you learn to make these elegant games? Guide us to make gud games and learn game Dev

  • @OverAndOverAndOver
    @OverAndOverAndOver 5 лет назад +8

    This looks like MoDyEn! Are you Releasing/Selling this project?

  • @jamos4115
    @jamos4115 6 лет назад +16

    How did you handle sound?

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад +13

      The sound is handled by looping a bunch of samples and fading their volumes depending on RPM points. The pitch is changed relatively to the engine RPM

  • @sphelelelubanyana1750
    @sphelelelubanyana1750 Год назад

    Can you do a series on this... I

  • @GravezaumStronda
    @GravezaumStronda 5 лет назад

    hey dude , how to create a gear ratio ?

  • @PugzofSteel
    @PugzofSteel 5 лет назад

    I'd like to learn how to do this and make a Hill Climb racing game. I want to build the US 19/129 highway.
    How awesome would it be to build a track builder where you import certain roads into a video game and add all the trees and buildings from an object depot?

  • @Aaron_777
    @Aaron_777 4 месяца назад +1

    where do i play

  • @WoopySports
    @WoopySports 5 лет назад

    Now that's a test drive

  • @kovacsbence5521
    @kovacsbence5521 6 лет назад

    It looks like a RUF CTR! Cool!

  • @hydragamesstudio
    @hydragamesstudio Год назад +2

    HI bro, im a car racing dev, but i want make a car physics like that, can you teach please? i realy need that for my project in unity 3d engine and i dont have a base for start. sorry by my inglês, my idioma is portuguese

    • @claudaoautopecas4843
      @claudaoautopecas4843 Год назад

      Tem um canal muito bom que ensina um pouco dessas fisicas mano, original generation studio, ele e brasileiro

  • @driftttoor6599
    @driftttoor6599 6 лет назад +2

    i hope your asset can support phone in the future

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад

      Thanks, Ive been working on a mobile alternative, that has less calculations but simmilar feel, might be releasing this year. Unsure how to label it as it will lose it's hardcore realism, but it feels sort of GTA IV 'ish, lots of body movements etc.
      Not sure of Mobile Version of MoDyEn. I previously experimented with iOS, the problem was that the physics booted up on the second or third time launching the app. So the first time you always ended up with a glitching buggy mess. I guess mobile CPU's work a little different afterall when trying to read library packets...

  • @SOMEONE-zw3ko
    @SOMEONE-zw3ko 4 года назад +1

    Epic please give download link for this assets please please

  • @eBlackize
    @eBlackize 5 лет назад

    Really awesome! Do you have any resources so we can learn how to make things like this? I also want to learn how to make it controllable with a steering wheel set.

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад

      I am trying to post as much as possible to my dev blog, located at slicktires.tumblr.com/

  • @szil_1012
    @szil_1012 3 месяца назад

    How do you keep the camera close to the car even at high speeds. While still being able to be smooth and show the sides of the car while drifting/sliding

    • @raveltammeleht6278
      @raveltammeleht6278  3 месяца назад

      I use something like this:
      Vector3 lookToward = target.position - transform.position;
      Vector3 position = (target.position - lookToward.normalized * dist);
      and distance is something like 5 or so...

  • @arsylgames
    @arsylgames 4 года назад +1

    If I am right you are driving on Nurghburgring. But how do you have this track inside the unity editor?

    • @raveltammeleht6278
      @raveltammeleht6278  4 года назад +4

      Hello, it's a conversion. I bought the NFS Shift DVD and downloaded some tools to extract the track. Once it was in FBX file format I was able to continue in unity.

  • @robosergTV
    @robosergTV 5 лет назад

    share scene please, if its not commercial

  • @sharky_e63
    @sharky_e63 6 лет назад +3

    Wow
    Do you sell this racing physics?

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад +2

      Thanks. Yes this physics model is acquirable on the Unity Asset Store, but the Surface Manager, that comes with it, is outdated and causes slowdowns(because it runs on every frame, good for prototyping). I have addressed it and the new version will have a much better surface manager. The reason it is shipped currently, is that it works and some talented programmers can actually advance the Surface Manager to suit their needs, that's why I left some pieces open source in this package. After all I am selling the physics model, not the tweaks and whistles that rely on the physics model. That's just the extra that comes with the pie so you can have a head-start :) .. If you wish to acquire the full source license, then you have to contact me directly.

  • @insanitized750
    @insanitized750 5 лет назад

    That camera reminds me of porsche unleashed c:

  • @andregm3288
    @andregm3288 5 лет назад

    Demo Please !

  • @anbari-3737
    @anbari-3737 6 лет назад

    Can I get particle of the flames please?

  • @jehopoon6439
    @jehopoon6439 5 лет назад

    it's awesome.How did you handle sound?used fmod or wwise?

  • @woozhi9218
    @woozhi9218 4 года назад

    Were you couter steering your self or the game is if so this game really deserves to be reckoned maybe build an arcade rig and put at your nearest arcade center people would love playong this instead of wangan remembee to add force feedback cuz battle gear 4 had it and it was hella fun then wangan .

  • @OverAndOverAndOver
    @OverAndOverAndOver 6 лет назад +1

    Is this an asset?

  • @aidenbaghi8411
    @aidenbaghi8411 5 лет назад

    thats AWSOME

  • @darthnosh489
    @darthnosh489 5 лет назад

    Do you also have cars to add or download?

  • @onezerodev1756
    @onezerodev1756 5 лет назад

    this is awesome

  • @sascha260697
    @sascha260697 6 лет назад

    Amazing work in Unity! Did you used the WheelCollider or did your own?

  • @AymanTravelTransport
    @AymanTravelTransport 5 лет назад

    I would like to see you adapt this into an open world driving game like Forza Horizon!

  • @CarlJT
    @CarlJT 5 лет назад

    Odd question but, what did you use for the ground? Did you make a terrain? Or something else?

  • @arsylfpv2848
    @arsylfpv2848 5 лет назад

    How do you did it make so realistic with unity? Maybe tutorial?

  • @swagga12
    @swagga12 3 года назад +2

    has this ever bern released?

    • @raveltammeleht6278
      @raveltammeleht6278  3 года назад +1

      sorry but this exact demo was for personal use only. The physics package was released from 2013 to 2018 in Unity asset store and then they decided to terminate my products. Maybe they were not suitable for the general users of Unity.

  • @muhammadaarizimam4890
    @muhammadaarizimam4890 4 года назад

    Can I have a tutorial

  • @danielzimmerman4501
    @danielzimmerman4501 6 лет назад

    How do I make it

  • @MadFireOn
    @MadFireOn 6 лет назад

    Asset used in demo are created by you or hired any artist ?

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад

      Assets used in this build are created by Slightly Mad Studios. I dont own the rights to sell or ship any commercial product with these assets, but I use them as placeholders, before I get my own original content made. Artists are the most important people in the industry and it also is quite hard to work with them, if you dont have any $$$ to spend on a project.

  • @LIVIU_ALEXANDRU
    @LIVIU_ALEXANDRU 6 лет назад

    hi! you created this game ? O_o ?

  • @antunnitraj
    @antunnitraj 5 лет назад

    Hmmm... how i will say it?!.... Can we get the link, PLEASE????? BTW BEST PHYSICS I HAVE EVER SEEEN!!!!!!

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад +1

      thanks! I dont know if I have the build anymore, will check, and update the description once I find it.

    • @antunnitraj
      @antunnitraj 5 лет назад

      @@raveltammeleht6278 Then can you the reply in the comments when u update the description??

  • @lantreco
    @lantreco 6 лет назад

    Is the asset or project being sold?

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад

      Hello, the physics model is. But the assets are from another game.

  • @stormAster720
    @stormAster720 6 лет назад

    thats cool

  • @darthnosh489
    @darthnosh489 5 лет назад

    Is this a kit or template? Is it for sale and downloadable? How much for the engine?

  • @theotherquou
    @theotherquou 6 лет назад +1

    These physics are almost as good as Forza Motorsport 6. Are you planning on selling the code for this?

    • @raveltammeleht6278
      @raveltammeleht6278  5 лет назад

      Thank you, infact Forza Motorsport 4 was the aim with these physics. Really love the Forza series by Turn10.
      The source is acquirable directly by contacting me.

  • @stormAster720
    @stormAster720 6 лет назад +1

    this is my car game made with unity called GTM Cars

    • @stormAster720
      @stormAster720 6 лет назад

      ruclips.net/video/iYcxZmQXGZs/видео.html

  • @cgmonkey990
    @cgmonkey990 4 года назад

    Nürburgring =)

  • @MrBanaanipommi
    @MrBanaanipommi 6 лет назад

    well, seems like you never have drove real car. that car handles like soap

    • @KreskizKi
      @KreskizKi 6 лет назад

      It's said it's meant to be a simcade

    • @kovacsbence5521
      @kovacsbence5521 5 лет назад

      Still, it doesnt look like it handles like a real car. It slides with the slightest of inputs.