Search Unity

MegaFlow - Vector Fields & Fluid Flows [Released]

Discussion in 'Assets and Asset Store' started by SpookyCat, Nov 3, 2014.

  1. JamesPomme

    JamesPomme

    Joined:
    Nov 18, 2014
    Posts:
    9
    Well,

    In my scenario I have a 2D map (no gravity) with wind comming from the lower left corner of it.
    On this map, player can put multiple objects that are static (like barriers to create corridors for wind) or mobile (a ball for example).
    Physics says this wind should speed up in a narrowing coridor.
    Let say that the ball speeds up due to wind friction. Third newton's law says the wind should also decelerate due to friction on the ball.

    Then, In these examples, there is a feedback of GameObjects onto the wind field.

    What kind of tool should I use together with MegaFlow to obtain that kind of behaviour?
     
  2. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    That would require some form of fluid dynamics system, the fact it is 2d will make life easier, not sure I have seen anything directly for Unity but there are quite a few sources out there for 2d fluid systems.

    On another note we hope to get the update with the moving sources on the asset store today or tomorrow, the docs on the system are on the website, just doing a video or two showing how to use the new components and a demo scene in the asset. The release will see the end of the early adopter pricing.
     
  3. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Quick video showing how to use the Moving Source system coming in the next update of MegaFlow.
     
    Karearea and John-G like this.
  4. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Submitted a new version to the Asset store and on our website, this brings the beta of the moving source system along with controllers for the Shuriken and legacy particle systems. Also added a Sample velocity helper which you can attach to your game objects to get the velocity data for that position so you could use that data to control a flight sim or allow drafting in a racing game for example. The docs have also been updated to include the new features and the changes to the inspectors, and if you have MegaWires you can now use flow sources as wind input to the wire physics system. And the latest Unity 5.0 beta now imports packages correctly so the demo scenes work just fine now.

    Changes in v1.08
    • Added beta of the new moving source system.
    • Added a simple demo scene showing the moving source in use.
    • Added a Shuriken particle controller that uses moving sources.
    • Added a legacy particle controller that uses moving sources.
    • Added method to MegaFlowFrame API to get flow velocity as a world space position. Makes it easier to use for external scripts.
    • Changes made so users of MegaWires can use flow sources as wind sources for the wire physics.
    • Improved the inspector layout for the Create Flow system.
    • Added helper component MegaFlowSample which has two methods to allow you to get easily get the velocity from a flow field.
    • Updated the docs page for the MegaFlow source to show new options.
    • Updated the docs page for the Create Flow system to show the new options and inspector layout.
     
    Karearea and John-G like this.
  5. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi,

    Confirming the sampler works very well with Playmaker get/set property actions.

    Cheers,

    Nick
     
    John-G likes this.
  6. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Very quick update which allows you to specify a name split character for importing FXD or FGA files, since in the old version if the name part had numbers in it such as Flow01_0001.fxd it the system would get confused loading the frames, you can now set the name split to '_' for that that example it will work fine. And also for FGA files different exporters use different numbering conventions so added an option so you can say how many numerals are used in the sequence part, so if your FGA files are say Flow001.fga you can set the slider to 3 to say 3 numbers are used in the
    sequence.

    Changes in v1.09
    • Added a namesplit option for FGA, FLW and FXD sequence loading in case your filenames have numbers in apart from the sequence number.
    • For FGA importing also added a Decimal Format value so you can say how many numbers make up the sequence part.
     
  7. Visual_Lies

    Visual_Lies

    Joined:
    Nov 3, 2014
    Posts:
    17
    Hello I've been absolutely enjoying using your products as they have expedited so many things in my work flow and opened up other possibilities. I was wondering if we could get a decent demo of the smoke gun features like shown in the video with moving emitter and blue cubes. I've been playing around with it trying to get a similar effect but without much luck.
     
  8. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    @Visual_Lies I will get that added in for the next update. If there is anything else you would like to see just email me or post here.
     
  9. Vern_Shurtz

    Vern_Shurtz

    Joined:
    Mar 6, 2009
    Posts:
    264
    I am also struggling with the smoke gun effect and trying to create a similar scene to this vehicle example.

    I have sent in a support ticket on this subject.

    Thanks
    Vern
     
  10. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Just submitted an update to the Asset Store, this brings some fixes for Unity 5 and also updates the MegaShapes system to include numerous bug fixes and features. Remember you can use the included MegaShapes spline system for building meshes or for path following not just for defining flows.

    Changes in v1.10
    • Further small changes to make compatible with Unity 5.0
    • Made changes for latest Unity 5 beta to fix any import warnings.
    • Fixed exception when adding a new curve to a shape.
    • Added option to Spline Tube Mesh to flip normals for inside tubes.
    • Added option to Spline Box Mesh to flip normals for inside box tubes.
    • Added option to Spline Ribbon Mesh to flip normals.
    • Imported SXL splines will now no longer change values to centre the spline.
    • Imported SVG splines will now no longer change values to centre the spline.
    • Added Centre Shape button to Shapes Inspector to allow you move the pivot to the centre of all the points.
    • Added new InterpCurve3D method which will return the postion, twist and also rotation quaternion for a point on a spline.
    • Autocurve now does the first and last handles on open splines.
    • Added 'Update on Drag' option to MegaShape inspector, if checked spline meshes will update as you drag, off then they will update when dragging stops.
    • Fixed inspector for spline animations so buttons aren't hidden.
     
  11. Visual_Lies

    Visual_Lies

    Joined:
    Nov 3, 2014
    Posts:
    17
    No added or updated demo's with the Smokegun on this update?
     
  12. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Just doing a round of updates on our Assets to make them fully compatible with the latest Unity 5.0 release then I will get a SmokeGun added to the demo scene. We did have one oser email us recently regarding the Smokegun asking how I got it to look like the smoke in the demo videos so just to avoid any confusion the Smokegun script is for inserting streams of objects into a flow and was written before supporting the Shuriken particle system which also allows you to use meshes for particles so there is some cross over there. So if you just want smoke trails etc then best to use the particle scripts but if you need full game object control then the SmokeGun script is the system to use.
     
  13. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Just submitted an update to the store. I have improved the SmokeGun system and made it easier to use and added more options to make it more useful. Also added a SmokeGun to the demo scene so you can see an example of it in use.

    Changes in v1.11
    • Added missing Mass value to the Flow Effect inspector.
    • Update the SmokeGun script with more options and to make it easier to use.
    • Added a SmokeGun object to the demo scene.
     
    elbows and John-G like this.
  14. Visual_Lies

    Visual_Lies

    Joined:
    Nov 3, 2014
    Posts:
    17
    Thank you for the demo!
     
  15. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Just submitted a small update to the Asset Store, this adds some extra features to the Smoke Gun system, you can now define a range for the start rotation of emitted objects. Also on the Flow Effect object we added an option to have the object align itself either to the flow direction or to the direction the object is moving in, and also added a color gradient option so the objects color can change to show the speed of the flow, this can be useful for say adding moving arrow objects to show the flow etc.

    Changes in v1.12
    • Added option to Smoke Gun to set range of start rotation of objects.
    • Flow Effect now has color gradient option to change the color of the object depending on the speed range set.
    • Added option to Flow Effect to align objects with the flow direction or the object movement direction, useful for arrows objects to show flow direction etc.
     
  16. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Thanks for the update, was going to try and add the code to align my objects to the flow direction, can now have my arrows positioned in the world showing the crowd flow directions, keep it up :)
     
  17. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    If there is anything else you need adding just let me know, will do my best to add it in asap.
     
  18. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Had a request from an UE4 user to add an export to FGA option to MegaFlow so flows imported into MegaFlow or created with MegaFlow can be exported out to be used in the UE4 engine or any other system that makes use of FGA files so just submitted a small update that adds an Export FGA button in the Advanced params section of the inspector.
     
    Visual_Lies likes this.
  19. KB

    KB

    Joined:
    Dec 9, 2012
    Posts:
    18
    I picked up this asset this afternoon. I've added a new test scene to a project (in Unity 5) and I'm following the instructions from the PDF that came with the asset. In the first section of "Creating a Flow Field" it seems to go wrong when I click the "Add Spline" button and pick the "Circle Shape"; where your document says "you will see a series of rings appear", I see no rings. I've tried this a couple of times. Where can I be going wrong so soon!?
     
  20. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Thank you for the purchase, if you could submit a support ticket at the website so I have a record, I will look into that for you.

    Edit: When you click the Add Spline button and then select the Circle shape you should see the flow direction arrows, the size of the rings is dictacted by the Falloff Dist value, if you have a long spline and a small fall off dist then the circles will be very small, try increasing the dist value and also the Velocity values to see the circles etc. Just tested it her in Unity 5 and all is working as expected.
     
    Last edited: Mar 5, 2015
  21. KB

    KB

    Joined:
    Dec 9, 2012
    Posts:
    18
    Thanks for the reply. I re-loaded my test scene and then I could see the rings on one of my sources but not the other. I then changed what I had selected a few times and after a few goes I then could see the rings on my second source, it seems I had to select it to get the rings to show, (after reloading the scene).

    Trying this again, I selected a different scene then returned to my test scene. Again, I can see the rings on just one of the sources (the first I'd created, also first in hierarchy list). Selected the second source I can then see both sets of rings. Clicking on nothing in the scene edit window and the rings vanish on one of the sources.

    I then added a 3rd circle and source. Again, I can't see the rings at this point on my new circle/source. I try changing the radius, falloff etc. is default (same as the others that I can see). I check the boxes on all the sources to say show gizmos. I still see nothing on my 3rd circle + source.

    I load a different scene and then go back to my test scene, now I can see the rings (as the gizmo box is checked). It should have shown the rings before I think. I wonder if a little editor tweak might be needed.
     
  22. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    I will investigate that, just so you know it is best to submit a support ticket at the website for a quick response, the email notifications on this forum just don't seem to work very well where as support tickets get priority responses.
     
  23. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
  24. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Been getting a couple of emails asking if MegaFlow is compatible with Unity 5, The answer is yes, all our assets are compatible with Unity 5 :)
     
  25. Elmotron

    Elmotron

    Joined:
    Mar 6, 2015
    Posts:
    2
    Hi, I would also greatly appreciate an example of a spline based flow field that is used to move rigid bodies. I tried everything but my single rigid body (sphere) just does no move at all under the flow filed. (has 2 components: rigid body and megaflow rigid body).
    Thanks.
     
  26. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Just did a check and it seems I didn't update a method in the RigidBody script in the last update, will get that fixed now for you and upload a new version, If you can submit a support ticket at the website I can send over the updated file now if you are in a rush.
     
  27. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Just submitted an update that fixes that problem and the sample scene includes a rigid body object being controlled by the flow.
     
  28. Elmotron

    Elmotron

    Joined:
    Mar 6, 2015
    Posts:
    2
    Wow, that was quick, thanks a lot ;)
     
  29. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Short of adding a long spline with a far falloff distance and flat falloff curve, is there any way of giving the whole vector field a baseline direction? Ie a tidal flow could be overall x0 y0 z2, with individual splines adding or subtracting from that. And would this reduce the effectiveness of the optimise feature?

    Cheers, Nick

    Edit: After a bit of testing, the single large spline with all-encompassing reach seems to work really nicely. I'll stick with that!
     
    Last edited: Apr 10, 2015
  30. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    I could add an initial state value to the system, would just mean having a Vector3 value in the inspector which will be used to initialize the grid, will add that for the next update. Anything else needed?
     
  31. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    New version submitted to the Asset Store that adds a Start Value option to the Create Flow system so you can set a starting velocity for the flow grid.

    Changes in v1.17
    • Added a StartVal to the Create flow inspector which will be used to initialize the flow grid so you can easily set a start flow state.
     
  32. eventropy

    eventropy

    Joined:
    Oct 4, 2012
    Posts:
    255
    Is it possible to include megaflow source with frames in asset bundles? From what I've seen this doesn't seem to work.
     
  33. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    @eventropy - I presume you are the same person who just gave us a 1 star review, I have not had any email requests for the Max exporters for ages, and in fact there is not even a MegaFlow exporter for Max as it uses FXD files and FGA files, when did you send the request and how? The MegaFlow data is stored in ScriptableObjects since storing the data directly in the MegaFlowSource component means Unity internally saves the data when ever any change is made to the inspector which brought the editor to a crawl, so we were forced to use ScriptableObjects, and for some reason Unity does not serialize SO's when making prefabs or bundles. We have not had any requests for this functionality to be added to the system so far, we are keen to add features that are needed by users of our assets but it would be nice to hear that they are needed via a support ticket or email instead of reading a 1 star review.
     
    Last edited: Jun 11, 2015
  34. eventropy

    eventropy

    Joined:
    Oct 4, 2012
    Posts:
    255
    @SpookyCat

    Yes that was me. I sent you an message through the support section of your site (http://www.west-racing.com/mf/?page_id=385). I don't know why that didn't go through. So is there some way to obtain the max exporter?

    My current workaround for the asset bundle issue is to export the entire scene that includes the mega-flow object (using BuildPipeline.BuildStreamedSceneAssetBundle) and that actually does work, and that seems good enough for my purposes.
     
  35. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    According to UserVoice your ticket was rejected as spam as it was to short since it only contained a number, I presume an invoice number. If you submit a support ticket but make it a little longer perhaps including the version of Max you are using and whether it is the 64 or 32 bit version as it requests on the support page. Thanks.
     
  36. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    If anyone does need a plugin for Max to generate Vector Fields inside max and then export them as FGA files for use in MegaFlow you can get such a script by looking in the description of the video below. MegaFlow can play back the FGA files used by UE4 so any other system designed to generate Vector Fields for UE4 for say Houdini, Blender, Maya, Max etc can be used.



    You can also do what is shown in the video below directly inside Unity with MegaFlow as it does have an authoring system built in that uses splines to define flow directions and speeds etc. The system has been extended and improved since the video below was made to give you more control and features in the authoring process.
     
    John-G likes this.
  37. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Just submitted an update for MegaFlow, this brings the version of MegaShapes included in the asset up to the latest version, it adds support for OSM file import for splines, adds lightmap support to the basic meshing options for splines and fixes various small bugs in the spline and meshing options.

    Changes in v1.18
    • Fixed MegaShapeLightMapWindow problem when doing an app build.
    • You can now build lightmap data for MegaShape standard meshes.
    • Changed OSM importer to use ulong for ids instead of int so can now handle complex OSM files.
    • Fixed Shape labels being displayed if behind the camera.
    • Added a beta OSM data importer. Click the Assets/Import OSM option.
    • Added FindNearestPointXZ and FindNearestPointXZWorld methods to MegaShape API.
    • Fixed exception if trying to build a mesh with a shape with no splines.
    • Fixed exception if trying to interpolate along a shape with no splines.
    • Fixed exception if trying to interpolate a spline with no knots.
    • Autocurve fixed so the last knots handles on an open spline are correct.
    • Fixed some potential errors in the constant speed interpolation.
    • Smooth value is now a slider and shows results in realtime for easier use.
     
  38. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
  39. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    He has some cool effects, I am guessing that as he used Maya Fluids to build those that they would work the exact same in MegaFlow?
     
  40. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    I have not used UE4 so not sure how their assets work but according to the authors website he created the vector fields in Maya and exported them to fga files which is a file format supported by MegaFlow so if the fga files are included in the pack they can indeed be used with MegaFlow.
     
    John-G likes this.
  41. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Great, I will see if I can contact the author and find out if fga files are included, I have not used UE4 either. Another quick question, looking at the video above the vector fields seem to change over time, any idea how that is done and can that be done in MegaFlow?
     
    John-G likes this.
  42. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Well you have a choice looking at the video it seems the vector field is just being rotated which you are free to do with the MegaFlow sources, you can move them, scale or rotate them in anyway and it will effect the particles accordingly, so for a tornado you would just rotate the source about the vertical axis. The other option you have is to have multiple frames of data in the source and then change the frame over time.
     
  43. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Arr, feeling a bit daft, never thought about just spinning the sources, it works well, adds a nice extra dimension, even gently rocking it back and forth adds a lot to my simple flows, even more excited about using this now. Just need to learn Maya fluids a little now so I can have litter blowing down my alley ways and stuff now, great stuff.
     
  44. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    If you do have any luck with that Maya Vector fields pack let me know, always keen to see the system being used. Funny I am also using the Maya Fluids system to model wind flow down alleys and around buildings :)
     
  45. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Can flow maps be made using Modo indie?
     
  46. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    I don't know a lot about Modo but if it has support for exporting to FGA or FXD format then it can work, if it has another file format it uses then let us know with maybe an example file and we can see about adding an importer for that.
     
    John-G likes this.
  47. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    I have errors in unity 5 all over the place, mostly "Binary to YAML conversion: type UInt16 is unsupported"
    And MegaFlow doesn't work.
     
  48. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    @olix4242 - That is very odd, just tested here with Unity 5.0 and 5.1 and not seeing any errors and the demo scenes work fine, also not had any other reports of it not working or any problems, if you could maybe submit a support ticket at the website with an outline of the steps you are taking and info on the version of Unity you are using, platform etc then we can take a closer look.
     
  49. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Just submitted a small update to address the newly Obsolete methods in Unity 5.1 and Unity 5.2
     
  50. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    Another small update in the Asset Store, we had a request to add the option to interpolate between flow frames for particle control so we added that. You can now turn on the Interpolate option in the inspector which will show a second frame number option and a frame alpha slider, you can now select a second frame and control the transition from one frame to the other, you obviously also do this via scripting as well if you need to. Turning on the interpolate option will take a little more CPU time as the system has to do two flow frame lookups so if you do use it make sure you change the original frame value to the second one and set the alpha value to 0 when you complete the transition. Also fixed a little bug which could cause particles to not flow correctly when using a platform that does not support threading.

    Changes in v1.20
    • Added an interpolate option to the particle controllers so you can smoothly move from one flow frame to another.
    • Fixed particles not flowing correctly on platforms with no threading support.