Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Liquid Physics 2D

Discussion in 'Assets and Asset Store' started by Physical_Liquid, Nov 24, 2014.

  1. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33


    Hi,

    My name is Sam Warner, I'm the creative director at Physical Liquid Software.

    I'm just posting to announce our new asset is released on the asset store! We've spent a lot of time effort and money on creating this asset and we hope you enjoy it!

    The Asset is called 'Liquid Physics 2D' (LP2D).
    https://www.assetstore.unity3d.com/en/#!/content/23907

    Liquid Physics 2D is, as the name suggests, a 2D physics engine plugin for Unity. It's based on a version of Box2D and LiquidFun (an extension of Box2D).

    It's an easy to use tool that allows you to create advanced physics based games and simulations within the unity engine. It can simulate tens of thousands of particles in real time to create realistic fluid effects.
    Check out the trailer here:


    It can even simulate 1000’s of particles in real-time on modern mobile devices. (ios and android)
    Check out the android testbed app here: https://play.google.com/store/apps/details?id=com.physicalliquid.lp2d&hl=en


    Our asset is in continued development and is fully supported.
    Check out our dedicated support forum for more information and asset support here: http://physicalliquid.com/forum/index.php

    All the best,
    Sam
     
    Last edited: Nov 24, 2014
  2. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    This looks really impressive!!! There was definitely room for some competition in the asset store for fluid physics. Price seams fair if a bit out of my personal range. It would be cool to see a "light" version with a lower price point but more limited functionality. Anyway nice work, fluid simulation is so cool!
     
  3. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Looks very nice, my only thought is it looks too slow-motion... everything moves and reacts slowly.. is there an adjustment for that?
     
  4. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    Hi TheValar,

    Thanks for the kind comments, we're very happy with it! It's taken our team months of work but we're very satisfied with the end result. We are considering a 'cut-price' limited version sometime in the future.
     
  5. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    Hi ImaginaryHuman,

    Its not really in slow motion, the scale of the simulation is just quite big. They are big bodies of water, many metres across. (therefore the 'water' moves more slowly, as in real-life) You can of course make the simulation smaller, or you can change the scale of gravity on only the particles which can make the scale of them appear smaller or you can simply make the simulation run faster if you wish. The plugin as a whole is infinitely adjustable!

    If you are curious as to how it all works in detail, check out our tutorial videos:





    https://www.youtube.com/watch?v=C9goHuHBmxQ
     
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,918
    Hi

    I have seen in the asset that there are two licenses included, one for the asset itself and one for liquidfun.

    Is it possible to have a quick description of what these licenses say ?

    Also does the system require Unity Pro and does it support refraction in the water ?

    Thanks
     
    Last edited: Jan 23, 2015
  7. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    Hi, both licenses are very basic. Our one simply states the plugin was created by us and is subject to the basic unity asset store license.
    Liquidfun is also free to use for any commercial or non-commercial project under the creative commons license.

    Here is our license:
    Here is liquidfun's:
    The plugin requires unity pro on mac but not on windows.

    In terms of refraction...you can write and include any shader you want with LP2D, so yes you could potentially simulate a liquid refraction effect in a body of particles in LP2D. note: many advanced shader features are unity pro only.
     
  8. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    If you purchase the asset and visit our dedicated support forums, we could give you a few pointers on writing a "refraction" shader! :)
     
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,918
    Thanks for the clarifications.
     
  10. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,140
    Nice - so if it's physics-based does it handle water pressure properly around a u-bend (so it settles to an equal height either side)? - that always seems the hard bit in water simulation
     
  11. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    Essentially yes!

    of course how well it 'settles out' would depend on particle size in relation to the 'u-bend' width. think of filling a u-bend with lots of ball bearings, if you use lots of small ball bearings they should settle out perfectly either side, however if you used very big ball bearings some might get jammed!

    also our particles are VERY tweak-able, you can change their gravity scale, iterations, materials, friction etc. etc...

    But yes, although we do say it ourselves this is the most advanced, accurate and fastest 2D liquid physics engine plugin for unity and each individual particle is a physics object so the effect you are talking about is, well, 'built in'! :)
     
    Last edited: Jan 23, 2015
  12. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    Hi @Physical_Liquid, what happend with the Asset packege?
    I had bought this asset some time ago from the Assets Store and now i cant see in my lis of "Packages" anymore!, what happen? how i can download from the assets store now?
     
  13. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    LP2D is currently off sale for the time being. It will be back on sale in the next month or 2. we apologise for any inconvenience.
     
  14. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    Hi @Physical_Liquid, i know that is off sale, but I already had bought that the last year.. how i can download now?
     
  15. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    official from unity: 'Assets are removed from the store either because the publisher has decided they no longer wish to sell the asset on the Asset Store, or due to some kind of EULA violation which required that we take it down.

    If you wish to get another copy of the asset and you no longer have a local copy of it handy, it's up to you to contact the publisher from whom you purchased the asset.

    You can find a local copy of the assets you have purchased in the directory below:

    Windows - User>AppData>Roaming>Unity> Asset Store
    Mac - User>Library>Unity>Asset Store

    Ensure you keep a backup of all the assets you purchase.'


    If you don't have a local copy could you please email us your order number and we will send you the package. thanks.
     
  16. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    Hi @Physical_Liquid, how I can contact the publisher? there is mail o something to send my order number?
     
  17. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    When you purchase from unity, you are emailed an invoice number. Send it to the above Physical_Liquid chap.
     
  18. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    yes i know i got the invoice number, but how i contact the publisher? there is a mail or something to contact the publisher?
     
  19. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    info(at)physicalliquid(dot)com
     
  20. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    290
    Do you have any plans to make a 3d liquid particle simulator ever?
     
  21. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    Not in the foreseeable future im afraid.
     
  22. derek9975

    derek9975

    Joined:
    Mar 17, 2014
    Posts:
    9
    @Physical_Liquid
    I saw this on your plug in's description:

    "The plugin has some performance issues with iPhone 4s and lower devices. Iphone 5 and above work well and can simulate 1000+ particles. The plugin is untested with iPhone 6. (Improvement of ios performance is of paramount importance to our development team, The release of Unity 5.0 should increase ios performance.) "

    Has iOS performance improved at all? Has it been tested on iPhone 6 yet? 6/6+ have been out for 8 months now
     
  23. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    Hi,

    Yes there have been improvements on ios devices. We are currently building a game for a client that has 1200-1300 particles. The plugin works fine on ios it just generally works better on android.

    We have tested iphone 6 and the plugin works fine on it.
     
  24. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
  25. derek9975

    derek9975

    Joined:
    Mar 17, 2014
    Posts:
    9
    How large of a water simulation is 1200-1300 particles? I assume the smaller the particle being used the more "fluid" the water looks. Using a game like "Where's My Water?" as a basis, how many particles would one of those levels probably take with your system?

    Is there a demo version of the plug in that can be tried out for a day?
     
  26. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33

    From my playing of the game and watching videos i would say you would be able to re-create 'where's my water' with <1000 particles in LP2D using our included metaball shader. check out this test scene i mocked up in 5 mins using the default metaball shader. it has around 1000 particles ( a few are off screen). note: you would get far better results if you tweaked the shader and particles for more than 5 mins!!



    unfortunately we do not have a demo version of LP2D.

    btw you may be able to get far more than 1300 particles out of an iphone 5. that's just the number our current game uses. obviously you'd get more out of an iphone 6/6+
     
  27. derek9975

    derek9975

    Joined:
    Mar 17, 2014
    Posts:
    9
    I ran the demo app on an S3 and tried to keep the particles between1k-2k for most scenes and was impressed.

    A couple of quick questions:

    1.) Are the particle numbers settable via script? I have a hunch that if we go the route we are going now, we will have to support iPhone 4 since it can run iOS 7, and being able to limit the particle number dynamically at run time would be a great benefit

    2.) Is the source of the plug in available? Can we make tweaks/optimizations that may fit our immediate need?

    Thanks again for the all of the feedback
     
  28. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33

    Thanks, it actually runs extremely well on an S2 aswell!

    1.) Yes. there are lots of ways of restricting particle counts for various reasons. for example you could have a script that would delete 'older' particles or particles that were 'not moving much' if say the FPS dropped under 30.

    2.) All source code for everything is included. you can tweak it as much as you like.

    We hope you enjoy the plugin.

    If you need technical help after purchase please visit our dedicated support forum: http://physicalliquid.com/forum/index.php
     
  29. derek9975

    derek9975

    Joined:
    Mar 17, 2014
    Posts:
    9
    Thanks again for everything!

    If I have any further questions, I'll hit the forum :)
     
  30. Wellsword

    Wellsword

    Joined:
    Mar 6, 2015
    Posts:
    6
    hi, does it support webgl in unity5?
     
  31. Wellsword

    Wellsword

    Joined:
    Mar 6, 2015
    Posts:
    6
    so, it means I can use it to build a webgl H5 game?
     
  32. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    Hi apologies this was incorrect information. plugins are not supported for web development through unity for security reasons.
     
  33. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    Physical liquid I think you really need to include a non natively compiled version of this as well as just the separate dlls for each platform. There is even an example of if running in html5 on the liquid fun site where they converted it from c++ to javascript. You should do the equivalent in unity into c sharp from javascript. I am assuming there is a small performance hit from it not being natively compiled but the html 5 version on the liquid fun site works fine even on my android phone. The issue with the way this plugin is at the moment in that it has separate dlls for different platforms holds it back. For example there are some android devices that have x86 rather than arm chips in them so I am assuming it would error on them because it is always being natively compiled for a specific processor type.

    The way the plugin is at the moment also wouldn't work on consoles and also wouldn't be able to work in html5. I don't think it is a security issue with html5 that prevents plugins it is a practicality. HTML5 is designed to run on any processor type for example arm or x86 or anything else. HTML5 is compiled at runtime on the device that is using it so it will work with any processor. Unity can do the same and will do all the converting for you but only if you give it c sharp or javascript that it can understand.

    Also the reason I say you should convert it to c sharp rather than javascript is apparently you get faster performance in unity html5 if you let it take c sharp code which it converts to c++ and then compiles back to javascript rather than writing the code directly in javascript yourself.
     
  34. Physical_Liquid_Conor

    Physical_Liquid_Conor

    Joined:
    Jun 4, 2015
    Posts:
    2
    Hi Ian,

    I think the performance hit from using a c# port would be greater than it seems at first. A physics engine is a perfect case where you should use a native c++ plugin in Unity to get maximum performance. LiquidFun also uses some platform specific optimizations which would not be possible in a c# port. For example the NEON SIMD assembly files would not work in a c# unity script. The performance difference becomes apparent when I try the html5 testbed on the liquidfun site. It is a very basic example with and still doesn't give a useable frame-rate on my Note2, which can run over 6000 particles using the native plugin.

    We currently support both Windows and Mac on x86 and x64, ARMv7, ARMx86 and iOS 32 and 64 bit. We are also working on supporting Windows phone which should be released soon. Consoles are not supported and as far as I'm aware there are no plans to support them.

    With regard to the web player you are correct, even if Unity provided web player plugins we would have to include a binary for each platform. It would be possible with the browser plugin though only for security reasons, but not in html5. I will look into using the Emscripten javascript port with our Unity plugin. It might be possible to port our interface to javascript and include liquidfun.js in the html5 release.

    I hope that clears up our decision to use a native plugin over a c# port.

    Conor
     
  35. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    I think you are underestimating modern compilers. Perhaps you are not running the latest version of Android on your phone. On my nexus 5 that html5 webdemo starts off slow for a few seconds until it is compiled and then runs at 60 fps on a 2 year old phone. Modern browsers no longer interpret html5 they instead recompile it and so can run it at near native speeds. On my phone it starts off interpreting the water demo while it is compiling and I agree that it is unusable at that speed but after a few seconds after the compile it runs fine at 60 fps. The compiled version runs about 20 times faster.

    My point is that unity with its upcoming newer compiler will be able to do the equivalent and on non html5 platforms will even compile it before hand for the specific platform so you don't need to even wait. The overhead should only be in the order of about 5 % or so.

    The reason google has blocked native plugins now is that HTML5 has got near to the point of matching its performance without the added security risks that go along with native. Console manufactures are starting to do the same thing too.

    My point is as long as you give unity some code it can actually understand rather than only link to a native plugin that has already been compiled it can then be used on all platforms. You don't have to replace the native plugins but just have it as an option so you have the best of both worlds.


    It used to be that javascript or C sharp where interpreted managed languages which were slower but multiplatform. C++ was a non managed language that had to be compiled into assembler for a specific native platform but had the benefit of speed.

    The modern compilers now take a managed language like c sharp convert it into a non managed language of c++ themselves for speed and then compile that into assembler.

    The result is you get native performance that is crossplatform.

    In the same way that some people used to write in assembler rather than c++ for performance because they wrote better code than the compiler would do. Now most people write in c++ for performance because the compiler writes better assembler code than a human would.

    It has now finally reached the point where a compiler can convert c sharp into c++ nearly as efficiently as a human can.
     
  36. Mortalbombat

    Mortalbombat

    Joined:
    Aug 5, 2014
    Posts:
    10
    Hi
    Does it work with unity OntriggerEnter or OnCollisionEnter functions? Or do you have some of our own functions like that?
    For example I would like to detect if any of the particles collides with some area and check it from code.
    Or another example I would like to detect if my bucket is filled with water. Is this possible with this asset?
     
  37. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
  38. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33


    Our new mini puzzle game built with LP2D is out now on Android (out soon on iOS) try it out and let us know what you think!

    It's a good example of the diverse kind of games you can make with LP2D.
    We will be expanding it with many more levels if you guys like it!!

    Blob-E Blox
     
  39. m_wasim_bashir

    m_wasim_bashir

    Joined:
    Oct 2, 2012
    Posts:
    25
    @Physical_Liquid
    i am using
    Liquid Physics 2D and its working good on android but on iOS my application crashes on splash screen in
    b2BlockAllocator
    . Here is screen shot
     
  40. Physical_Liquid

    Physical_Liquid

    Joined:
    Jun 25, 2014
    Posts:
    33
    Hi,

    please post a question on our official support forum: http://physicalliquid.com/forum/index.php

    thanks
     
  41. MOSTY

    MOSTY

    Joined:
    Sep 6, 2013
    Posts:
    266
    This looks awesome!
     
  42. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,476
    Does anyone know where this is still available?
    Looking at the videos and the ten-thousands of particles this could be kinda the best 2D physics engine for Unity.
    Sadly the asset has been removed and the forum is full of spam :(
    Think even without support, people would buy it...