Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Assets NWH Vehicle Physics

Discussion in 'Works In Progress' started by NWHCoding, Nov 30, 2017.

  1. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    Asset is working on 2018.2.11f which is pretty much latest official non-beta release. It has not been tested on 2018.3.
    Asset is live and the last update was in June which is true. Current version is 1.7.2 on which is a LTS release with so far no bugs reported (see TODO) and that is why there was no update in the mean time. I am of course working on other projects too and when there will be a few things on the TODO list I will post another update.
    You can check out the changelog at the bottom of TODO file and you will se that over the few months after the release I have worked almost exclusively on the package making it as bug-free as possible and improving different things.
    If you got something reasonable that you want to see inside the package do tell.
     
  2. Mixa1985

    Mixa1985

    Joined:
    Oct 31, 2018
    Posts:
    2
    Thanks.
    Very cool what this asset have the LTS and asset is alive.

    Questions:
    1. Is supported by asset: ESP, EBD? (I have seen ABS and TCS is avail)

    2. Is will be easy or hard to add external forces to car dynamics (slipstream effect, aerodynamics (also damage, spoilers) or wind (weather)?
    I understand what it is not direct job of car(or weels) controller.

    3. What about influence and simulation of temperature, pressure and wear of tires?

    4. Is possible modify asset to simulation of electric car?

    5. Any plans to use a new Unity Job system and Burst compiler?
     
    Last edited: Oct 31, 2018
  3. facundogalella

    facundogalella

    Joined:
    Mar 5, 2016
    Posts:
    33
    Hi! I'm trying to enable the rigging in my car, but I'm a bit confused, I only find a paragraph in the documentation. I need read a bit of info outside this manuals? like unity hinge joints?

    I checked the monster truck but isn't enough to understand, thanks in advance
     
  4. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    1. Electronic stability control and electronic brake distribution are not available at this moment.

    2. External forces are quite easy to add and a simple external downforce script is included. This is because all the vehicles are pure rigidbodies with only AddForce() used for the whole physics.

    3. The friction properties of the tyres are dependent on the surface only but properties such as slip and force coefficient can be set externally if needed. Wheel Controller 3D has a complete API for getting/setting properties. Out of the box, no.

    4. It is. I would say there is no need to modify the code itself, just the gear ratios since electric cars only have one gear and power/torque curve. It would still shift from reverse into drive and vice versa if code was left as-is, but electric cars do have gear/direction selector too so that should not be a problem.

    5. No. At this point there is simply no benefit. ECS, last time I checked, does not work well or at all with physics and all the benefits of the system would be wasted since the WheelController 3D is the only thing that would potentially benefit from it due to the nature of ground detection.
     
  5. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    To rig a vehicle first make sure that your bones are working properly. The suspension should be rigged much like you would rig a character. At the end you should have suspension that is movable by moving just a single transform - 'target'. That target should be assigned to non-rotating object field of Wheel Controller 3D. Any object in that field will follow the movement of the wheel but without rotation being applied.
     
  6. facundogalella

    facundogalella

    Joined:
    Mar 5, 2016
    Posts:
    33
    Thank you.

    So, I have in each wheel three game objects: a wheel visual, a caliper (non rotating) and the suspension. So I think I should attach suspension and caliper to make a single non rotating object, to rig properly.

    I'll check how the caracters are animated in other cases, to understand how the suspension should be assembled with the rest of the car.
     
  7. facundogalella

    facundogalella

    Joined:
    Mar 5, 2016
    Posts:
    33
    Hi again!

    someone are using this asset with AI cars? some asset or idea to make a good approach? thanks!
     
  8. firefly9000

    firefly9000

    Joined:
    Dec 7, 2016
    Posts:
    7
    We're trying to separate breaking from reverse when using a wheel controller and pedals but are having issues with the car turning AFTER it stops.

    We've added a BreakValue property to the input and are using it to break without going into reverse (it gets values from the pedal in the range 0..1) when we come to a full stop. Here's the code:

    Code (CSharp):
    1. if (vc.transmission.transmissionType == Transmission.TransmissionType.Automatic || vc.transmission.transmissionType == Transmission.TransmissionType.AutomaticSequential)
    2.             {
    3.                 if (vc.input.BreakValue > 0f)
    4.                 {
    5.                     foreach (Wheel wheel in vc.Wheels)
    6.                     {
    7.                         intensity = Mathf.SmoothDamp(intensity, vc.input.BreakValue, ref intensityVelocity, smoothing);
    8.                         wheel.SetBrakeIntensity(intensity * brakingIntensityModifier);
    9.                     }
    10.                 }
    11.             }
    Car seems to rotate around its center after it stops. Here's an image. Note car's rotation relative to skidmarks.

    What is the problem and how can we stop this?

    Thanks
     

    Attached Files:

  9. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,148
    Motor bikes? are they supported any demo of that? yes no?
     
    Rowlan likes this.
  10. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    542
    I really would like that as well. Dirt Bikes and ATVs :D
     
  11. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    Bikes and two wheeled vehicles are not supported. Wheel Controller 3D works fine with them but the vehicle controller is intended for use with vehicles that have axles / differentials. So in short, no.
     
  12. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    ATVs will work just fine. Just the two wheeled vehicles will not.
     
  13. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,148
    Fair enough, I was looking for more of a drop in solution to getting a ready to use motorbike, any suggestions? is the 3d wheel controller good for doing that on its own? not sure on the complexities of it.
     
  14. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    The reason why NWH Vehicle Physics does not target motorcycles is that I wanted to focus it on a specific group of vehicles. Writing a motorcycle asset would be easier from scratch while reusing some parts of NVP rather than modifiying NVP. This is because motorcycles are more arcade-y in most cases, do not have things such as axles and differentials and many things such as camber and steering wheel are something motorcycles do not have.
    A few customers made two wheeled vehicles in their games, two bicycles and at least one motorcycle game. Could be there were others but those are the ones I know about. WC3D with your custom vehicle controller would be the best bet.
     
  15. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,148
    And WC3D that is used in NWH Vehicles... can that be used separately for a custom arcade bike? ie not so intertwined with his asset so that part of it can be used like the separate asset?
     
  16. phattanapon

    phattanapon

    Joined:
    Jul 21, 2014
    Posts:
    5
    Do you know if this asset would work with a motion simulator, something like this?https://www.kickstarter.com/projects/feelthree/feel-three-virtual-reality-motion-simulator

    What I've learn so far is that they're using a motion simulator software called SimTools
    https://www.xsimulator.net/simtools-motion-simulator-software/

    But I haven't learn what kind of data I should send to SimTools so the platform could move accordingly.

    Another question is that how can I use the steering wheel like Logitech G29 to control the car? Sorry if this is already answered somewhere.

    Thank you very much.
     
  17. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    I am not sure about the simulator and there is for sure no inbuilt support for it. If you find out what kinds of inputs it requires it probably could be done without much problems.

    Steering wheels will work and the asset has been tested with Logitech Driving Force GT by me and some other people in this thread mentioned using G27 and G29 earlier.
     
  18. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    There will be an update in a few days so if anybody has anything else to add please do so.
    Here are the changes so far:
    • Last shift time is now private so that it does not get copied over when copying the component field values at runtime.
    • Add additional vehicle (ATV/Rally Car).
    • Make manual searchable.
    • [WC3D] Rim collider always uses IgnoreLayer, no matter what user setting is.
    • Blinker component creates warning on every frame when clip size is zero.
    • Switch to standard water instead of pro in demo scene to avoid warnings.
    Here is the link to TODO list where you can see what has been done and what is in the queue.
     
    FargleBargle likes this.
  19. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    542
    I bought it yesterday and tried it briefly. Just some notes:

    The quick setup isn't that easy. What I had to do is drag over the car prefab and apply a script to the car. Then disable the cameras because I used my own from Unity (FreeLookCameraRig).

    Another thing was the performance. It's really heavy. A light version could be interesting. I didn't investigate it yet what draws the performance, but I guess it might be stuff like terrain scanning? In relation to that, particles regarding terrain might be cool: Water, Dust, Stones, Plants while you drive over them.

    Just writing away what I think since you asked, I haven't had the chance to dig much into it yet, but definitely will do so in the coming days :)

    An ATV/Rally Car is definitely very much appreciated!
     
  20. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    I have written a post a few pages back about performance. Many people profile the editor which adds performance overhead per function call. Since the default wheel collider is running as native library and is therefore non-profileable it will appear as if the performance with default wheel collider is better (which it is to some extent since it does not do 3D ground detection, camber, caster, etc.) but the real way to check the performance would be by building the project and profiling that. You will see then that the asset is well optimized and over a week of work was put in just into optimizing the WC3D. So do try it with the built project and you will see that the performance is quite good. There is a whole section on this inside WC3D manual if I remember correctly.

    Also, do try the mobile scene which uses lower poly models (some models in the desktop scenes have 30k+ triangles). And even with relatively high poly models I am running the desktop demo scene on Ultra settings at 160+ FPS inside editor.
     
    Rowlan likes this.
  21. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    542
    Thanks, will definitely do. Great asset. The models alone are worth the price :)
     
  22. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    Since the Unity folks have sped up their update review process I have decided to split the update in two. 1.7.3 is just uploading and will be available in 2-3 days (after it gets reviewed) with following changes:
    • Last shift time is now private so that it does not get copied over when copying the component field values at runtime.
    • Manual is now searchable as requested and duplicate manual has been removed.
    • Fixed blinker component creates warning on every frame when clip size is zero.
    • Switch to Seans water instead of standard to avoid warnings on import.
    • Move to 2017.4.6f1 LTS.
    There are more cosmetic fixes. New vehicle will be coming in 1.7.4 which will be a few days after 1.7.3, as soon as I source a good quality model.
     
    xDeveloper likes this.
  23. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    156
    Just sent you an e-mail in regards to half track setup.
     
  24. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    156
    I replied to your e-mail but never heard back from you. Did you get it? Still looking to do the half track this week.
     
  25. Willbkool_FPCS

    Willbkool_FPCS

    Joined:
    Jun 13, 2018
    Posts:
    81
    Don't keep it a secret. ;)
     
  26. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    Nah, his email had a tendency to end up in my spam for some reason so he now announces it so that I do not miss his messages.
     
    Willbkool_FPCS likes this.
  27. Suki-W

    Suki-W

    Joined:
    Mar 11, 2014
    Posts:
    22
    anyway I can set this up to have arcade style feel, where car doesnt flip over and quick turns, etc...?
     
  28. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    Yes there are. Just note that not flipping over is not an option since we are talking rigidbodies here, but it is possible to make it hard to flip over.

    A few tips:
    - Lower center of gravity.
    - Set Wheel Controller slip coefficient to a small value (e.g. 0.5) and force coefficient to a larger value (e.g. 1.6).
    - Alternatively, use more linear friction curve (try the last option in the dropdown or make your own if you want more control)
    - Move center of mass slightly more forward for better steering response.
    - Use four wheel drive.
    - Check out driving aids settings and try to play with them.

    Those are a few things I can think of. Most prominent will be wheel controller and CoM changes.
     
    Suki-W likes this.
  29. Suki-W

    Suki-W

    Joined:
    Mar 11, 2014
    Posts:
    22
    gottcha, thx,

    just a request maybe sometime in the future when you have time or if its something you interested in not sure if you are or not, but ever thought about making a arcade style car option available to choose from, already preconfigured for us to study. thx? Just asking....
     
    NWHCoding likes this.
  30. Willbkool_FPCS

    Willbkool_FPCS

    Joined:
    Jun 13, 2018
    Posts:
    81
    What I mean is don't keep the half-track code secret.
     
    Last edited: Dec 3, 2018
  31. Suki-W

    Suki-W

    Joined:
    Mar 11, 2014
    Posts:
    22
    "If" you are okay with the arcade car request. Id you like take a look at it as far as how it stops the car from flipping over, It too uses a rigidbody. Again, just a request thats all as far as arcade car physics. Since there are zero market for the on the asset store. :( I think your controller is fluided enough to fake arcade style, with all the other features it included which would make it pretty evolutionary in my book . thx.
     
    Last edited: Dec 4, 2018
  32. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    Thank you for your feedback. Now that I know that there is interest for such vehicle I will look to include such vehicle with the ATV that is on the way.
     
    Suki-W likes this.
  33. Suki-W

    Suki-W

    Joined:
    Mar 11, 2014
    Posts:
    22
    thx, thats really cool of you. oh yea there's way too many people looking for the classic style arcade, because every vehicle physics on the market that has realistic, but if you type in forums"unity vehicle arcade style", there's post going back near a decade asking where to buy or how to build arcade car physics. The demand is high, just be sure you highlight arcade option in the update, so people can see it, because the demand is on forums, and youtube comments. :)
     
    Last edited: Dec 4, 2018
    NWHCoding likes this.
  34. CoderPro

    CoderPro

    Joined:
    Feb 21, 2014
    Posts:
    285
    Hi @NWHCoding
    In the next update, could you make a drift setup car prefab ?
     
    NWHCoding likes this.
  35. cybersoft

    cybersoft

    Joined:
    Feb 12, 2014
    Posts:
    75
    Hi,

    We have end of Mega Sale.

    I like your work and your asset that is in my opinion more advanced compared to others. I wanted to buy your controller but I still hesitate because of your competitor Realistic Car Controller which is now on sale too.

    Did you do some work related to Photon or other multiplayer solutions?

    You are more active and the support seems to be better on your site.

    My goal would be multiplayer games using uSurvival or uMMORPG with a car controller.
     
  36. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    Version 1.8 is on its way. Expect two new vehicles (arcade-style car and an ATV), bug fixes and
    The arcade car that will be included will double as that.
     
  37. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    There is no support for Photon or any other multiplayer solutions. This has been asked a few times around here and therefore I might add the support, but no promises so do not buy off of that. That said, a few people that I know of have implemented multiplayer solutions on their own but that would require coding for sure.
     
    Willbkool_FPCS likes this.
  38. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    156
    It's not hard, I could give some pointers on this when I get a chance.
     
    Willbkool_FPCS and NWHCoding like this.
  39. cybersoft

    cybersoft

    Joined:
    Feb 12, 2014
    Posts:
    75
  40. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    I say that the fact that the person who made the asset MS Vehicle System (Marcos Schultz) recommending his own asset in a comparison video is not that surprising. I like letting people decide on their own from the material provided to them.

    I own a copy of Edy's Vehicle Physics and I would disagree with the reviewer, I would say it leans heavily towards arcade instead of realism but that is my two cents.
     
    Last edited: Dec 7, 2018
  41. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    One quick question. Which networking solution would you like to see implemented?
     
  42. Willbkool_FPCS

    Willbkool_FPCS

    Joined:
    Jun 13, 2018
    Posts:
    81
    I use UMMO, which kind of uses UNET, which is being deprecated. Maybe wait and see what the new Unity networking will be like. Depending on what Unity does, I'll either use that or switch to Darkrift 2. I really don't want to use cloud networking, I'd rather use my own dedicated server, but a lot of people use Photon. That's probably what most use right now. Any networking that you add will be most appreciated.
     
  43. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    I have been researching all the different solutions and so far ENet seems to be winning in most areas. But the reason I have been reluctant to implement one single multiplayer solution is because multiple solutions at the same time are not possible and no matter how good a solution is, it is not worth implementing it if nobody uses it. And there are many people that are rolling their own networking solutions so they would even prefer (in my opinion) a vanilla asset that they do not have to take apart to remove the code from the other solution. But then, maybe it would be easier for those people to implement their own solution if they had an example.

    I was leaning towards UNET but since it is going to be removed in 2018.4 - which is in a few months most likely - I am a bit to reluctant to implement it just to have to remove it a few months down the line. I am searching for any info on new Unity multiplayer system but it seems that it is in very early stages at the moment.

    So it will most likely be Photon in the end but if anyone else has an opinion it would be great.
     
    Willbkool_FPCS likes this.
  44. obstudio

    obstudio

    Joined:
    Sep 30, 2016
    Posts:
    43
    If you want realistic physics buy edy's physics but not the one from asset store.
     
  45. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    We are getting a bit off topic here, this is NWH Vehicle Physics thread and promoting other competing assets is a bit rude in my opinion.

    On the other hand, if you have any opinion on which multiplayer solution should be implemented do tell.
     
  46. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    23,853
    User opinions will not be censored but we ask users to remain on topic.
     
    Willbkool_FPCS and NWHCoding like this.
  47. eddyjohnson3

    eddyjohnson3

    Joined:
    Jul 27, 2012
    Posts:
    36
    Hi, have another question

    Im looking for some advice about setting the springs/dampers in a realistic manner? The example vehicles work well(although there is not much to learn from since right now its pretty much just stiff sporty cars or big trucks), but I find it difficult to set up my own. For example the issue right now for me, that a car I am setting up, appears to be a bit too bouncy no matter how I set up the dampers and springs. For example driving over a speed bump or big kerb like obstacles will bounce the car up like a lowrider while in an ideal simulation situation suspension of a normal car should absorb the bumps better. I tried to play with the damper values, but increasing them pretty much just stiffens everything up and the car still bounces up a bit too agressivley imho. Also there is this message that pops up with recommended spring value, if it is set too low? Im wondering if that mesage takes in consideration the wheel count of the vehicle? So yeah, I hope what I wrote makes sanse :) Basically Im trying to figure out some sort of formula/guide for realistic spring values depending on vehicle weight value.
     
  48. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    Have you tried the Whell Controller 3D demo? There is a jeep in there. If you like that setup send me an email with your NVP invoice and I send over WC3D. Do not buy it as it is already included inside NVP (minus the demo scene in question).

    I am currently negotiating a less street oriented vehicle (most likely a pickup / jeep) since the current scene does not have any in-betweens between the cars and the monster truck.

    There are two reasons why you are experienced lowrider behavior as you call it. One is bottoming out. Bottoming out can happen either due to the suspension setup or due to the spring travel being too low. I recommend 0.2 to 0.4 or street vehicles and 0.4 and above for anything that is offroad oriented - in general I would recommend longest suspension travel possible. The reason is that the suspension might get fully compressed inside a single frame and not have time to properly react (remeber, we are in dicreete time here with finite number of steps) resulting in it bottoming out and trying to correct itself sharply (just like what happens when you bottom out your suspension on car/motorcycle).

    Other possibility is suspension reacting in time and not bottoming out but reacting too strongly. Spring strenght in this instance is not that important (if within reasonable bounds) since damper is what is providing a good part of the force when going over the bump. As the name suggests, bump setting is your suspect here. Try to set it much lower than rebound setting (say 400 bump, 1200 rebound) and see if you like it. In general I would suggest playing with the values (spring force, spring curve, bump, rebound is the ones you want) and you will get the idea quickly. Also, one more tip is to check vehicle suspension setup explanations for real vehicles as they explain those things much better than me. In fact, if you come across any real suspension numbers for a particular vehicle you can input them directly since WC3D is physically accurate.

    The warnings about spring strength are just a guideline for a 4 wheeled vehicle.

    Sorry for the long post and horrid formatting, have been typing this on my phone on a train.

    EDIT: Forgot to mention, try disabling rim collider option and see if that fixes it. Rim colliders extend to a bit under the center of the wheel and if you go at high speed over a curb they might collide with curb if they do not get moved fast enough by suspension.
     
  49. Suki-W

    Suki-W

    Joined:
    Mar 11, 2014
    Posts:
    22
    Note: Arcade cars don't drift. lol :)


    The golden age of arcade car technology. God I miss those days.



     
    Last edited: Dec 15, 2018 at 1:51 PM
  50. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    554
    I would argue that there are multiple definitions of "arcade". I would classify GTA and Driver 3 as arcade and they both do drift :D
     
    Dennis_eA likes this.