Search Unity

[RELEASED] Realistic Water Physics - V 2.2 .1 (More asset supported!)

Discussion in 'Assets and Asset Store' started by imtehQ, Jul 31, 2016.

  1. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    With the interface you dont need to think about code, the interface will do the work for you.
    The advanced options can help you out if you need more options.

    Right now the best way to work with gameobjects with more then 1 collider or childs with colliders is to do the setup with each of those objects and connect them with flixed joins and disable collidions with each other.

    The materials are indeed based on a set of numbers, those are the density of real materials, you can add more of them yourself and there is a bit of info in the code to help you out, we are working hard to add a way to add them yourself while still keeping them with a new version update. right now you just need to add it by hand and redo it with each update, sorry.

    The mass of the objects is indeed recalculated, based on the density and volume of the object, this is due to the way unity uses Mass, we recommand you change the other system to work with the changes like:
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class ExampleClass : MonoBehaviour
    4. {
    5.     public float thrust;
    6.     public Rigidbody rb;
    7.  
    8.     void Start()
    9.     {
    10.         rb = GetComponent<Rigidbody>();
    11.     }
    12.  
    13.     void FixedUpdate()
    14.     {
    15.         rb.AddForce(transform.forward * thrust * rb.Mass);
    16.     }
    17. }
    To include its new mass.

    But i do like the idea to have a global scale for it, so i added it to the list for a upcoming update thank you.
     
    Fera_KM likes this.
  2. mak3r76

    mak3r76

    Joined:
    Sep 14, 2016
    Posts:
    18
    Hm, I have a problem while starting it. Like in the tutorial video I have clicked on the window and launched the manager window. But after this, it fully disappeared from my hierachy and I can´t start it anymore. There´s only a message in the window about a warning log. But this log is empty :(

    - I have checked it twice on a different computer (also with latest unity ver.). I can start the manager window one time..and after this only the message "warning log:" appears and nothing work. I can´t explain it to myself..please check this.
     
    Last edited: Sep 17, 2016
  3. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    Strange...I can't set the Scripting Define Symbols...it keep going back to the default symbols. Even if a remove the current Symbols, it comes back again. Anyone having the same problem I am using Unity 5.4.0f3 personal ?
     
  4. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    Two question:

    1. I have a dynaimc water mesh being modified by script, so I use the mesh collider to interacte with the scene objects. How can I use the realistic water physics system together with the mesh collider ?

    2. In one of your trailers you have a ship floating and running over the water. Can you give as a link to this demo ?
     
  5. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    the manager gameobject will only show when you enable advanced options, the Warning log, is empty if there are no issues, this will be removed in a newer version.

    When you open the window trough the menu a manager object will spawn in, you will see a message that the manager could not be found and one has been created for you, after that you wont need to interact with the manager anymore, evenything is done within the window, no code is needed no settings are changed trough the inspector.
     
  6. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    make sure you end each symbal with a ; marker and press ENTER on the keyboard, else it wont save (unity issue)
     
  7. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    1. you can not use a collider to interect with water in this last version, however this is included in the next update we are working hard on, but you can change the water level ingame with the following code:
    Code (CSharp):
    1.     void FixedUpdate ()
    2.         {
    3.             RealisticWaterPhysics.currentWaterLevel = newWaterLevel;
    4.         }
    5.  
    2. That demo is not included as it contains assets that we don;t have the rights to share them.
    But its just a water plane and all the objects are setup using the manager window.
     
  8. ZhavShaw

    ZhavShaw

    Joined:
    Aug 12, 2013
    Posts:
    173
    Greetings! I saw in your Ceto demo video that the water was almost perfectly synced with the waves. I just can't seem to get that done, can you please explain how to?

    EDIT: Never mind, the scripting symbols were removed, maybe I didn't save, and I also didn't know that Ceto had to be in CPU. Thanks a lot anyway!
     
    Last edited: Sep 18, 2016
  9. mak3r76

    mak3r76

    Joined:
    Sep 14, 2016
    Posts:
    18
    Thanks for your help, all works fine now with standard 3d-objects. But there´re problems while importing my own meshes, this will not work. Otherwise, your demo boat works good. Is there something important to configure while importing an own mesh? Perhaps max. vertices?
     
  10. Fera_KM

    Fera_KM

    Joined:
    Nov 7, 2013
    Posts:
    307
    Hi,
    Thought I'd give some more feedback now that I've played around more with it.

    An option to sort material type by density (instead of alphabetical) would be real nice, (back to the argument of making the values transparent in the editor).

    An option of making the "percentage solid" value go above 100%.
    In my case, I want to use a slightly more dense material than oak/wood/pine, to simulate wet material.
    (I'm assuming the material data are based on dry materials).
    Perhaps even better would be an adjustable slider for this kind of simulation, that can be updated in runtime.

    Also wanted is an option to use collision component instead of mesh, where both are present.

    -----

    Here is how I set things up in my scene, this seems to give me the least amount of trouble with still ability to make custom modification. Maybe there is a better way, I don't know.
    Easiest way to explain it with this image:


    Here is how I make use of it
     
  11. mak3r76

    mak3r76

    Joined:
    Sep 14, 2016
    Posts:
    18
    This is awesome! In VR it must be absolutely crazy :)
    Could you post an image from the unity window? I'm having heavy problems to include an own mesh. Btw, which ocean asset do you use?
     
  12. Fera_KM

    Fera_KM

    Joined:
    Nov 7, 2013
    Posts:
    307
    @mak3r76

    I'm using Ceto
    Including an own mesh should work fairly simple. The only thing that I noticed was when using a fairly dense mesh, the compile time (within the editor) spiked quickly, so I disregarded the idea of using the actual mesh as buoyo objects.

    At some point I'm going to have to try to make all the logs as separate objects, that could break off from the master object. It is inevitable that I try, I've spent too much time in kerbal to not try this out.

    Here is how the buoyancy colliders look like, I guess I'll make some custom low poly mesh if I'm going to include more complex raft shapes.




    Here is a screenshot from Unity



    One final thing is that I use forces + simulations to push everything in a constant (wind) direction,
    and then use a force that push the master object forward, with an intensity multiplied with the off-angle to the wind.
     
    mak3r76 likes this.
  13. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Yea the materials are based on dry states.
    You can change the slider of the percentage solid in runtime, if you enable "Light run-time editor" on the realistic buoyancy scrpt on the gameobject.

    And it is possible to make object float without a mesh filter, with just a collider script on it.
    (But! The mesh is used to calculate the volume of the object and without a mesh collider it may not be as precise.)
     
  14. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Again, the mesh is used to calculate the volume and its mass so the mesh is recommanded, but it can work without a mesh and just use a collider, this will work by removing the mesh filter and re-setup the gameobject trough the window.

    If you use force at a object you can add force to each of the object but it may be usefull to include the new mass too.
    And if the complete boat/raft is out of balance it will tip over.

    To make the object float its best to just create a new Cube, scale it to the correct size, and make that its parent, so the cube will do the buoyancy stuff, this way the calculation time is small due to a low poly mesh ;)
     
    mak3r76 likes this.
  15. mak3r76

    mak3r76

    Joined:
    Sep 14, 2016
    Posts:
    18
    Thanks a lot (both of you)!
     
  16. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    It seems the boat is missing from your demo.

    I created an cube and set it as a float object. The boat engine script does not work. What am I missing ?
     
    Last edited: Sep 18, 2016
  17. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Im sorry i forgot to add the boat, but the engine script is just a example.
    You can use it by adding the script to a child object of your boat, make sure its below water.

    Appy the setup to that engine gameobject and the boat itself and connect the engine to the boat with a fixed joint.
    Dont forget to get the engine powers, by default they are 0.
     
  18. Fera_KM

    Fera_KM

    Joined:
    Nov 7, 2013
    Posts:
    307
    Another question, what timestep and solver iteration count are you using as default? And would changing the timestep offset the default material values?
     
  19. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    what script are you talking about?
     
  20. Fera_KM

    Fera_KM

    Joined:
    Nov 7, 2013
    Posts:
    307
    I mean the Fixed Timestep in Unity's TimeManager setting.

    edit: by default it's set to 0.02, which is 50(?) fixed updates per second, which can be pretty low when handling fast collisions.
     
  21. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    So far we know changes to that will not effect this system
     
  22. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    We re-designed the interface to be more friendly to new users, the version 2.3 will include auto gameobject testing and will give out warning for user mistakes



    Tell us what you think of this new interface, you see yourself working with it or is it to much?
    Thanks for any feedback
     
  23. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Next few versions will be skipped, the new interface got some issues that delays the release data, due to this and a few other changes we want to do we think its better to keep the existing interface and code structure and first push more releases with more support.

    Next update will include bug fixes and more support.
     
    Bartolomeus755 likes this.
  24. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    The new update will include new water areas.
    You can give them each a different water type like this:


    From left to right: Beer, Milk, SaltWater, FlashWater, OliveOil

    Objects that fall in that water will each behave based on that water type it is, so as you can see objects wont move as well in olive oil water, then in salt water.
     
    ftejada and neoshaman like this.
  25. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Soon the need to add tags for support yourself will be gone, the new interface will have a its own tab for it,

     
    Bartolomeus755 likes this.
  26. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    hi

    I see in the image that already has support for the asset "Realistic water" of Kripto.

    Does this mean that for that update your asset work with the "Realistic water" asset of Kripto?

    That's all I hope to buy your asset

    regards
     
  27. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Yes we are working hard on the new update and it will include Realistic Water & SUIMONO interactive water
    We hope to get the update out soon.
     
    mwituni and ftejada like this.
  28. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    As it is I will buy your asset. Thank you
     
    imtehQ likes this.
  29. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    New version will be delayed due to new way of saving setup data, this needs some converter scrips, and a lot more testing.

    We want to make sure everything will work the same way once people update there versions, and we dont want to have to say to resetup all your gameobjects again, that can be a lot of extra work that can be avoided.

    If your waiting for this new version, sorry it might take a few more weeks
    We are just a team of 2 people working on it.

    Thanks for understanding.
     
    ftejada likes this.
  30. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    hi

    2/3 weeks is not long for my needs.
    I will wait delighted.

    regards
     
  31. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Thank you.
     
  32. ying2014

    ying2014

    Joined:
    Sep 26, 2015
    Posts:
    3
    Good work! So great!
    But I want to know if it can add the effects of the cloth floating on the ocean,soaked and sinked in the water.
    And also whether it can realize the two-way interaction between the object and the ocean.
     
    ftejada likes this.
  33. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Cloth physics is so far as i know not supported as we never came up with the idea for it, We will do some tests see if its possible.

    can you tell me more about what you mean with a two-way interactions?
     
  34. dreb4o

    dreb4o

    Joined:
    Mar 29, 2015
    Posts:
    51
    I bought the package
    my ship that uses mesh Collider
    I need to put more than one rigid body the script stops working
     
  35. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    You need to setup the gameobject you want to make float in water trough the setup window.
    Open the window and manage gameobjects, select the gameobject and press the create button, the setup window will do the rest.

    For more info please read the included manual file, there is a lot of info how to set a gameobject up the correct way in there.
     
  36. dreb4o

    dreb4o

    Joined:
    Mar 29, 2015
    Posts:
    51
  37. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    If your using the CorvetteShipCorps prefab from that package you can use the CorvetteShipCorps_LOD0 as the ship buoyancy collider, that part will have the underside of the ship as a mesh.

    Make a copy of that part and move it so its the parent of the ship.
    Apply the setup like this:
    Floating quallity: Low
    Solid Material: Oak
    Percentage solid: 80

    hit the Create button at the bottom.

    To allow players or other objects to walk trough this collider while still allowing it to hit walls, please read the unity manual of Layer-based collision detection, here: https://docs.unity3d.com/Manual/LayerBasedCollision.html


    Note: there is a issue with appying higher settings to the ship, this can be due to the model itself being out of balance.
    We are working on a new version that will help solve this issue, however! this asset can not predict the models users will use and may not always work on each and every model out there, not right now and not in newer versions.
     
    Last edited: Oct 30, 2016
  38. ying2014

    ying2014

    Joined:
    Sep 26, 2015
    Posts:
    3
    A two-way interaction means the action of object exerts on water and its reaction. The two actions can be handled in order in the program.For example, when an dropping object is completely or partially immersed in the water, it will affect the existing wave ,and generates new waves and sprays by the relative motion with the water. When the new waves and sprays disappeared, the object is floating on the water, moving with the wave. In the last aspect your package has already done very well.
     
  39. dreb4o

    dreb4o

    Joined:
    Mar 29, 2015
    Posts:
    51
    I did your proposal five minutes after I bought the package (3 days ago)did any combination
    with this package cut out the bottom of the ship https://www.assetstore.unity3d.com/en/#!/content/37173
    with this package did ship a single object https://www.assetstore.unity3d.com/en/#!/content/42929
    now actually I have only two objects
    1.first I need to put the script that detects and gravity
    2.second objects I want to have mesh collider must put rigid body
    this script detects both rigid body I made more than 20 combinations
    the only way this works is as the script does not detect another Rigi body unless a parent

    if it works as I want
    shows me that
    Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5.
     
    Last edited: Oct 31, 2016
  40. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    The asset called realistic water can do this,
    Support for that asset will be added in the new version
     
    ftejada likes this.
  41. ying2014

    ying2014

    Joined:
    Sep 26, 2015
    Posts:
    3
    I have that asset,but it can not be applied in large scale water like Ceto ,Playway water,Aquas water.
     
  42. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    To enable support for those assets you first need to unlock the option there is a manual file included in the package and at the bottom it will say what tag to use for each asset.

    Once you unlocked the support you can enable it in the manager.
     
  43. jangomoose

    jangomoose

    Joined:
    Feb 17, 2016
    Posts:
    40
    Hello, got any idea how I would go about stopping my "boat" going haywire when it collides with a terrain? I have it floating and behaving perfectly as long as it doesn't hit anything. (Plastics 80% solid) Just trying to make it stay upright and level. Thank you.
     
  44. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    How big is the boat, like if you but a basic cube next to it?

    Are there joints connected to it?
     
  45. jangomoose

    jangomoose

    Joined:
    Feb 17, 2016
    Posts:
    40
    Just a canoe. Basically an elongated cube. Got it to stay Level by adding a separate connected floating cube to the end of it. Playing about with Angular drag also seems to help. I would go back to the Ceto buoyancy script on which it doesn't happen, just acts as you would expect colliding with a terrain but I can get the RWP canoe to act much more naturally on the water. Tricky :) Anyway I'm sure I'll work it out in the end.
     
  46. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    I have send you a private message to start sorting your issues out.
     
  47. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    Does the new version interacts with a collider ? If not...do you have a release date for this feature ?
     
  48. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    What do you mean?
     
  49. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    From my previous post:

    1. I have a dynaimc water mesh being modified by script, so I use the mesh collider to interacte with the scene objects. How can I use the realistic water physics system together with the mesh collider ?...

    Your answer:
    1. you can not use a collider to interact with water in this last version, however this is included in the next update we are working hard on, but you can change the water level ingame with the following code:
    Code (CSharp):
    1. void FixedUpdate ()
    2. {
    3. RealisticWaterPhysics.currentWaterLevel = newWaterLevel;
    4. }

    Can we with the latest release interact a collider of a dynamic ocean plan with waves, with the Realistic Water Physics System? This is necessary for our game, since our ocean plane is being modified in real time to produce surf and normal waves.
     
  50. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    The issue with mesh water based systems is most of them dont update the mesh itself, therefore will not change the waterlevel, for example we are working to get the system to work with Hard Water system: http://u3d.as/zxj
    But this changes the mesh by a shader, there for the mesh collider wont update the correct way.

    For now and in the new update it wont have support for this yet, however you can have water areas at different heights in the new update.

    depending on what asset or system you use we might be able to work out a solution together?

    As for right now we do not.
     
    Last edited: Nov 26, 2016
    ftejada likes this.