Search Unity

NWH Vehicle Physics 2

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

?

What would you like to see implemented next?

Poll closed Feb 12, 2023.
  1. FMOD sound module

    0 vote(s)
    0.0%
  2. Tracked vehicles

    3 vote(s)
    30.0%
  3. Softbody wheels

    7 vote(s)
    70.0%
  4. Something else (mention in the thread)

    0 vote(s)
    0.0%
  1. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Hello and thank you for the feedback. The project is not abandoned for sure. In fact since the release until now I have spent almost every day working on it and have even reduced the number of assets I offer so I can focus on it.
    I post updates on the progress almost on daily basis on Discord (link in description) and even as I write this there is an update in the workings focusing on the polish - effects, demo scene, cameras, etc.
    So in short I have been working on the asset for over half a year on a daily basis. I really do not know where you got the idea that it is abandoned?
    Besides, the motorcycle module and tank module are in the workings.
     
  2. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Hello,
    a lot of info can be found on the basic specifications around the internet. E.g. engine specs, gear ratios (EATON, one of the transmission manufacturers, even has them on the official website), power curves (google "[engine name] dyno" or similar), etc.
    Some info on the other hand has to be understood. Usually reading a Wikipedia article or similar will get you the idea about what you want and you can start from there. I also use reference videos a lot to see how things should behave.
    As for clutch this is adjusted by feel, so to say. Clutch works pretty much the same across all the vehicles so just fine tuning is required.
    And lastly, for differentials you pretty much just have to know which type it is if you are setting up a bus. And with 98% certainty I can tell you that all 'normal' buses on the road have open differential. Not much more info needed than that.
    Hopefully this helps.
     
  3. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374

    It was nothing personal.
    It is an opinion of what many do in a general way.

    And a request that it not happen.

    Without further ado.
     
  4. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Easily the best supported vehicle asset in the store. The "competition" are basically inactive. I understand what you are trying to say thou.
     
    Barritico likes this.
  5. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Hi.

    Is a repetition system planned in the roadmap?
    Thank you.
     
  6. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    As in replay? It has not crossed my mind and this is the first request. Certainly a good idea.
    Current roadmap is:
    Visual Fidelity Improvements (currently working on) > Motorcycles > Tanks
    As soon as those get done I will start looking into other features.
     
    Mixa1985 likes this.
  7. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374

    Ok. thanks.
    Good luck!! I will keep an eye on the evolution.
     
  8. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    All the features and fixes for version 1.0 are done and the update will be available in ~2 days. Changes are:
    • Major demo improvements: two new vehicles (Lada / Rocket Carrier), mirrors and interiors on all the vehicles, camera improvements, etc. Optimized Ferrari and Monster Truck models.
    • Rewritten exhaust particle code for better visuals, performance and ease of setup.
    • Improved surface particles / dust. Both dust and smoke are now using the same ParticleSystem and particles are emitted on per-wheel basis.
    • Added dirt chunk / pebble particles.
    • Improvements to SurfacePresets with extended and improved settings.
    • Added camera shake on collision.
    • Make 'Validate' option validate model scale and SurfaceMap tags.
    • Added “IsGrounded()” and “IsFullyGrounded()” functions to the VehicleController.
    • Fixed VehicleChanger thowing an error when there are no vehicles present in the scene and 'Character Based' is used.
    • Disable CameraMouseDrag movement while mouse is over UI.
    • VehicleCameras now auto-find target.
    • CameraMouseDrag has been rewritten with a few improvements: smoothing now keeps constant distance from the vehicle, implemented panning, new options to enable/disable dragging/panning, target position offset, initial look angle.
     
    Mixa1985, xDeveloper and GLID3R82 like this.
  9. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    One question: Is anybody using Unity 2018.x?
    Since 2019.4 LTS just got released I am thinking about moving the asset to 2019.3 (most users use this variant of 2019.x). There was a poll on Discord which ended in 6 (2019.x) to 0 (2018.x) users but I want to confirm with people that might not be on Discord.
     
  10. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
  11. SufferinPup

    SufferinPup

    Joined:
    Jul 7, 2012
    Posts:
    24
    Do you have an idea of when the tank module will be released? Is that something you are planning on adding within the next few months, or is it really far off? Thanks for any info.

    BTW We are on 2019.3 now, and will upgrade to .4 eventually.
     
  12. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    I have just upgraded the asset to 2019.3 since there have been 15 votes for 2019.x and only one vote for 2018.x. I would rather develop for current version and with current packages (i.e. InputSystem 1.0 is not available for 2018.4) so the asset is moving forward.

    The tanks will definitely be there under a few months. Motorcycles first since that module got ~90% of the votes and then tanks. The tanks in v1.0 were an afterthought and this time around both motorcycles and tanks will be on a much higher quality level than the tanks ever were in the first version. Hence the longer development time.
     
    Rowlan likes this.
  13. Slowin

    Slowin

    Joined:
    Mar 6, 2015
    Posts:
    62
    I have a problem with the speed limiter module as it does nothing right now. I added the module component and activated the module in the settings. I try to limit to 48 kmh. I tested with different vehicles.

    What can I do here?
     
  14. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Interesting. I just now tried it and it works fine.
    Make sure that you have khm selected in the inspector instead of m/s:

    upload_2020-6-10_18-44-5.png

    Also, try a lower value (say 10) and if it goes up to 36 km/h it means that you set it in m/s.
    Also, make sure it says both "Enabled" and "On" in green when you enter play mode.
     
  15. Slowin

    Slowin

    Joined:
    Mar 6, 2015
    Posts:
    62
    It is "enabled" and "on" but "active" is not checked. It still does not work even with 10 kmh.
     
  16. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Could you please try doing this:
    Open the desktop demo scene and add the SpeedLimiterModuleWrapper to the SUV/Lada (depending on which version you are using). Set the inspector to be as in the screenshot above. Try accelerating. On a vanilla install of NVP2 it works for me.
    Also, are you setting the value from the script of from the inspector?
     
  17. Slowin

    Slowin

    Joined:
    Mar 6, 2015
    Posts:
    62
    It does work in the demo scenes and "active" is enabled there in the module component when I hit the speed limit. So something has to be different there.

    I'm instantiating my vehicles during runtime from script. Could this be the problem?
     
  18. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Could you by any chance share the script over the email so I can take a look at it. Could be a bug that happens in that case. Even better would be a repro scene if possible.
    It could be that the module is not registering with the VehicleController and therefore not being updated. Could you do a simple Debug.Log() somewhere in the update code of the SpeedLimiter module to see if it is being called at all?
    Also, if you can join our Discord: https://discord.gg/59CQGEJ The response time there is much faster.
     
  19. Slowin

    Slowin

    Joined:
    Mar 6, 2015
    Posts:
    62
    In SpeedLimiterModule.cs Initialize() is called but line 57 is not:

    vc.powertrain.engine.powerModifiers.Add(SpeedPowerLimiter)

    I'm adding the vehicle controller and the modules to my prefab via editor. During runtime I simply instantiate the prefab and don't do anything else.
     
  20. Slowin

    Slowin

    Joined:
    Mar 6, 2015
    Posts:
    62
    And SpeedPowerLimiter() in SpeedLimiterModule.cs is also never called.
     
  21. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    I have managed to reproduce the issue by entering the vehicle in the demo scene and adding the module *after* the vehicle has woken up. It seems that in this case the module either does not get added or does not get enabled. Will have more info in a few moments.

    Edit: The issue is with the module not registering with the asset since ReloadModulesList() is only called when the vehicle wakes up. Are you adding the modules through scripting too or are they part of the prefab? In case of scripting make sure to use ModuleManager.AddModule instead of MonoBehaviour.AddComponent as the AddModule registers the module within the asset.
    Alternatively you could try calling ReloadModulesList() manually. I will try to find a better solution to this.

    Edit2: I have sent you the fixed ModuleManager script in the PM.
     
    Last edited: Jun 10, 2020
  22. Slowin

    Slowin

    Joined:
    Mar 6, 2015
    Posts:
    62
    The modules are part of the prefab. I tried to call ReloadModulesList() manually but to no avail.
     
  23. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Version v1.0.1 is on the way with the following changes:
    • Improved the way module list is reloaded in editor, removing the delay between clicking on the modules tab and the modules being drawn.
    • Fix modules added after vehicle is initialized, either through scripting or inspector, not registering.
    • Fixed missing trees in the demo scene.
    • Fixed two audio listeners being present in the scene for the first fame when CharacterVehicleChanger is used.
    • Renamed “NewDesktopInputProvider” to “InputSystemProvider” to prevent confusion.
    • Added ground check to the CameraMouseDrag.
    The minimum required version of Unity for this and upcoming versions will be 2019.3.
     
  24. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Check the PMs for the fix. With the new ModuleManager script it automatically adds the module and sets it up no matter if in editor or play mode. I have not tried instantiating from the script but have tried dragging a prefab manually during the play mode (should be equivalent to instantiating from script) and the issue seems to be resolved.
     
  25. Slowin

    Slowin

    Joined:
    Mar 6, 2015
    Posts:
    62
    It does work now. Thank you very much for the very fast support!
     
  26. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    If anything else pops up I am here. As mentioned I would suggest joining Discord for faster response times as I only check the forums a few times a day while the Discord is always open.
     
  27. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Update v1.0.2 will be an Input update. Apart from the suggestion from @Sopcen to separate the Vertical input into Throttle and Brake there will be changes such as move to the new InputSystem and better controller support with the demo scene supporting both kb/mouse and controller inputs.
    Since about 70% of the customers seem to still use the old Unity system it will still continue to be supported going forward, just not the default. The way the new InputSystem works does not require it to be set up before use which means that the input actions are contained within the asset itself and not the project settings which enables the asset to work out of the box.
     
  28. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Unity 2019 is not polished, stable, and optimized, especially for mobile. I'm happy to hear that you will support older Unity versions. I was afraid that I will need to abandon the plan of switching another vehicle psychics with your NVP2.
     
  29. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Actually, it is quite polished and stable, especially the last few releases. Besides, the LTS is here and according to the poll on Discord over 90 percent of the customers use it - so it can not be that bad. There are a few reasons for the move such as the InputSystem, SerialiseReference and better physics performance.

    I will continue releasing updates for 2018.4 LTS but on a slower basis as they need to be backported. I.e. instead of weekly it will be monthly or bi-monthly - up to some point - so if you are stuck with the 2018.x do not worry.
     
    Last edited: Jun 16, 2020
  30. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Version 1.1 is nearly done. Needs a bit more testing and will be available in 2 to 3 days.

    Changes:
    • Removed the need for disabling “Queries Hit Triggers” and “Queries Hit Backfaces”.
    • Split “Vertical” axis into “Throttle” and “Brakes” to allow for simultaneous application of both.
    • Added optional bindings: CameraRotation, CameraPanning, CameraRotationModifier, CameraPanningModifier, CameraZoom, FPSMovement and ToggleGUI. This allowed for removal of all the hard-coded inputs in the asset code and all the input now goes through InputProviders.
    • Improved ImputSystem support and made InputSystem default input method.
    • Renamed “NewDesktopInputProvider” to “InputSystemProvider” to prevent confusion.
    • Improved InputSystem with additional, optional bindings: CameraRotation, CameraPanning, CameraRotationModifier, CameraPanningModifier, CameraZoom, FPSMovement and ToggleGUI. This allowed for removal of all the hard-coded inputs in the asset code and all the input now goes through InputProviders.
    • Added gamepad support to the demo scene.
    • Removed shift ban timer from manual transmission.
    • Implemented 'GearShift' class which contains data about the currently occuring gear shift and is used by 'OnShift', 'OnUpshift' and 'OnDownshift' events.
    • Renamed Input.AutoSettable to Input.AutoSetInput since the old name was causing confusion.
    The website also got the Upgrade Notes page to make updates between versions as painless as possible.
     
    Last edited: Jun 19, 2020
    GLID3R82, xDeveloper and csummers88 like this.
  31. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    The update 1.1 got expanded. List of changes above has been updated with the newly added changes. It has just been submitted and will be available as soon as it gets approved by the Asset Store.
     
    GLID3R82 and csummers88 like this.
  32. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Update v1.1.1 is coming out. Most changes are hotfixes related to 1.1 release and upgrades to the steering wheel support.

    Changes:
    • Changed how engine losses are calculated to allow the engine to rev more freely. Vehicles will feel slightly more powerful after the update.
    • Fixed unneeded using directives introduced in 1.1 preventing the build from finishing successfully.
    • Added “Hold To Keep In Gear” option to the transmission. This makes the transmission H-shifter friendly. When the option is enabled an input has to be held for the transmission to stay in corresponding gear, otherwise it goes to neutral.
    • Added all available axis options to SteeringWheelInputProvider.
    • Removed shift ban timer (delay between shifts) from manual transmission which would get interpreted as the gearbox not receiving input.
    • Fixed errors caused by the SteeringWheelInputProvider not having been updated to the 1.1 InputProvider overrides.
     
  33. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,295
    Just downloaded the latest update. Had to try a new scene, climbing up that hill :D

    c1.jpg
    c2.jpg
     
  34. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Version 1.1.2 is on the way with more bug fixes and improvements:

    * Fixed 'autoSetInput' automatically being set to true when vehicle wakes.
    * Fix lights not turning on properly (bug introduced in 1.1)
    * Removed delay between activating a blinker and it turning on.
    * Fixed blinkers sometimes not canceling each other.
    * Rewritten LightManager logic.
    * Minor bug fixes and improvements.
     
  35. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    FYI, IK Avatar Driver asset developer has submitted NWP2 compatibility update.
     
    Rowlan and NWHCoding like this.
  36. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Version 1.1.3 is on the way with the following changes:
    • Input bug fixes related to engineStartStop, boost and light inputs (input not registering or registering multiple times). Introduced in 1.1.2.
    • Added options for non-zero-index rglSliders to SteeringWheelInputProvider.
    • Fixed issue where blinkers and hazards could be active at the same time.
    • Minor bug fixes and improvements.
     
    Last edited: Jun 23, 2020
    csummers88 and Rowlan like this.
  37. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    In the future NWH Vehicle Physics 2 and Dynamic Water Physics 2 (and a possible future asset) will share the same 'common' code. This includes cameras, parts of input (related to cameras and scene), first person controller, NUI (NWH's editor drawing framework), vehicle changing and a few other scripts. This will remove code duplication between those assets and improve on development times for both. As a side bonus switching between cars and boats will work if those are in the same scene without any need for code modification.
     
    Mixa1985 and nobluff67 like this.
  38. lukeluzardo

    lukeluzardo

    Joined:
    Dec 9, 2017
    Posts:
    22
    why did you remove nwh1
     
  39. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    It will be back on the store in a few days. It was removed to the NVP2 being released by I realized my mistake and resubmitted the asset. Still, if you are starting a new project I would strongly suggest moving to NVP2.
    Check http://nwhvehiclephysics.com to see what is different from NVP1.
     
  40. fredastaire

    fredastaire

    Joined:
    Sep 10, 2017
    Posts:
    90
    How will nwh2 work with irds like nwh1?
    Or will it be easier to make ai based off your physics
     
  41. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    The integration should be more or less the same as the input concept was carried over from NPV1 (not the code tho). You can see towards the bottom of this page how the input works: http://nwhvehiclephysics.com/doku.php/Setup/Input.
    But basically everything can be done with two floats, one for steering and one for throttle and braking.
    Some customers have stated in the Discord channel that they have gotten it working without many issues with different AI systems so it should not be an issue.
     
  42. Dobalina

    Dobalina

    Joined:
    Sep 6, 2013
    Posts:
    105
    Hello @NWHCoding , I'm looking for some way to increase my vehicles engine performance at runtime with PlayMaker. My problem is that Max Power variable isn't accessible. I'm an Artist, not a programmer, so unfortunately I'm limited to using PlayMaker. Is there a way I can expose the Max Power? I'm on the latest NWH2 and Unity2018.4.23

    engine.jpg
     
    Last edited: Jul 6, 2020
  43. Mariusz_H

    Mariusz_H

    Joined:
    May 4, 2018
    Posts:
    18
    I downloaded NVP2 Demo and this happens every time I run it ;)

     
  44. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Will check it out. That is some weird behavior that I never saw before.

    Edit: Checked it out in the demo scene in the editor with the latest version and it happens - but only when the trailer is connected. From the suspension values it seems as if something is pressing the vehicle into the ground but the mass does not change. Disabling "Freeze When Asleep" fixes it. Therefore my guess is that the Physics joint does not like this and drives the vehicle into the ground.
     
    Last edited: Jul 6, 2020
  45. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    It should be a public property under vehicleController > powertrain > engine. Are there more properties under "More" option?
     
  46. Dobalina

    Dobalina

    Joined:
    Sep 6, 2013
    Posts:
    105
    Hi, thanks for the quick reply. At first it appeared there were no further options under "more" because when I click on that, the large list of attributes vanished, but I was wrong. Playmakers UI to access the engine values was really small in another location of the screen. I originally never saw it.

    It looks like I can access all the values I need now. Thank you!
     
    NWHCoding likes this.
  47. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Glad you got it working. Consider joining the Discord channel in the signature for faster support if you every need anything else. Good luck with the project.
     
  48. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Version 1.2.1 is on the way with the following changes:
    * Added weight sensitive WheelController defaults.
    * Made it possible to create a vehicle from a script at runtime using VehicleSetupWizard.RunSetup().
    * Fixed trailer drives the towing vehicle into the ground when 'Freeze When Asleep' is enabled.
    * Fixed insideVehicle property warning for sound property drawer.
    * Moved VehicleModule Awake() call to after the vehicle is fully initialized.
    * Fixed issue with VehicleComponent.Enable() getting called before VehicleComponent.Initialize().
    * Fixed ShiftInto not getting triggered when using 0-9 keys in the demo.
    * Fixed SteeringWheelInput compile error 'VehicleChanger' does not contain a definition for 'ActiveVehicleController'.
    * Fixed 'Constrain When Asleep' not working.

    Expect it in one to two days.
     
    Mixa1985, paljoci and Rowlan like this.
  49. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Version 1.2.2 is on the way with the following changes:
    * Fix input in Monza demo scene.
    * Fix VehicleSetupWizard throwing an error due to a null value of VehicleRigidbody.

    Both issues have been introduced in 1.2.x
     
  50. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    To anyone who has just purchased the asset and is having issues with VehicleSetupWizard - this is a known bug. The update has already been pushed and hopefully will be available for download tomorrow. If you need the fix sooner send me an email or contact me through Discord (both are in signature).

    If you want to fix it yourself - go to VehicleController.cs and add the following code to the beginning of ApplyInitialRigidbodyValues() - line 331:

    Code (CSharp):
    1.             if (vehicleRigidbody == null)
    2.             {
    3.                 vehicleRigidbody = GetComponent<Rigidbody>();
    4.             }