Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

NWH Vehicle Physics 2

Discussion in 'Assets and Asset Store' started by NWHCoding, Apr 8, 2020.

  1. Cross_Roads_AMP

    Cross_Roads_AMP

    Joined:
    May 20, 2019
    Posts:
    8
    Great to see an update to this asset, that FBX workflow alone looks smooth enough to justify the price. I'm curious though, how easy is implementing burnout mechanics with this product? I used a competitor product that required heavy scripting and modifications to allow players to spin their wheels freely, when at a stop.

    Best example I can give is, at a full stop, players press both the accelerator and brakes to spin their wheels in place and start a "burnout."
     
  2. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    Hello,
    Unfortunately the handbrake torque is a bit on the too light side in the demo but this can be partially done in there:
    - Open the demo scene.
    - Enter the red car.
    - Click on the "Vehicle Settings" tab and adjust "Handbrake Coefficient" for Axle 0 to '1', and to '0' for Axle 1 (rear axle).
    - Hold space and add throttle.
    You will see it kinda working but the front brakes give too much which means the car will start accelerating. Still, you can see the wheel spin there. I will increase the brake torque and move the handbrake to the front in the next demo build.

    As for adjustability: everything is heavily adjustable through the inspector. I do not expect customers to have to change any code to change the behavior of the vehicle.
    I would suggest checking the following page out as it shows what is adjustable - an that is just the wheel aspect: http://nwhvehiclephysics.com/doku.php/Setup/WheelController
    You can also check other parts of the asset on that website and see for yourself if fits your needs. It is more of a documentation page but it has screenshots of all the inspectors and explanations of how the asset works which might be of interest to you.
     
  3. Guacamolay

    Guacamolay

    Joined:
    Jun 24, 2013
    Posts:
    63
    Hey, everythings been great so far, but I think I found a few bugs with the automatic gear changes...

    In my own vehicle set up, I can go up to 5th gear and release the accelerator, the revs reduce to 1000 rpm, and the the gears shift down (4th gear... 3rd gear... 2nd gear... 1st gear), all while the revs stay at exactly 1000 rpm.

    As with other games, if I release the accelerator, I would expect the revs to go up each time the transmission shifts down a gear.

    Below is my setup:
    upload_2020-5-3_22-37-58.png

    Also when driving the sports car in the demo scene, if I drive and go up a few gears, then release the accelerator, the revs reduce but the gears keep going up (e.g. I release the accelarator in 3rd gear, and the revs reduce steadily, but the gears go up instead of down).
     
  4. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    Hello,
    actually those are not bugs :)
    The first one happens because the clutch engagement RPM is too high and the clutch releases to prevent stalling (since it is set up that way it thinks it might stall). The second point is related to this. By default the wiring of the powertrain is Engine > Clutch > Transmission which means that the transmission is unaware of the engine RPM and is instead getting the RPM reading from clutch - which at this point is disengaged.
    So adjust the clutch engagement point to a lower value and you will be good to go.
     
    Guacamolay likes this.
  5. obstudio

    obstudio

    Joined:
    Sep 30, 2016
    Posts:
    58
    Hi, It will be nice if there will be a predefined set of settings for different types of behavior. For example how to set vehicle for arcade mode, drift or realistic mode.
     
  6. Guacamolay

    Guacamolay

    Joined:
    Jun 24, 2013
    Posts:
    63
    Thanks, will try that!
     
  7. Guacamolay

    Guacamolay

    Joined:
    Jun 24, 2013
    Posts:
    63
    Me again, sorry for asking so many questions, I'm new to a lot of this stuff!

    Is there a way to remove the starter stuff completely, so when I select a vehicle it starts sitting at idle rpm and not at 0 rpm?

    For some reason my vehicle rpm is limited to 5000 rpm even though I've set the rpm limiter to 7000. Even when I set my engine kw to very high values, it's still limited to 5000 rpm. I've tried to copy over the sports car values, but I'm not sure what I'm missing, the rpm is still limited.

    Thanks in advance for all the help!
     
  8. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    Are you sure it is limited to 5000 RPM - put it in manual transmission mode and rev it while in neutral. You are more then likely experiencing this because you did not adjust shift point and the transmission shifts too early.
    Also, try changing "Rev Limiter RPM" out of play mode as there is a value that is cached at Start() that might cause a problem (solver's MaxRPM which is a hidden value and set from the Rev Limiter RPM). But more than likely it is the shift point issue.
     
  9. Guacamolay

    Guacamolay

    Joined:
    Jun 24, 2013
    Posts:
    63
    It's still limited to 5000 rpm in neutral when in manual :/

    In automatic it doesn't get out of first gear and the transmission up shift is set to 6000rpm and the downshift is set to 2500rpm - it just races to 5000 rpm and stays there. Below are my settings, let me know if something here is an issue

    upload_2020-5-5_20-4-25.png
     
  10. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    Have you tried changing "Rev Limiter RPM" value out of play mode?
    Also, once you enter play mode right click on the tab just above the inspector and select Debug. Please verify the value of the following field: upload_2020-5-5_21-53-37.png
     
  11. Guacamolay

    Guacamolay

    Joined:
    Jun 24, 2013
    Posts:
    63
    Yes that was it! Max RPM doesn't seem to be visible in the engine component - is it calculated via other parameters?

    When I pressed play it would change from 5000 to 8400 but the rpm stayed limited to 5000. When I changed it to 10,000 for example, it fixed the issue
     
  12. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    It is calculated from rev limiter rpm but the issue it is solved on Start. I have added this to Trello and will be fixed for next version. The "Max RPM" value is just so that the solver does not fly into infinity if something bad happens (although solver seems to be rock solid and over the last few months never once did it have to be used).
     
    Guacamolay likes this.
  13. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    paljoci and GLID3R82 like this.
  14. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    244
    Getting this error with regards to new input system:

    Assets\NWH Vehicle Physics 2\Scripts\Vehicle\Control\Input\InputProviders\NewUnityInputSystem\NewDesktopInputProvider.cs(7,17): error CS0246: The type or namespace name 'VehicleInputActions' could not be found (are you missing a using directive or an assembly reference?)

    This was after step 4 of you documentation. (Unpack the input provider ...)
     
  15. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    It seems that the issue is that the VehicleInputActions was generated (and tested) in Unity 2019.3, before the project was rolled back to 2018.4, and the version of Unity Input System is not the same for those two. So at the moment movong to 2019.3 is one solution, but I will need to port it to 2018 too for the future releases.
     
  16. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    244
    I just deleted script, not sure it that messes anything up.

    I am already in 2019.3
     
  17. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    I mean if it works - great. Could be that they changed something in-between the versions since it is in the preview. I used the new system as it was packaged around January and it was working perfectly fine then.
     
  18. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    244
    Coppied from vehicle physics 1 thread, as its relevant to here as well.

    Unfortunately can not do that as I am using opsive UCC and realistic mass is needed elsewhere. Where is the option to freeze the vehicle when not in use?

    BTW, was able to ignore collisions using opsive UCC layers, however this only worked on the body, as the wheels seem to have colliders generated at runtime, so you cant change layer names (this is for Version 2, so ill post that on the other thread as well.)
     
  19. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    I already replied to the same question in NVP1 thread https://forum.unity.com/threads/nwh-vehicle-physics.506909/page-22#post-5822713
     
  20. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    NWH Vehicle Physics 2 now has official Steering Wheel / Force Feedback support. It will be released with the next update (0.9.3) in a few days time.



    There are also some per-vehicle adjustments available (although not required):
     
    paljoci, jrg5923 and Freznosis like this.
  21. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,490
    (1) What platforms are you supporting Steering Wheel force feedback on?
    (2) Does the force feedback part come with full source code?
     
  22. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    (1) Only the platforms that Logitech SDK works on - so Windows.
    (2) Yes it does since it is written in C#. Logitech SDK is closed source. It just uses Logitech SDK to retrieve inputs and add force so in the future if a better alternative pops up it will be easy to move over.
     
  23. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    244
    Still getting errors with regards to the new input system.

    I have started a new project, installed input system 1.0.0 and am using 2019.3.3f1 I have only imported NVP2

    I have followed your steps at http://nwhvehiclephysics.com/doku.php/Setup/Input upto and including this step:
    1. Unpack the input provider, package location is: Scripts ⇒ Vehicle ⇒ Control ⇒ Input ⇒ InputProviders ⇒ NewUnityInputSystem. Input bindings can be set by opening VehicleInputActions.inputactions file in Unity.
    After the import I get these errors:

    1. Assets\NWH Vehicle Physics 2\Scripts\Vehicle\Control\Input\InputProviders\NewUnityInputSystem\Editor\NewDesktopInputProviderEditor.cs(6,26): error CS0246: The type or namespace name 'NewDesktopInputProvider' could not be found (are you missing a using directive or an assembly reference?)
    2. Assets\NWH Vehicle Physics 2\Scripts\Vehicle\Control\Input\InputProviders\NewUnityInputSystem\NewDesktopInputProvider.cs(7,17): error CS0246: The type or namespace name 'VehicleInputActions' could not be found (are you missing a using directive or an assembly reference?)
    I have also looked at the demo's to see an example of the new system however can not find where you reference the script NewDesktopInputProvider.

    I also assuming that this step:
    1. Add NewDesktopInputProvider to the scene.
    Means create an empty game object and add the script NewDesktopInputProvider correct?

    So to summarize:

    1. How to fix the errors above?
    2. Are you using the new input system in the demos?
    3. Is the step I mentioned above (NewDesktopInputProvider) done correctly, or do I need to do it a different way?
     
  24. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    Hello,
    it is still a bug and I will have it fixed in a few hours. Will send you the corrected file and push the changes to the store afterwards. It seems that there is an issue because of different Input System version and/or packaging. The new Input System was used for development up until January and last tested in March but the Input System package version was most likely outdated by then on my installation which could have caused the issue.

    By default the asset still uses classic Unity input due to compatibility reasons and the fact that InputSystem is still in preview.
     
  25. Roboserg

    Roboserg

    Joined:
    Jun 3, 2018
    Posts:
    50
    Please include all the models from the 1st version into NWH 2!
     
    paljoci and Rowlan like this.
  26. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    244
    Thanks, input issue resolved for in Version 0.9.4. For anyone else following, you will have to repeat new input system instructions. You might also have to delete Library folder (or this might just be an unrelated issue on my side, so skip if everything is working fine.

    @NWHCoding I am now trying to integrate NVP2 with opsives UCC new drive ability, there seem to be a lot of people that use both products, so ill post a basic howto here once I have finished. If you have any experience with UCC let me know.
     
    NWHCoding likes this.
  27. thedetective456

    thedetective456

    Joined:
    Oct 1, 2019
    Posts:
    23
    Seems like the creator has too much ego. I asked to just share knowledge of how he did multiplayer on his discord and he banned me. If you don't want to help just say - "I don't want to share", don't simply kick people just because they haven't purchased stuff and ask something with you.
     
  28. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    You said that you do not own the asset but you wanted me to send you source code of how the mirror support was implemented so you can implement it in your own vehicle physics package that you developed. Might have been an over-reaction but you would be surprised how many similar requests I have received. This is not an open source asset and I can not just hand out code.
    You have also tried to get freebies earlier by requesting that I send you the truck model from NVP1 for free.
    I have revoked the ban on the Discord, but please stay on topic next time. That channel is intended for customers of NVP2 and those that are interested in it.
     
    Last edited: May 14, 2020
    Freznosis and nobluff67 like this.
  29. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    The FFB has been greatly improved and also the Monza scene has been added to the asset and will be included in the version 0.9.5.
    Official demo can be downloaded here: http://nwhvehiclephysics.com/doku.php/Demos

     
    xDeveloper, Freznosis and jrg5923 like this.
  30. thedetective456

    thedetective456

    Joined:
    Oct 1, 2019
    Posts:
    23
    Did I ever ask complete source code? You could have atleast said how you implemented, your value will not decrease if you share knowledge.
     
  31. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,886
    To sum this up: You want something for free and complain that you don't get it from a publisher who you don't support.
     
    rui-lima, Roboserg, Freznosis and 2 others like this.
  32. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    A small preview of work in progress for those that are not on Discord:
    upload_2020-5-17_1-49-55.png
     
  33. skaughtx0r

    skaughtx0r

    Joined:
    Mar 9, 2014
    Posts:
    62
    @NWHCoding I just noticed you created a force feedback implementation in here. I'm using your Dynamic Water Physics asset to create a boat racing sim (not using ShipController, I have a custom engine/propeller simulation). I was wondering if it would be possible to take advantage of this Force Feedback feature, or is it tightly coupled to the VehiclePhysics asset?
     
  34. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    It is not that tightly coupled. In fact it pretty much uses only slip and steer data from the vehicle so it should be possible to port it over with a few changes.
     
  35. robert12342

    robert12342

    Joined:
    Jun 11, 2018
    Posts:
    29
    Hi friend, I tested your physics for mobile phones and the results are very bad. My scene was very optimized fps lock I removed. Honor 9 lite 25-20 fps and this is very bad because the graphics were minimal I disabled everything that is possible
     
  36. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    The results are sure lower than expected.
    Please try the following things:
    - Set Project Settings > Time > FixedDeltaTime to 0.02 or 0.025
    - Under VehicleController > Powertrain > Solver set the Quality to Low
    - Enable 'Single Ray' under WheelController inspector.
    Also make sure that you are using mobile versions of the particle shaders (default exhaust and particles are not intended for mobile as they use soft particles and desktop shader), disable all the unneeded components under VehicleController > StateSettings and make sure that you are not using high poly models.
    Your device is not that different from the Redmi K20 I am using to test the Android builds.

    If possible could you please send a repro scene, or at least a development build with profiling enabled so I can take a look at it?
    Email is in the signature below.
     
  37. robert12342

    robert12342

    Joined:
    Jun 11, 2018
    Posts:
    29
    everything you said was done)
     
  38. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,020
    New Monza demo is great. It is though not very realistic as when in 7th gear the car can accelerate from 0 to 200kmh in 10 seconds, how is that possible from 7th gear, surely the car would really struggle to pull away. Also any chance of a drifting demo, can't do anything with this car.
     
    NWHCoding likes this.
  39. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    This is a matter of clutch tuning (not the clutch engagement, the clutch simulation settings). While the clutch is realistic and can stall the vehicle, it also needed to meet with performance expectations so it might be a bit off.
    Also, the power curve at the start of the rev range is quite aggressive which does not help.
    Lastly, if you were not scared to burn the clutch starting in 7th gear would certainly be possible in cars such as Ferrari 458 (the demo car).

    Here is an example of starting in 6th gear (not a car, but a motorcycle - still, similar powertrain):
     
  40. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
  41. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    An update is coming in the next few days with multiple improvements to the effects and game visuals in general - especially the particle systems which have been rewritten.
    Also, a new vehicle is on the way: Lada Niva. It will replace the existing Land Rover Defender.

    upload_2020-6-1_19-11-7.png
     

    Attached Files:

  42. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    As a last part of the visual improvements to the demo for the NVP2 v1.0 update comes the replacement for the existing Tatra 8x8 with one third of the polys, better UVs, topology, etc. and most importantly better look. The model has been designedand provided by Rabin Thapa (https://sketchfab.com/Rabin) under CC Attribution licence. There was some work needed to get it poly reduced, textured, etc. but I think the end result is much better than the existing demo vehicle.

    upload_2020-6-2_23-52-27.png
     
  43. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    307
    Hi.

    I am testing the FFB and it is impossible.

    I have two wheels. A Logitech and a Thrustmaster. But none of them detect me.

    I have followed the steps of the instructions one by one ... and nothing.

    I have my own library that detects any steering wheel and allows configuration. And it works, so it's not my hardware problem. I would try to integrate it, but it requires time that I don't have. I prefer to use yours, initially.

    Any ideas please?

    Thank you.
     
  44. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    That is interesting. I have tested on a Logitech Driving Force Pro and a customer has tested on a Thrustmaster wheel. Logitech SDK is used (which uses DirectInput which is the reason why other than Logitech wheels work with it).
    Could you try the demo that is shipped with the Logitech SDK?
    Also, have you followed the steps here: http://nwhvehiclephysics.com/doku.php/NWH/VehiclePhysics2/Input/SteeringWheelInputProvider?

    EDIT: Also, if you download the Logitech SDK from here there is a test .exe. Does it detect your wheel?

    And lastly feel free to join the Discord channel in the description. It is much better and faster way to communicate.
     
  45. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    307
    Yes, I have done all the tests.

    As I tell you, I have my own library that works well and detects all the devices I have, including XBOX.

    Of course I have done the tests, I have followed the manual, I have changed the version of Unity ...

    I'm going to modify the SteeringWheelInputProvider script with my code. It will take longer, because I will have to review the consequences in the rest of the modules, but I don't know what else to do.

    Thank you anyway.
    A greeting.
     
  46. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    244
    Does this mean the Land Rover will be overwritten?
     
  47. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    Yes, although I will leave the model in the asset.
     
    nobluff67 likes this.
  48. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,274
    This is really interesting. Is there any chance you could send the project over? There really is no reason why it would work with the Logitech Steering Wheel standalone demo application and not work with SDK in Unity since they use the same dll at the back.
    If you could send over a repro project with the exact files you are using (SDK, etc.) I will immediately take a look at it.
    And lastly are you using Win32 or Win64? I had an issue with using 32bit Logitech driver on 64bit Win10 installation a few months back with similar symptoms as yours, but the standalone SDK demo also did not work for me.
     
  49. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    244
    I have another question for new vehicles. The specifics, e.g. differential info, clutch info, engine info. Where do you get all this information? For example, if the bus didn't exist in the asset, and you found a model, where do you get this info?
     
  50. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    307
    Hi.

    My first impression is very positive. This product has a lot of parameters that others called "pro" do not have.

    I really like that they think about what racing cars really are and that they have those values and effects.

    I need to try a "hardcore" configuration to see if the pitch and roll sensations are like the "pro", which are actually very good. Honestly.

    I hope so.

    On the other hand, I also hope that the project is not abandoned. But it is only my opinion.

    When I have a more accurate assessment, I will put it in the product reviews

    Thanks and great work.
     
unityunity