Search Unity

Dynamic Water Physics 2 [Released]

Discussion in 'Assets and Asset Store' started by NWHCoding, Jul 3, 2019.

  1. tgamorris76

    tgamorris76

    Joined:
    Apr 24, 2013
    Posts:
    292
    It turns out its working but the water plane needs to be at height 0?
     
    dsilverthorn likes this.
  2. jkh0208

    jkh0208

    Joined:
    Aug 23, 2019
    Posts:
    18
    I bought this pack, and I have a popup that says "First time DWP2 setup" with a set of instructions, but there's no way to close the popup and it blocks my Unity screen. It comes up when I close and reopen the project in Unity too.
     
  3. jkh0208

    jkh0208

    Joined:
    Aug 23, 2019
    Posts:
    18
    Dev, could you please let me know if there is a fix for this? Your message popup is still blocking Unity.
     
  4. jkh0208

    jkh0208

    Joined:
    Aug 23, 2019
    Posts:
    18
    Still having this issue, and have been unable to use this plugin. Does the dev still support this plugin?
     
  5. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    He may not be getting the notices from Unity, I know that seems to happen a lot.
    Try getting him through email or PM. I know he is still around and is usually quick on issues.
    Website: http://nwhcoding.com
    Email: info@nwhcoding.com
     
    NWHCoding and jkh0208 like this.
  6. jkh0208

    jkh0208

    Joined:
    Aug 23, 2019
    Posts:
    18
    Will do, thanks!
     
    dsilverthorn likes this.
  7. DeidreReay

    DeidreReay

    Joined:
    Oct 28, 2019
    Posts:
    50
    has anyone had any luck trying to get a character to swim using this asset? Have been working through with Invector character controller and will keep you guys updated, but wondering if anyone has had any luck as of yet
     
  8. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Hello and sorry for the delayed response. For support questions please contact me at nwhcoding@gmail.com as the forums tend to just cut off notifications on one thread without any reason.

    Make sure that under Project Settings > Player you have defined "DWP_CREST" or whichever scripting symbol is appropriate for your water. There is a list in the manual of all available scripting symbols.
     
  9. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    With the new update this should be fixed.
     
  10. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    All the setup steps have been removed and the window too so hopefully that solves the problem.
     
  11. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Thanks for that. It is exactly what happened. If you check my post history I have been replying to the forums at least four times a day but never got a single notification from this thread. But yes, since I have push notifications for email that is always the best bet.

    Email is nwhcoding@gmail.com but the above one works too.
     
  12. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    To get the character to work attach primitive shapes on it's limbs and torso, this way it will be excellent performance wise and get around the skinned mesh limitation. It really is best for ragdolls (e.g. somebody drowned and is now floating) but swimming might be possible too as long you fake it a bit by applying external force. It is theoretically possible to make the character swim just by movement alone but I do not see it being easy to tune.
     
    dsilverthorn likes this.
  13. ChristianWiele

    ChristianWiele

    Joined:
    Sep 27, 2017
    Posts:
    3
    Hi,

    I am trying to get DWP2 to work with Crest URP, but my ship is not reacting to the waves. It just swings a little around the average water hight. The console reads "DWP2: Using Crest", so the setup seems to be correct. I also played with the weight of the ship, but no effect.
     
    NWHCoding likes this.
  14. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Crest developer and I are working on this right now. It seems to be an issue with water height reporting with the new Crest API. Expect an update in a few days.
     
    MythOfNight likes this.
  15. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Update has just been submitted to the asset store (version 2.1.3). It should be approved and visible within 48 hours.

    Changes:
    - Fixed Crest water height queries.
    - Improved performance when using Crest or Lux Water.
    - Crest and Lux demo scenes.
    - Moved documentation to http://www.dynamicwaterphysics.com.
     
    StarChick971, 3dship and Vincent454 like this.
  16. StarChick971

    StarChick971

    Joined:
    Nov 28, 2015
    Posts:
    118
    Thank you for the Crest water height fix!
    By the way, I would like to know how to make boat or any floating object slide down a big water slope (Crest wave bump)? For instance, you have a tall tsunami wave and a boat not moving on the front steep face:
    currently: boat not moving and just remains at water height even with high pitch.
    expected: the boat should start sliding downward.

    Would it be possible to get the average normal of boat intersecting the water? Then simple trigonometry to add fake gravity force to move the boat at some angle -> higher the pitch angle, faster the boat moves depending of the cross section (boat moves faster forward but not sideways)
     
  17. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Hello,
    I have noticed that Crest has added velocity API that is identical to the height API, and DWP2 already has support for water velocities so integrating this into DWP2 will hopefully solve the problem and increase the quality of the interaction with water. I will add this in the next update, although I can not say for sure when it will be out.
     
    StarChick971 likes this.
  18. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    StarChick971 and 3dship like this.
  19. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Dynamic Water Physics 2 is getting a larger update. The focus will be to improve usability (better editor, easier debugging, etc.) and I will be porting the input code from NWH Vehicle Physics 2 over to DWP2 since it is much better. There were a few requests to improve input so here it is. Check out the NVP2 docs to see what you can expect: http://nwhvehiclephysics.com/doku.php/Setup/Input

    Also, I will be looking into R.A.M. integration and other issues that were discussed here and on Discord since the last update.
     
  20. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    So does this mean that DWP2 and NVP2 will play nicely together and make switching from car to boat an easy process? :)
     
  21. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    No. :D
    But should not take more than a few minutes to rig this up.
     
    dsilverthorn likes this.
  22. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Sounds good, when you get it done, please give us the details of how to do it.
    Looking forward to it! :)
     
  23. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    v2.2 is getting a whole WaterDataProvider redesign. These will be MonoBehaviours in the future, with no preprocessor directives and tag juggling. Add a script to your water and press play. Really, the way it should have been from the start. To get around errors when the water script (such as Crest) is not present the unused water data providers will have .cs.txt extension so that they are still viewable but do not get compiled.
     
  24. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    This will happen after all as I have unified the Camera code to work across assets and not be vehicle specific. All the NWH vehicles from now on will inherit form a base class Vehicle which holds common data to all types of vehicles. This will reduce the code duplication across assets by a lot.
     
    Last edited: Jun 27, 2020
    dsilverthorn likes this.
  25. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Excellent work!!
    Very good news!
    Thank you!
     
  26. 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.
     
    Mark_01, shyamarama and dsilverthorn like this.
  27. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Thanks so much!
    You are making our lives easier :)
    Much appreciated!
     
  28. 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.
     
    Mark_01, 3dship and dsilverthorn like this.
  29. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    I have managed to improve the performance of DWP2 by as much as 300% over the past few days, amongst other things that I will list here when they are fully implemented. 2.2 should be a great update :)
    Not that the previous version was not already heavily optimized.

    Photo of the profiler that I used to showcase DWP2 2.1 performance in the asset store:


    Same scene, same number of triangles and with "High Resolution Water Queries" enabled at that in the upcoming version:
    upload_2020-6-30_23-50-39.png
     
    Last edited: Jun 30, 2020
  30. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    A small announcement: if you are using Crest make sure to enable Vsync in your project. There seems to be an issue when queries are sent to Crest at different rate than the graphics update which is a bug with Crest query system and was confirmed by Crest dev, Huw Bowles. So if FixedUpdate is running at 50Hz and Update at 300Hz/FPS Crest will have issue with returning queries and will sometimes take up to few seconds to return anything. Enabling Vsync mitigates this issue and is the only solution until the bug gets fixed in Crest.

    On a more positive note DWP2 now supports water normal queries. In v2.2 Crest will therefore support water heights, water flow and water normals making the simulation more realistic when dealing with moving water, such as this whirlpool. White spheres are water positions, yellow lines water normals and red lines water velocities.
    upload_2020-7-2_15-21-49.png
     
  31. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Official support for R.A.M. is on the way. Water heights and normals work perfectly and I am currently working on flow which is expected to work fine as well.

    upload_2020-7-8_15-58-8.png
     
    Last edited: Jul 8, 2020
  32. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Excellent news!
    I might get to go over a waterfall afterall!:D
     
  33. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    v2.2 got another major performance upgrade just now. It now welds co-located vertices to make sure that each point is queried only once. This reduced WaterDataProvider calls a lot.
    E.g. the Barrel prefab from the demo scene now does only 16 calls compared to 84 calls earlier.
    The way the triangles were handled was a leftover from DWP1 and should have been improved earlier. There will be no difference in performance for flat water but Crest / R.A.M. / Ceto and others will get a major performance boost, especially in scenes with many objects.

    There has also been some feedback from beta testers so as soon as I implement that and test everything the asset will be up on the store.
     
    StarChick971, dsilverthorn and 3dship like this.
  34. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Here is the screenshot of the profiler running 100 Barrel prefabs in Crest's Whirlpool demo scene. 100 Barrels equates to 3360 triangles. This is with everything enabled (including normals and flow queries).

    upload_2020-7-22_0-28-59.png
     
    Last edited: Jul 21, 2020
    3dship and dsilverthorn like this.
  35. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    v2.2 is out. There have been a lot of changes so this first version of 2.2 will most likely have some bugs. Also, due to the amount of changes please check the upgrade notes.
     
  36. NyeinZL

    NyeinZL

    Joined:
    Mar 17, 2019
    Posts:
    10
    Assets\DWP2\Scripts\WaterObject\WaterDataProvider\CrestWaterDataProvider.cs(13,17): error CS0246: The type or namespace name 'IFlowProvider' could not be found (are you missing a using directive or an assembly reference?)

    I got this error when I tried to use Crest.
     
  37. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Hello,
    one other customer got this error too for some reason and reimporting fixed the issue.
    IFlowProvider has been a part of Crest for quite a long time and the error should not be because of outdated Crest
    but try to do a clean import of the asset from https://github.com/crest-ocean/crest and check if you have IFlowProvider.cs script in the Crest directory.
     
  38. NyeinZL

    NyeinZL

    Joined:
    Mar 17, 2019
    Posts:
    10
    I've tried reimporting, the error stills appeared. Also I've tried a clean import from github. There is no IFlowProvider.cs script in the Crest directory. I've also checked the dialog box when clean import, there is no IFlowProvider.cs script. o_O
     
  39. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    My bad, it is FlowProvider.cs. It certainly is on git: https://github.com/crest-ocean/cres...Crest/Crest/Scripts/Collision/FlowProvider.cs and Crest itself uses IFlowProvider in OceanRenderer and other scripts. The namespace is same as for the rest of Crest so this is very bizzare issue. Check if you have FlowProvider.cs and if it looks the same as on git.
     
  40. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    v2.2.3 is on the way with the following change:
    • Fixed foam particles not being generated by WaterParticleSystem.
     
    Rowlan and dsilverthorn like this.
  41. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,293
  42. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    Just bougth DWP 2 and I am trying to setup it with a dynamic morphing plane to make a surf wave.

    I am using Lux water as the shader and works just fine with my morphing plane.

    The morphing plane has a collider that is updated each frame ( I am using Mega Fiers point cache to do that).

    So for DWP2 to work with my plane I have to use the RaycastWaterDataProvider for that plane, so the surfboard ( or a boat, jetski) can climb the surf wave.

    But I failed to do the setup (set the collider and the layers as in the RAM setup). The boat collides with the plane as normal, not as a boat floating in the water


    Can you help ?
     
    StarChick971 likes this.
  43. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Sorry for not replying earlier - forum notifications keep getting bugged.
    Please try disabling "Simulate Normals" under WaterObjectManager - this is a known bug with that water provider and will get fixed soon.
     
  44. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Update v2.2.4 is on the way with the following changes:
    • Fixed 'Simulate Water Normals' option causing issues with RigidobdyWaterDataProvider when used with a plane.
    • Fixed two audio listeners being active at the same time when changing a vehicle.
    • Updated NWH/Common directory to match NVP2.
    • Fixed steering value range in editor.
    • Fixed sound sources not being visible in the engine inspector.
     
    dsilverthorn likes this.
  45. Bitcore

    Bitcore

    Joined:
    Apr 14, 2018
    Posts:
    6
    Hello, love your assets, they offer really great simulations at affordable frame rates!
    I'm planning to use them as one of the core mechanics in my game.
    I was wondering is there a smooth way how to combine NWH2 CharacterVehicleChanger script to work with AdvancedShipController script DWP2, with out rewriting CharacterVehicleChanger or/and VehicleChanger scripts? maybe by using unity's even system or should I try to write a separate script for handling entering/exiting vehicles and ships?
    To be honest I'm bit over my head here, coding skill wise, still not far from novice levels.
    Sorry if it's a silly question, would appreciate any hints or help.
     
    dsilverthorn likes this.
  46. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Hello. I am happy to report that if you are using latest versions of both (NVP2/DWP2) you can. Just make sure to remove NWH/Common folder from one of them or you will have duplicate scripts.
    Some time back I have unified common scene code so the vehicle chagers, cameras and other scripts are shared by the two.
     
    Bitcore likes this.
  47. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Would it be possible to get a step by step instructions on how to do this for those of us who are not coders. It would be nice to have Playmaker functions to simplify it for us.
     
    Bitcore likes this.
  48. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    Sure.
    Say that you have NVP2 already imported and want to import DWP2, do the following:
    * Go to NVP2 > Scripts > NWH and delete the folder named "Common".
    * Import DWP2 from the asset store.
    Vice versa is the same. If Unity gives you issues after this, an alternative would be to import one of the two assets into an empty project and manually copy it over (after deleting the Common folder).

    I am right now submitting versions of both assets and will ask Unity where the assets will be structured like so:
    NWH
    |- DWP2
    |- NVP2
    |- other future assets
    |- Common
    This will remove the need for the above steps.
     
  49. Bitcore

    Bitcore

    Joined:
    Apr 14, 2018
    Posts:
    6
    Ok thank you, this was done automatically when importing both (NVP2 and NWP2), but I'm still having trouble with adding ships (they aren't showing up) to VehicleChanger script elements.

    NVP2.png

    I've tried several tag changes, unpacking prefabs etc.
    I'm probably missing something, so could you please write a quick guide or tutorial on this, it would be highly appreciated, thank you!
     
  50. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    1,692
    The script (VehicleChanger) is exactly the same in both assets since it is symlinked on my PC. From what I can see you are trying to assign a prefab instead of the scene instance. You have to drag the prefab into the scene and then drag it from the scene view.