Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    We are using Megafiers that updates the collider mesh each frame. This way each effect applyed to the mesh ( waves, ripples, etc.) reflects on the mesh.

    For a realistic effect, a boat for example, must not only respond to the bouncy effect but also to the mesh collider.

    You could update your code, so RP would first respond to the floating routine and then respond to the mesh collider, this way the we would have the perfect water floating system. Drag and Angular Drag values could be use to make a big boat, for example, do not climb a wave, passing through it.
     
    Last edited: Nov 29, 2016
    ftejada likes this.
  2. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    any object will always respond to the bouncy, but the effect must stop once its exits the collider.
    Once a object it outside the water, the water density will be replaced by air density, this way its always affected.
    To allow waves like a mesh to have effect on the object it must first go in the water, a trigger will do.
    The issue is that once you go below the waves the trigger will exit and the object will drop.

    Currently we are testing water areas with box colliders so the depth will be defined by the collider itself.
    And there is the issue with using a surface mesh, where it will not stay the correct way.


    We cant just add mesh collider detection in the already existing system, as not only it will break global water level it will also not work with most people, and again we are working on a few new systems that allows you to create water areas, we have and are still sorting out issues with the mesh surface collider.

    Drag and Angular drag must be set by the user them selfs, we can not predict what objects poeple will use.

    I marked the 'mesh surface collider detection', and we will take more time into developing it.
     
    ftejada likes this.
  3. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    Thanks for the reply.
     
    imtehQ likes this.
  4. sashahush

    sashahush

    Joined:
    Sep 5, 2012
    Posts:
    75
    Hi there,
    Amazing asset! I do have a question on how to make my objects stay near the surface of the water. At the moment
    if an object is dropped it continues to travel downward underwater quite far almost like it has no drag. Are there certain settings that i can tweak to achieve this effect?

    Thanks!
     
  5. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Make sure you set the water level height correct, and use the interface to setup object.
     
  6. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
  7. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
  8. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Great, thank you.
     
  9. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    A small news update about the new version that coming,

    It got a bit delayed as other work needed some time too.
    We are still working on the interface and got a few new features added, we completely redone the existing interface from the ground up allowing us to make it easier to use overall.


    [Automaticly calculate the percentage solid for objects]

    Including automatic checks to see if objects the users will select can be used or not,
    If for example the object you want to use has no collider, a message will show you that it might not work well,
    And the same goes for missing a mesh filter, as the best results will be with out of them. But you will keep the option to overwrite it and still use just a collider or just a mesh.

    We are also including a new option to create your own materials for this asset, the interface is super easy to use, no longer do you need to get into the code to change it, everything will be done within the interface.

    That and more will be included in the next update coming soon we hope!

    As many of you requested, we will allow you to setup object trough code as well, allowing objects to be spawned in from code, currently some users are experiencing some issues with this.

    Note to existing users, This new system will completely replace the existing asset, see it as a new asset all together.
    (That you don't need to buy again! )
    But we will include a converter tool allowing you to keep your settings as they are!
     
    ftejada and Bartolomeus755 like this.
  10. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Will you be including Aquas river current support in the upcoming release?
     
  11. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    We are working together with the developer of Aquas to add this, we hope it will be ready when the next update is done.

    Edit: There is a script included in the extra folder, a example script how to can make areas with current flows, its basicly
    OnTriggerStay(Collider other)
    {
    other.getcomponent<Rigidbody>().addForce(Direction);
    }

    As floating will still work, with the example above you can have object float in a direction.
     
  12. RedEyeFox

    RedEyeFox

    Joined:
    Jan 8, 2013
    Posts:
    27
    hi , how can i set the phys mass to 1 or 2 because is too heavy and my player cant push objects with mass 2000+ if i try to set it manually the object start to fly
     
  13. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232

    Having objects with mass 1 or 2 or something like that is never good, to have a good physics system ingame, you need to have all object have there own mass, so depending on size of the object the material selected the asset will recalculate the Rigidbody mass, if you want to be able to push objects you need to have other object use the same system, try applying the setup to the character and change the code of the controller to:

    addfoce (direction * rigidbody.mass);
    Then just lower the movement force so the player will have better control over the character.

    Note: We are working on some examples for this in the new version.
     
  14. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86

    Having the above hull shape has made it really difficult to get the boat to stabilize especially at higher speeds. Any Suggestions for a Dual Hull ? Like this ? I've tried the rigid joints, but it just seems to mess with things, and not help with stability of the shape (Two Sphyls and a box). Any suggestions would be welcome how to handle a concave hull.
     
  15. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Right now objects with dual colliders are a bit of a problem in the asset. it might be possible to combine them, you can do it with mesh combine assets.
    Using the combined mesh as collider for the boat as parent object. this way the intire boat will be calculated and will be acting like expected
     
  16. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    Thanks ! I'll give that a try.
     
  17. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Let me know if it worked ;)
     
  18. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    The Mesh Merging won't work, as I tried making a Cat Mesh in Maya, and then when I bring it in, it states it can't use concave meshes as of Unity 5 or something.

    Something I did do, was something I found while doing an Unreal Tutorial, wich involved Tank Physics, is that the tutorial stipulated creating a force to counterbalance side slipping, which I implemented in my derivative of This http://www.habrador.com/tutorials/unity-boat-tutorial/ motor script, which I heavily modified to get it to work with RealisticWaterPhysics, and Playway.

    Either way the boat is now a lot more stable at higher and higher speeds, the issue seems to be now, that at some point, it start wobbling side to side, and then starts to nose dive. I ended up using the Dual Cat Collision I had built for the cat, and letting unity create a speed boat style monohull, which approximated what I was looking for behavior-wise, more than the cube I was using before.

    If I can get the motor physics to behave I have no problem posting an initial starting point here, or have you include it in your package, but I think Boat Propulsion should be included in realistic water physics.

    The nose-diving does concern me, and I wonder if having a movable center of gravity like PlayWay has in their basic Floating script, might be worth looking into, as I'd move that towards the back as speed increases.
     
    ftejada likes this.
  19. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    The way that, that tutorial does is it with meshes, where realistic water physics uses calculated points, We are looking into combining the 2 into one system but working on the base code for the next version in taking a lot of time.

    I Tried to make a project with high speed boats but failed at the same reason, after many tests i got the boat engine to work,
    You can use the demo boat engine script for this, its a bit hard to use tough, you need a sensor object below water, a point where you think the trust is coming from, the script will need to turn off the moment it gets out of the water, unsure if this demo script does that. (you will have to look inside)
    Then you need to angle it down and forward a bit otherwise you will fly off,
    And i had it working on high speeds using downforce, i created a second engine that you did not see, on the tip of the boat that will push down as the boat speed increeses, this way the boat wont backflip.

    Realistic Water physics was never made to support high speed moving objects, as the unity engine will act weird at some point, but it was made to have small objects and many small objects float, (But may be able to handle)
    There are also issues when trying to float big objects, like full on tanker ships may work, but needs a lot of extra code to make it controllable without issues.
    And then again, its a asset to help people not a asset that a complete game, and as all assets and the end, its a try and error, sorry.


    Edit: The script you can copy from is simple, RealisticWaterPhysics/Demos/Scripts/BoatEngine.cs
    Place it on a object like the rotor point of the engine, so its underwater, i recommand a simple block so you can see where it is, then W,A,S,D will allow you to control the engine and V for boost.

    But again its a simple script, i recommand you make a better one yourself.
     
  20. MikeyUchiha

    MikeyUchiha

    Joined:
    Jan 8, 2011
    Posts:
    109
    Hi,

    I'm running into an issue when I have a game object that has multiple LOD's under it. The Realistic Water Physics manager doesn't notice the Mesh Filters at the different LOD's so it tries to apply it to the primary Game Object which doesn't have a Rigidbody or Mesh Collider.
     
  21. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    its best to make a parent have a single collider, as right now it does not support LOD's

    Edit:

     
    Last edited: Jan 27, 2017
  22. MikeyUchiha

    MikeyUchiha

    Joined:
    Jan 8, 2011
    Posts:
    109
    Would it be possible for me to get a refund? Unfortunately all of my models use LOD grouping and this asset is unusable for me.
     
  23. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    A refund is no problem, however we always try to make it work before the refund.
    I send you a private message
     
  24. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Ok, you can use LOD gameobjects with this asset, you just need to add a mesh collider to the gamobject, and not to the lod objects childs below it,
    The for the meshcollider selected the lowest quality mesh, as this will increes preformance, but you can use any, do remember to make it a convex as non-convex mesh colliders are not supported by unity.
    Then using the manager apply the setup to the LOD Gameobject that now has the mesh collider with mesh on it and a LOD group.

    We tested this with a few free assets that uses lod groups and we had no issues with it.
     
  25. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    Still trying to make the Boat work, did I miss read this or did you say all Mesh Colliders / Colliders in the hierarchy would be filled with Voxels ? If not is that possible that it uses all hulls encountered instead of just the first ?

    If this is already working, can you elaborate on its use.
     
  26. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Depending on the quality settings in the setup window, number of points will be created in the object.
    If you have more then 1 collider on the gameobject it might confict with each other, but to just keep it to 1 collider and apply the setup to it. The other child objects of the gameobject will not be used, not the gameobjects nor the colliders, it just the gameobject you apply the script on.
     
  27. DerikGW

    DerikGW

    Joined:
    Jan 30, 2013
    Posts:
    16
    I have been trying all day to get the RWP to work with a boat from the Ultimate Sailing Ships Collection 1.0 asset and the PlayWay Water System 1.1.6. My boat keeps flipping over, and isn't really affected by the waves much, other than slowly flipping over. I use a mesh collider (because the others wouldn't work well at all), then I used a script to move the center of mass of the game object's rigidbody lower in the boat. Nothing works. When it doesn't tip, the ship just sits there being buried by waves because the waves don't affect it. Sometimes I see it rock back and forth and then it tips over. I have messed with the mass and other settings in the manager. Any assistance is appreciated.

    Oh, also, when I attempt to make tweaks at runtime, the game view slows down to a slideshow. My graphics card is a GTX980, so it ain't that, and my processor is a higher end i7 and 16 GB RAM.
     
  28. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
  29. jangomoose

    jangomoose

    Joined:
    Feb 17, 2016
    Posts:
    40
    @DerikGW I have had trouble with objects slowly rolling over. I just added a script to limit the x rotation to stop it flipping. works well.
     
    DerikGW likes this.
  30. DerikGW

    DerikGW

    Joined:
    Jan 30, 2013
    Posts:
    16
    Yeah I was trying that. Can't get it working well yet. Also, the ship never sinks into the water and rocks with the waves. It just kind of sits there level with the occasional rocking. I am trying to get it as realistic looking as possible. I want to make these massive ships look heavy so when you hear the wood moan and creek, you get that sense that the ship is massive.
     
  31. jangomoose

    jangomoose

    Joined:
    Feb 17, 2016
    Posts:
    40


    I use Ceto so might be different. I think for a galleon I would create 2 to 4 cubes linked with fixed joints, probably Oak material as the base for the ship using a density so they "float" below the water line

    Or something like that. I find it is a lot of trial and error to get the actual motion to behave as realistically as possible.

    If it helps here is the script I use to lock rotation so it doesn't flip.

    using UnityEngine;
    using System.Collections;

    public class LockedRotation : MonoBehaviour {

    //public float MaxTilt

    private float rotationZ = 0f;
    private float sensitivityZ = 2f;

    // Use this for initialization
    void lockedRotation()
    {
    rotationZ += Input.GetAxis("Mouse X") * sensitivityZ;
    rotationZ = Mathf.Clamp (rotationZ, -10, 10);

    transform.localEulerAngles = new Vector3(transform.localEulerAngles.x, transform.localEulerAngles.y, -rotationZ);
    }

    }
     
  32. DerikGW

    DerikGW

    Joined:
    Jan 30, 2013
    Posts:
    16
    Thanks. Yeah I guess I will have to add joints to the boats. I don't think they currently have anything to attach blocks to at the moment.
     
  33. DerikGW

    DerikGW

    Joined:
    Jan 30, 2013
    Posts:
    16
    By the way, Ceto appears to be no longer supported.
     
  34. jangomoose

    jangomoose

    Joined:
    Feb 17, 2016
    Posts:
    40
    Indeed, Ceto is deprecated which is a bit of a shame as it still works well especially in VR. Fortunately I bought it yonks ago.
     
  35. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    I'm sorry for my late reply for some reason im not getting email when someone replyes to the forum anymore.

    Make sure you enabled the Asset support for it, there is a bit of info on the manual at the bottom for what Tag to use.
    Once the tag is enabled you need to open the manager again and enable the support for it.

    Its best to use a box collider as the on the parent object of your ship, this together with the enabled support will make sure the boat will float the best possible way.

    But like many assets, best to play around with it a bit, and a axes limiter may be really usefull.

    "We are working on a new version to improve those steps but other work sliped in and the new version had to be put on hold for now."

    The runtime edits are as fallowed, you can enable light and heavy edits, the light onces will resetup the script everytime you change a value like the percentage solid, while heavy edits will olso resetup the scale and recalculate the mesh, this is not to be recommanded to have running in playmode on big objects.
    If you will have lag make sure you apply the script to a gameobject with a mesh render with to lowest possible details, like for example a lod3 mesh most objects have, a lowpoly mesh converted is recommanded if your taking ships and objects of the store.
     
  36. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Thats correct, but we left the support in there for people who already have ceto, and still want to use it ;)
     
    olavrv likes this.
  37. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Please continue to leave Ceto support in there :) Much appriciated!
     
    sashahush, imtehQ and jangomoose like this.
  38. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
  39. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    I will put it on the list for the next update.
     
  40. sashahush

    sashahush

    Joined:
    Sep 5, 2012
    Posts:
    75
    Hi there, i have this fantastic asset and i'm using it with Ceto. Any way i can change the property of an object so it sinks or floats in real time? like a submarine?
    Thank you!
     
  41. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Enable Light-edits on the object Bouyancy script, this will allow you to change the percentage solid within the script.



    Note: Although Heavy edits does the same thing, it will also recalculate the bounds of the object every time there is a change, there for its recommanded not to use the heavy to much and not on bit objects.

    Note 2: Editing the object with light or heavy will add more calculations to the system and may cause some fps drops, but again it depends of how big the object is or how many objects have this enabled.
     
    olavrv and sashahush like this.
  42. sashahush

    sashahush

    Joined:
    Sep 5, 2012
    Posts:
    75
    Thank you very much!
     
  43. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Hi,
    Your forum has been quiet. Is this product still being supported?

    This post if from October last year ... when is this update with Suimono support due?
     
    ftejada likes this.
  44. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Hello mwituni,

    Yes it is, but one of the developers left so im alone to work on it, this means it takes a bit more time to work on the next update.

    Im still working hard on it, With the new update i completly redesigned and coded the intire asset, it now has a way better interface then before, more options and more stable.

    Status of the new update, umm its about done but i still need to rewrite the manual and test everything step by step.
    I hope i can get is done within this month.
     
    ftejada, masa045 and jangomoose like this.
  45. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Awesome thanks for the reply ... let me know if you need any Suimono testing.
     
  46. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    I will most lily do it as last time, bring out the update in best possible shape i can make it, and work on smaller updates troughout the following week to fix the issues your all find ;)
     
    jangomoose likes this.
  47. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    We don't have it yet ... I think many are waiting for Suimono support.

    I assume its simple enough and well documented to do everything through scripting when objects are created in game (ie. not using your UI in editor).
     
  48. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    In the new version its recommanded that you do use the interface as much as possible, this is due to the way the data is calculated, in the new version the interface will give you more feedback on possible issues with your gameobject ahead of time, and i even locked some options to only work with the interface, like support for child buoyancy gameobjects is only possible trough the editor,

    But yes i included some ways to setup gameobjects trough scripts but again this is limited and will not give you much feedback.

    But i will try to make it possible.

    Its ok you dont have to own it right now, but i will up the price when this update comes out, i might even make it a upgrade as its completely rewritten and nothing like how it used to be.
     
  49. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    I also gone trough the forum topic and added everything you requested, picture below of how the interface now looks:



    As you can see the material list is set to default, those included only the materials that i include, you can make your own materials trough the interface.

    Materials can now be sorted as well.

    Percentage solid can be automaticly calculated if it has a box collider and mesh.

    And it will automaticly test your objects and show you whats wrong with them before you apply the script to it, as you can see this gameobject "Boat" is missing a Collider

    This and much more is included in the new interface and there for I really recommand people using it.

    But everything will be explaned in the manual, that i still got to make :p
     
  50. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @imtehQ

    The update will be free for those who already have your asset or will have to pay for the upgrade ??

    What price will your asset have after the update, for people who buy it?

    regards