Search Unity

[RELEASED] Realistic Water Physics 3

Discussion in 'Assets and Asset Store' started by imtehQ, Feb 2, 2018.

  1. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232

    Current version 3.1


    Last changes:
    • Fixed issue where settings where not always saved correctly.
    • Added better child support.
    • Cleaned up some code.
    • Opened up more access trough scripts.
    • Removed the inspector menus made is simpler.
    • Fixed issues with center of mass.

    If your updating to version 3.1, Dont forget to press the Re-Calculate
    button on the bottom of the script on your objects!

    [Website] [Store page] [Youtube] [Manual]







    With the Realistic Water Physics 3 asset you can get your game objects floating in water within seconds.

    Everything is done through an easy to use interface that will help you if anything goes wrong.


    It supports multiple well known water systems including:
    Ceto: Ocean System
    ( ^ is no longer available in the store, but still supported!)

    Aquas Water Lite


    PlayWay Water System
    ( ^ is no longer available in the store, but still supported!)

    UWS Ultimate Water System




    Habrador (built in)





    How it works
    With the use of other water system its allowing you to have your game objects use realistic materials within your favourite water system. Best of all, all the supported assets are plug and play!


    The system works by calculating the density of object by material type.


    Based on the selected material, volume and mesh of the object, the system will calculate its mass and density for you Allowing you to setup your game objects by only selecting what material you think the object is made of. Press the Create button and your done!


    We have included a total of 93 real materials, called the default materials but using the interface you can create your own custom ones within seconds.

    Features
    - Low performance impact.

    - No extra Layer or Tags required.

    - Easy to use interface.

    - 93 Default materials to use.

    - Custom materials creation through the interface.

    - Lots of feedback through the interface.

    - No need to drag and drop with scripts.

    - Plug and play support build in.

    - Works with any type of mesh & collider.

    - Use joints to link objects together.

    - Full child support.

    - Advanced option.

    - Extra example scripts.

    - Lots of info in the scripts if you want to peak inside.

    - Global water level.

    - Local water areas.


    Realistic Water Physics 3 Buoyancy examples


    Realistic Water Physics v3.0 Interface Tutorial


    ____________________________________________________________________
    [Work in progress]
    The asset is always improving, we still have a massive list of items we want to add to the asset, below you can read what will be included in the next version, as well as a small list of thinks we hope to include in the version after the next one.


    Version 3.6 (Delayed)
    I'm working on the next version but because its a big update its delayed a bit.
    It will include better usable demos.
    Improved child support.
    Better support of other assets and also more supported assets as well.

    Access to the code, allowing you to setup objects without the use of the interface.
    New and improved interface and inspectors.
    Improved point based buoyancy and improved calculation time.
    Improved overall performance.
    Better user experience.

    Better manual, and examples.






    Known issues in Version 3.1:

    I always try to fix them first before adding more content to the asset.
    I will try to release patches to fix the know issues if needed.
    Please check if your issue is known before posting.


    • Changes to center of mass sometimes don't save with child support
    • unlinking a child then linking him again will cause the float point to be incorrectly shared with the parent.
    • Selecting 3 or more gameobjects and showing the results in the manage gameobjects will show a black horizontal scrollbar
    • If a gameobject fails the test a confirm button will show up, howeer once clicked confirm the confim button will not show up for other gambobjects anymore.
    • Custom mnaterials sometimes are removed on editor start.
    • Water areas flow currently not working
     
    Last edited: Oct 11, 2018
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Awesome!
     
    mwituni likes this.
  3. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    +1
     
  4. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,313
    Why no upgrade from 2.2.1?
     
  5. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    I just noticed ... you compiled with 2017.3.0 ... is that the minimum version needed?
    If not, I suggest you also compile with a lower version and upload that (you can with multiple versions), else users on say 2017.1 or 5.6 etc will not be able to use it, and I don't think many use the latest version yet.
     
  6. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Hey looking good, i was just looking at something similar the other day. Keep deving and supporting, when I get to that point I might pick this up!

    Edit: Just looked it was your old version I was looking at haha.
     
  7. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    That because the 3.0 version is completely recoded, re-designed and is nothing like the old version anymore.
    That's why i found it to be worthy of its being a new asset.

    Thanks, I will update it so its compatible with older versions to.
    I did not know unity restricts users this way, as the asset itself is compatible with older version from itself.

    Hehe, yea right now 2 versions exist, but in a few days only this version will remain on the store ;)
     
  8. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Fixed the manual link in the forum post.
    And storepage will be updated soon to fix those dead links to.

    I will also test the asset on other versions on unity to make use it works all well there to ;)
     
    Last edited: Feb 8, 2018
  9. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    I have updated the forum to how include information about the next updates,
    As some have requested me to include a example of a player character that works with the asset, i will include that soon!

    But as unity is sometimes a bit slow on updating the versions i might post the code here to.

    Other then that i did not get any emails or messages about bugs in the asset so or no one is sending them to me or it was released bug free and that makes me really happy!

    End of the month i will remove the older version of the asset! so if you don't have it yet, better buy it now while its price is 60% off!~

    1 more thing if you have any issues with the asset other then the player controller issue please message me, email me or post it here!
    If not please take a bit of time and post a review on the store page it helps alot!
     
  10. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Version 3.0.1 is away to be reviewed, I removed the post i posted earliertoday as i found out that its not a problem with the asset, just what i thought, i will delay version 3.0.5 a bit till i find a solution for the problem that does not exist..

    For those that are wandering what it is, its that your player controller is not moving with the objects in the water. Solution? Easy, use a character controller that applies force and not set the velocity.
     
    Last edited: Feb 16, 2018
  11. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Version 3.0.1 is out of the store now, its just a simple update to fix the store links, and make it work with unity version 5.*

    version 3.0.5 almost done, but it does not include animations for the character controller and may not work with other controllers out of the box, im still working on a solution for that, but then again its outside the scope of this asset so im not sure how to do that yet, more on that later.

    I worked on a better way of calculating the buoyancy points, its faster and the buoyancy quality is better but requires more calculations to be done in run-time, again still working on it i don't think i will include it in the 3.0.5 version but later.
    As of right now the asset is stable with no bugs reported, so i might just add it as a extra quality option somewhere in version 3.1
     
  12. Chrury

    Chrury

    Joined:
    Feb 5, 2018
    Posts:
    4
    Hey, this is looking pretty sweet.
    I notice that the link to Habrador goes to a table of contents of sorts. Is the built-in system based on the Build a Boat tutorial?
     
  13. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Yes Habrador is build into the system so the way that buocany points are calculated is based on that tutorial.
    It was a test to see if the system can be used with other ways of handling the buoyancy, its less stable but working sort of.

    If you follow the tutorial build a boat you can see how buoyancy is calculated and created, but with the asset its possible to combine the easy to use interface with that system, Create a boat like you normaly do and enable support for Habrador
    will automaticly use the Habrador way of calculating the buoyancy yet still use the realistic materials calculations at its base.

    But as it was a test of sorts i kept it in there as it did work and might be usefull for people that dont need another water system.
     
    Last edited: Mar 17, 2018
  14. Chrury

    Chrury

    Joined:
    Feb 5, 2018
    Posts:
    4
    Good to know! I liked a lot of the Habrador implementation.

    Unrelated question: In the ScriptExample; when spawning an object, the Realistic Buoyancy Object script doesn't have any options. It just says "Please use the interface to setup this Gameobject." Is this normal when applying the script through code this way? (I'm on Unity 5.6.5)

    The objects floated as expected (once I set up the water level).
     
  15. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Its not recommanded to setup trough code to bypass the message send true along with the setup, sorry currently on my phone so cant send you a example.
    But in de manual under example code there is a example there.
     
  16. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Ok @Chrury, Im back behind my pc.

    In the manual, here is a link to it:
    http://www.realisticphysics.com/Manual/RealisticWaterPhysicsManual.pdf#page=32&zoom=auto,-265,720


    Setup through code
    Code (CSharp):
    1. RealisticBuoyancyObject.SetupScript()
    Parameters:
    RealisticPhyscisMaterial realisticMaterial
    int materialPercentageSolid
    int _SlicesPerAxis
    int _VoxelsLimit
    bool setTroughInterface
    bool _Concave = false
    bool upgrade = false

    And the example:

    Code (CSharp):
    1. Var rbo = this.gameObject.AddComponent<RealisticBuoyancyObject>();
    2. Debug.Log("Setup gameobject: " + rbo.SetupScript(new RealisticPhyscisMaterial {
    3. Name = "AnyName", Density = 500 }, 100, 4, 4, true));
    But basicly when setup trough code make sure you have the setTroughInterface boolean set to true.
    This will bypass the check if your objects are really set trough the interface or not, allowing you to change the settings of the script after applying it.

    This boolean is set in place to stop people from adding the script to a gameobject without going trough the interface, as the interface will do checks to make sure your gameobjects are compatible, so to bypasss the interface is not recommanded but possible trough code.

    Also when using code to setup a gameobject you will not have access to the premade and custom made materials in the asset, you have to create your own material in code on the spot.
    Code (CSharp):
    1. new RealisticPhyscisMaterial {Name = "AnyName", Density = 500 }
    I hope this helps you out a bit.
     
    Mark_01 likes this.
  17. Chrury

    Chrury

    Joined:
    Feb 5, 2018
    Posts:
    4
    Thanks for the extended explanation! Works like a charm. :)
    I can see how that particular setup might be tricky. Luckily, instantiating pre-setup buoyancy objects works just as well and is probably more useful in most cases.

    Apologies for being annoying. I've found another confusion?
    It's would be ok that the center of mass isn't always correct on initial setup. But the center of mass adjustment in the Buoyancy component seems to adjust/change itself when I hit update. Here I've set the Center of Mass to (0,-0.1,0) and hit update. The center of mass visualizer moves properly but the component swaps it to (0, 0.02329698, -0.06328964).

    2: Going into play mode, the component reads the value (I think?) and moves the center of mass:


    I've read the manual and watched the videos and I don't think I missed anything. Is there a trick to this or is it bugged?
     
  18. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    @Chrury, you say you hit Update out side of playmode right?
    Because by default the center of mass is indeed calculated once you setup the gameobject trough the interface.
    Then you can use the script options to change some settings like the center of mass, but this needs to be done out side play mode.

    however its a bit of a tricky thing to change it reads the value but then changes the center of mass and rewrites the value, resulting in a incorrect value showing.

    It was one of the last things added and might still be a bug in there displaying the correct data.
     
  19. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    I'll look into the issue, and give you a update about it tomarrow ;)
     
  20. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    @Chrury, the hot fix for you will be to commit out a line

    In the RealisticBuoyancyObject.cs file
    Line 460 or so replace:
    OverwritecenterOfMass = CenterOfMass;


    With:
    //OverwritecenterOfMass = CenterOfMass;


    This will stop the code from changing the value back to what it was.

    Then on the RealisticBuoyancyInspector.cs file
    Line 490 or so you need to move the line:
    realisticBuoyancy.OverWriteCenterOfMass();


    To be below the
    realisticBuoyancy.reCalculateMeshAndCollider();


    This will fix the issue for you, Ill update the scripts and upload it to the store to, but that might take a few days.
    Thank you for pointing the bug out for me.
     
  21. Chrury

    Chrury

    Joined:
    Feb 5, 2018
    Posts:
    4
    Hey thanks, @imtehQ !
    That's got the initial menu/inspector sorted but I think there's one last step missing.
    Entering play mode is moving the center of mass, just without updating the value in inspector.Pic here:

    This is kinda... sticky? The green cube for the center of mass stays there when I exit play mode.

    Makes me wonder if the inspector isn't adjusting the center of mass and is just moving the visualizer instead. Just a thought.

    Side note: hitting update in play mode, though not recommended, does change the center of mass properly. The center of mass cube move and the behavior is close to what I'd expect. Cube still moves back on exiting play mode though.
     
  22. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    @Chrury, Thanks for letting me know i'll look into it right away!
     
  23. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    @Chrury, im unsure why is does this, i have checked everywhere and everytime i start the scene it starts at 0,0,0 then just when the scene is about to start it changes back to what its by default.

    As for right now i sorted out the issue by adding a small check to stop is from switching back.
    I added a bit more code everywhere to make sure the interface does the updates correct but for that you have to wait till unity updates it.

    But for now you can stop it from switching back by adding the simple check at like 1490 or so in the RealisticBuoyancyObject.cs

    just below the
    private void CalculateAllPhysics()
    {

    if(_thisRigidbody.centerOfMass != CenterOfMass)
    {
    _thisRigidbody.centerOfMass = CenterOfMass;
    }
     
  24. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Im working on a patch to solve the inspector issues, a good bypass now is to skip the intire inspector all together by opening debug mode, its in the top right corner right of the lock icon.

    It might a few days to work out as i want to add few extra option to it aswel.
     
  25. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Ok small update about the last version, there was indeed a bug in the interface that i was unaware of.

    As for right now the asset still works however you can't change the gameobject settings in runtime nor in the editor without using the interface, this is because i later added the inspector options to the asset by default my idea was to always use the interface window to change settings, this is what's causing the bug to show up.

    I'm going to rewrite some of the core code to solve the issue and while I'm at it I'm going to add a few things i wanted to add before, to make the overall asset better.

    This might take some time tough, as my personal life is not allowing me free time.
     
  26. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Another small update,
    I had to recode some of the core code to get everything working again, im still unsure how this got past me while debugging everything, ow well its fixed now.

    However i had to make a few changes alone the way to get everything working again.

    • For now i removed the subChild support but i will put it back in once refined.
    • I changed some small things like GetMass is not just Mass and stuff like that.
    • One big change is that i completely redone the inspector code, so i removed the fancy menus on it and made it all in 1 window, this will Fix a issue with the menus closing sometimes.. and well i got tired of it.
    • I added a options to change mass and stuff on the go, however the inspector window will update it the moment you change it, so be carefull with that. But you have full access to it trough code.
    • Changed the way the points are calculated to, its still used the same points but only does it when you call for it.
      So you can only get the buoyancy script to recalculate its points trough code and no longer in the inspector, this will reduse lagg when using the inspector but will lower its quality a bit when changing settings.
    This update will be a bit big, and i still need to update the manual file to match the code.
    Refine some small things but I hope to get it done soon,
    but currently 4 other active jobs are not allowing me much free time.

    If you're interested in testing this version for me it would help a lot!
    Message me if you like to get a experimental version.
     
  27. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Version 3.1 is out, and can be downloaded.

    If your updating from another version you need to press the Re-Calculate button on the bottom of the script on each gameobject to make it work again, this is due to update in the way the points-updates are called for.

    • SubChild support has been replaced with a stand alone child support script, well tested and works a lot better then the old system.
    • The options on the inspector got updated to they fix the bug where changes would not save correctly, bug reported by @Chrury
    • I Included a demo to show how the asset works with a correct player controller
      However its a simple player controller and i would not recommand you use it in a real game, its more of a example to help you build your own.
    And a few more smaller things, like i said the post above.

    The manual is updated to to match the 3.1 version and can be found here :
    www.realisticphysics.com/Manual/RealisticWaterPhysicsManual.pdf

    The version 3.1 was a in-between patch but as it took a bit more work then expected i did some more side work, but not stuff that was on the to-do list. So i will be working on version 3.2 next what will include a second way of calculating the points, but have it as a option that you can use if you like. That will hopefully stop you losing your settings on each update.

    If you experiencing issues let me know here on the forum or contact me trough the website, I added a new message system there so its easier to mail me from there. www.realisticphysics.com
    But at the time of typing this message the homepage of the website is currently down, but you can still access everything on it by using the menus

    Also don't forget the rate the asset on the store this helps a lot!
    I'm not saying you need to vote it 5/5, a honest review will do a lot better!
     
    Last edited: Apr 25, 2018
    Mark_01 and Bartolomeus755 like this.
  28. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Ok so to stop the intire forum post to be filled with my own messages im updating the first post with know issues as we discover them, so if you have a issue please check the first post first see if its a know issue.

    Know issues will be fixed before i add more stuff so i always try to fix them as soon as possible might sometimes even be a patch.
     
    Last edited: Apr 26, 2018
  29. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Version 3.2 will have the new mesh based buoyancy system added, and it looking good!

    Here is a small compare video, on the right is the old point based system, and on the left is the new mesh based system.


    As you might see they do behave the same way, but the point system is recommand to be used for smaller or more stable objects, where the mesh based system is good for high quality thats would be impossible with point based buoyancy.

    Both systems will have full child support, and both can be linked and unlinked in runtime!

    But it still needs a bit of work to get it fully working with all the existing interfaces, But unless i find a big bug somewhere i think i get version 3.2 out next week!

    Edit, after some more testing the mesh based system will generate about 5 kb garbage, and a delay of 1.43 ms
    While the point based at same quality will have no garbage and a delay of 1.66 ms
    And there is not really a way to remove that 3 kb of garbage from the mesh based system, its just the way its calculated.
     
    Last edited: Apr 28, 2018
    cxode and jangomoose like this.
  30. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Im not releasing the mesh based update until i removed the garbage off it.
    This will take tome time to work out.

    Other news, I created a better drag system for in the water, that will be used for the mesh based system, als will be included in the next update aswell.
     
    ftejada likes this.
  31. Zbad

    Zbad

    Joined:
    Nov 20, 2014
    Posts:
    15
    Can you give a comparison of v2 and v3? Advantages? New features?
     
  32. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Yea sure,

    Version 3 is in many way better, i can give you the full change log but its a lot.
    To enable and disable support i added buttons to the interface, no more typing the tag is unity editor.
    Option to create your own materials trough the interface, no more coding it in the existing list.
    The data of the asset is now saved in a stand-alone file, and removed the hidden gameobject that was holding the data for a scene.
    Extra checks build inside the interface so that setup mistakes are less likely to happen.
    Added water areas so you can have multiple water areas at different heights, the buoyancy will detect it and act correctly based on what its in.
    Improved the overall code, giving more access to code side of the asset.
    Improved the buoyancy calculations so it will not only take less time to calculate it but also less calculations in total.
    Better child support, you can now connect/disconnect other gameobject together in run-time and outside run-time, This works without the use of joints.

    And many more things, but thats the few things that are improved compared to the old system.
    And version 2 will no longer be updated, version 3 will be and im currently working on a better mesh based buoyancy.

    Full change list, from version 2 to version 3 and 3.1:

    [Interface]
    (^) Updated the realisticBuoyancyScript Inspector UI so it works better.
    (+) Added a RealisticBuoyancyChildSupport script with nice interface.
    (+) Added interface for creating materials.
    (+) Added support interface
    (+) Added Auto object check for creating objects.
    (^) Updated the interface so it looks prittier :p
    (+) Added sort list by alphabetical and density
    (+) Added frindly failsafes within the interface,
    (+) Added workaround for the failsafes
    (+) Added more information in the settings menu.
    (+) Added new interface for the buoyancy and water area scripts

    [Support]
    (^) Improved the way users enable support
    (+) Added Suimono support
    (+) Added Habrador support (Build in)
    (+) Added better river support for Aquas
    (+) Added Ultimate Water System to the support list.
    (+) Added extra options in the water areas for supported assets
    (+) Added extra options to mix more assets together in a single scene.
    (+) Added force flow to suimono support.

    [Systems]
    (+) Added new script to hold the data of the manager.
    (-) removed the hidden gameobject that holds the manager
    (+) Use of custom scriptable Objects to hold data
    (+) Added some code to check if objects are set trough the interface or not, this will fix issues if setup incorrectly.
    (+) Added way of creating a object that can float using code, its simple to use 1 liner.
    (+) Added uptomaticly upgrading old system scripts to new system.
    (+) Added a static script called the RealisticManager to call common code.
    (+) Added a RealisticBuoyancyObjectChildSupport script allowing you to link gameobjects together.

    [Other]
    (+) New child/parent supprot added, called child sub system.
    (+) Added water areas, allowing support for multible support enabled at the same time.
    (+) Added more information with each option.
    (+) Added more user friendly disable blocks on interface.

    [Demos]
    (+) Include big boat of users.
    (+) Boat driving demo
    (+) Water Area demo
    (+) Script sxample demo
    (+) multible objects demo
    (+) Added a player scene demo
     
    Mark_01 and Rotary-Heart like this.
  33. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    So small info update for people that are waiting for the new mesh based buoyancy.
    Due to Garbage being generated with the mesh based buoyancy i did not release it yet, i completely reworked the system so that i does not generate any garbage during run-time.
    It will generate a bit on first setup and a bit when connecting and disconnecting child object(s) due to it having to do the setup again, This is sadly unavoidable because its in unity's own way of dealing with it.

    But i got it to run in the dev build without any, and a good 3.63 Time ms


    As you can see the only GC Alloc is from the debug.Log :D

    It will still be some time before i can release it tough, now that the new system works i need to fine tune it, and make sure the old system is removed without creating to much issues, as for people that update there existing project to the new version there will not be any issue,

    The Setup interface will have a extra option so you can setup your gameobject with the mesh based system if you like, the point based system will still be the default.



    Other news, im working on something extra to, but im not telling you much more about it till its worked out better.
    But the idea works and might be really cool with the Liquid Volume asset, but before you go buy it, i have not tested it fully yet, and i may cut it if i find out it wont work as planned, but might be really cool!
     
    ftejada likes this.
  34. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    small update again, mesh based buoyancy works fine now, really for the next update but it still have issues with drag so adding 1 drag to a rigidbody will fix that but im working on a better drag system now, update is delayed due to that system.

    Edit: no the mesh based system still really unstable on high quality or big models, I will put it on the to do list and will work on releasing a version with bug fixes first.
     
    Last edited: Jun 10, 2018
  35. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Small,.. Well big update coming up...
    Because the asset was build around the point based buoyancy adding another system to it is messing with other scripts, this is bit my bad because i never coded it so it can expand, There for im recoding everything again But! This will be a free update not a upgrade like before.

    Im also using this time to add some things that where mission in my opinion, like for example the option to use custom materials in the world setup.
    I would like to know if you are missing anything, or things you like to be added, you can of course always message me about it, i normally put it on a big to-do-list.

    I don't know a ETA, but this update is worth the wait.

    Also if you really cant wait for the update you can message me if you like to try out the developers version of it, might not be working so well or have more bugs but it allows you to peak inside and have your feedback/ maybe ideas be included in the next version!

    And if you found a bug in the current version and can't want for the next version, message me and i will make a patch for you!

    Thank you.
     
    ftejada and Mark_01 like this.
  36. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
  37. JazZRocK

    JazZRocK

    Joined:
    Dec 17, 2015
    Posts:
    32
    Hello :)

    I have 2 questions before purchase:

    I'm looking for a solution to have my boat to float dinamically accordingly to the swell of the ocean.

    1.Your asset is compatible with "Hydroform Ocean System" asset ?
    2.If not, can you please give me an exemple of mesh based ocean asset that work great with your physics system and taking the swell in consideration ? (with waves that look realistic like Hydroform).

    Thanks you :)
    Have a nice day !

    P.S. Sorry for my bad english if...
     
    Last edited: Jul 6, 2018
  38. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Hey,

    Its currently not supporting Hydroform Ocean System, but support is coming for it.
    You can get he UWS Ultimate Water System but its expensive, i would recommand you wait till the next update if you can, because that one will include support for the Hydroform Ocean System and also have better support for mesh based buoyancy, currently mesh based bouyancy is not really supported.
     
  39. JazZRocK

    JazZRocK

    Joined:
    Dec 17, 2015
    Posts:
    32
    Ok thanks you for your fast reply :)
     
  40. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    In RealisticWaterPhysicsInterfaceWindows.cs I'm getting the following error:

    ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint
    Aborting
    UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Modules/IMGUI/LayoutGroup.cs:117)
    UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:461)
    UnityEngine.GUILayoutUtility.GetRect (Single width, Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:438)
    UnityEngine.GUILayout.Toolbar (Int32 selected, UnityEngine.GUIContent[] contents, UnityEngine.GUIStyle style, ToolbarButtonSize buttonSize, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayout.cs:214)
    UnityEngine.GUILayout.Toolbar (Int32 selected, UnityEngine.GUIContent[] contents, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayout.cs:161)
    UnityEngine.GUILayout.Toolbar (Int32 selected, System.String[] texts, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayout.cs:147)
    RealisticPhysics.RealisticWaterPhysics.RealisticWaterPhysicsInterfaceWindow.OnGUI () (at Assets/RealisticPhysics/RealisticWaterPhysics/Editor/RealisticWaterPhysicsInterfaceWindow.cs:2405)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:291)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:284)
    UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:251)

    If I have the manager window open and I'm playing my game.

    Also I'm using Unity 2018.1.2
     
    Last edited: Jul 10, 2018
  41. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Yes im aware of this issue, however there is nothing that can be done to stop that, this is because how the interface is build, This is because the Unity editor Window is lacking some support for some things, so to have a nice interface a error is sometimes showing.

    Best to ignore it as it will not effect the gameplay in the editor or after build.
     
  42. wasam

    wasam

    Joined:
    Oct 13, 2012
    Posts:
    5
    When using Realistic Water Physics 3 on a more complex object (ship hull nested as a child object and offset & rotated), I saw that the Child support is not fully working, yet.

    So I took I short dive into RealisticBuoyancyObject.cs, down to line 299,
    and changed the code from

    Code (CSharp):
    1. for (int x = 0; x < newDataVoxels[i].Location.Count; x++)
    2. {
    3.     //dv.Location.Add(newDataVoxels[i].Origin.transform.TransformPoint(newDataVoxels[i].Location[x])); //At location but 1 to high
    4.     //dv.Location.Add(transform.TransformPoint(newDataVoxels[i].Location[x])); // places the point right on top.
    5.     //dv.Location.Add((newDataVoxels[i].Origin.transform.position - this.transform.position) + newDataVoxels[i].Location[x]); // works but rotation still messes it up
    6.                  
    7.     dv.Location.Add(newDataVoxels[i].Origin.transform.localPosition + newDataVoxels[i].Location[x]);
    8. }
    to this

    Code (CSharp):
    1. for (int x = 0; x < newDataVoxels[i].Location.Count; x++)
    2. {
    3.     //dv.Location.Add(newDataVoxels[i].Origin.transform.TransformPoint(newDataVoxels[i].Location[x])); //At location but 1 to high
    4.     //dv.Location.Add(transform.TransformPoint(newDataVoxels[i].Location[x])); // places the point right on top.
    5.     //dv.Location.Add((newDataVoxels[i].Origin.transform.position - this.transform.position) + newDataVoxels[i].Location[x]); // works but rotation still messes it up
    6.     Vector3 wp = newDataVoxels[i].Origin.transform.TransformPoint(newDataVoxels[i].Location[x]);
    7.     Vector3 p = transform.InverseTransformPoint(wp);
    8.     dv.Location.Add(p);
    9.  
    10.     //dv.Location.Add(newDataVoxels[i].Origin.transform.localPosition + newDataVoxels[i].Location[x]);
    11. }
    (First we translate the child voxel from local to parent to world position, then back to local position in relation to the parent buoyancy object. At least this seems to do the trick in my case: It even works when child object is rotated & offset)
     
  43. wasam

    wasam

    Joined:
    Oct 13, 2012
    Posts:
    5
    When creating / updating for a convex mesh, I noticed that some voxels are created outside the mesh - they are only bound by the bounding box of the mesh.

    So, I took another dive into the code and found that there was already a check for concave meshes, but not for concave ones. I then (seemingly) successfully added and fixed the inside-mesh-test for convex meshes:

    (around line 1680) change from
    Code (CSharp):
    1. Vector3 p = transform.InverseTransformPoint(new Vector3(x, y, z));
    2. points.Add(p);
    to this
    Code (CSharp):
    1. var wp = new Vector3(x, y, z);
    2. var p = transform.InverseTransformPoint(wp);
    3. if (PointIsInsideMeshCollider(meshCol, wp))
    4. {
    5.     points.Add(p);
    6. }


    Not tested yet, but I have a hunch that this might also fix the inside-mesh-test for convex objects.
    In this case (around line 1650) change from
    Code (CSharp):
    1. Vector3 p = transform.InverseTransformPoint(new Vector3(x, y, z));
    2. if (PointIsInsideMeshCollider(meshCol, p))
    3. {
    4.     points.Add(p);
    5. }
    to this
    Code (CSharp):
    1. var wp = new Vector3(x, y, z);
    2. var p = transform.InverseTransformPoint(wp);
    3. if (PointIsInsideMeshCollider(meshCol, wp))
    4. {
    5.     points.Add(p);
    6. }
    (use world position instead of local position for inside-mesh-test)
     
  44. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Yes Child support is still lacking a bit, im working on a big update that will over hull the entire system as currently im not happy with how it works, but what do you mean with offset?

    Nicely spotted!
     
  45. wasam

    wasam

    Joined:
    Oct 13, 2012
    Posts:
    5
    By offset I mean that the nested/child object has an offset relative to its parent object (x/y/z axis).
    For example: I have a ship model where the ship hull is a nested object that is offset on the y axis and rotated 180 around it's z-axis / forward vector. In this example - without my fix - the ships voxels are offset on the y axis and rotated 180. Also the centre of mass is rotated and offset.

    Today I attempted a fix for the calculation of centre of mass.

    Inside RealisticBuoyancyObject.cs, around line 374, change
    Code (CSharp):
    1. CenterOfMass = DataVoxels[0].Origin.transform.InverseTransformPoint(CenterOfMass / DataVoxels.Count);
    into this
    Code (CSharp):
    1. CenterOfMass = transform.InverseTransformPoint(CenterOfMass / DataVoxels.Count);
    (because the first set of voxels is not guaranteed to be the parent object. In my example the parent object does not have a own set of voxels.)
     
  46. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Yes its indeed a small mistake on my side, as the interface will stop people from creating empty parents but later on started to support that it still had some issues in the background/old code.

    Thanks for the info, i will keep that in mind working on the new version.
     
  47. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Sorry for not updating the forum page lately, I have been working hard on the new version and due to some limitations in the unity editor some plans i had for the asset where hard to build in.

    Again im still working on this asset and if you have any questions feel free to contact me here, or on the website at www.realisticphysics.com
     
    ftejada likes this.
  48. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
  49. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    There are plans to support it yet however i still cant say when the new update will be out,
    But if its a update or even upgrade the next version will be free for existing users, however the price may go up for new users.
     
    ftejada likes this.
  50. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    depending on what new features you have and which version of unity it supports I would be willing to pay an upgrade path. This new system unity is pushing on asset devs to support multiple versions has got to be a pain.
     
    Mohamed-Anis likes this.