Search Unity

World Building MegaScatter - Easy Procedural object placement

Discussion in 'Tools In Progress' started by SpookyCat, Jan 28, 2014.

  1. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Wait a minute. That mean every time i launch a game all objects (Rock for example) will be at the same place?
    If yes, you got a new customer.
     
  2. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Yes, that's the main reason for the system so you can have complex scenes without the memory overhead when you build your game, and you can adjust the scatter at runtime if you want to increase or decrease the number of objects to suit the hardware it is running on. So you scatter in the editor to get the look you want, then click the remove objects button to clear the scene, check the scatter at start option and build your game and when the level loads the objects will be scattered just as they were in the editor. It helps keep you apps much smaller and load a lot faster.
     
  3. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Thanks for the reply. Deal....New customer here.
     
  4. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Does it scatter system handle grass billboards that face the camera?
     
  5. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    I was thinking about that the other day, and it could be done by adding a scatter particle mode to the system. I am playing with controlling particles for my FumeFX system so I will see if I can find some time and add that in as it would be a useful addition.
     
  6. Baldwin

    Baldwin

    Joined:
    Apr 1, 2014
    Posts:
    37
  7. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    HI There
    To get support please submit a support ticket at the website, you will need your invoice number to get a reply to support.
    Chris
     
  8. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    You will still need to submit a support ticket at the website, threads on this forum are not the ideal place to deal with support requests.
     
  9. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    So instead of having the decency to ask a couple of questions as to whether or not the system will do what you need you just decide to steal it then have the cheek demand answers because you cant be bothered to read the help pages, pure class. Hopefully as a pirate Unity will close your account down.
     
  10. Baldwin

    Baldwin

    Joined:
    Apr 1, 2014
    Posts:
    37
    It's not stealing, I called sharing. I am willing to buy it if it fit my needs, also. Would you buy something in vain? Its not like its cheap. I want my moneys worth
     
  11. Tony-West

    Tony-West

    Joined:
    Dec 8, 2012
    Posts:
    49
    Why don't you simply ask if it does what you need it to do?
     
  12. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    So you are seriously saying the only reason you have not actually paid for the asset yet is because you want to make sure it can scatter in a circle? Yet all you have to do is look at the images and videos on the authors website or this thread to clearly see it can do that (image below) so what is stopping you from buying it and then getting access to the support to find out what the basic mistake you are making is?
     
  13. Baldwin

    Baldwin

    Joined:
    Apr 1, 2014
    Posts:
    37
    Because I have encounter this issue yet...


    No its not that, I'd have a few more questions. But thanks, after looking at the image, I think I know what to do.
     
  14. Tony-West

    Tony-West

    Joined:
    Dec 8, 2012
    Posts:
    49
    So you will be buying it then?
     
  15. rpgw

    rpgw

    Joined:
    Jul 3, 2012
    Posts:
    47
    I'm getting an issue where clicking on a MegaScatter Inspector field, such as clicking a boolean, or clicking update can lock Unity up for 30+ seconds. Sometimes so long I give up and force quit Unity. Anyone else see behaviour like this? Normally value changes and updating is extremely fast.

    Using MegaScatter v1.11, Unity 4.3.4f1, Max OSX 10.9.2.

    If it's just me I will look into replicating this in an example project.
     
  16. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
  17. rpgw

    rpgw

    Joined:
    Jul 3, 2012
    Posts:
    47
    That seems a likely candidate. I will look into this some more. Thanks.
     
  18. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    I purchased this a few days ago and have been using it quite a bit. However, one thing I have noticed is that Update () gets called on MegaScatter derived objects and the method is quite heavy. This seems pointless, especially if you are using the scatter objects to drop stuff at edit time. Are you supposed to enable the component manually only when you need to update the scatter and then disable it after?

    For now I have added a quick check at zone load for enabled scatter components and then log an error and disable them.
     
  19. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    The Update() method does nothing in the MegaScatter object if the bool update; value is false. If the bool is set to true then the object will be scattered again but other than that all Update() will do is check the bool value.
     
  20. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    This is not true. The Update of MetaScatterObject does a heavy GetComponentsInChildren and sets colliders, in addition to pressuring the GC, regardless if this flag is set.
     
  21. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Don't think that is correct, below is the Update() method, and below that the shells of the Fill and FillObject() methods from MegaScatter.cs and MegaScatterObject.cs, and you can see that there is no GetComponentsInChildren or anything that sets colliders if the update bool is false.

    MegaScatter Update:
    Code (csharp):
    1. // MegaScatter.cs
    2. void Update()
    3. {
    4.    if ( meshBased )
    5.      Fill();
    6.    else
    7.      FillObjects();
    8. }
    9.  
    10. void Fill()
    11. {
    12.    if ( shape == null || meshes.Length == 0 )
    13.      return;
    14.  
    15.    if ( update )
    16.    {
    17.    }
    18. }
    19.  
    20. void FillObjects()
    21. {
    22.    if ( shape == null || meshes.Length == 0 )
    23.      return;
    24.  
    25.    if ( update )
    26.    {
    27.    }
    28. }
    MegaScatterObject Update:
    Code (csharp):
    1. //MegaScatterObject
    2. void Update()
    3.    {
    4.      Fill();
    5.    }
    6.  
    7. public override void Fill()
    8. {
    9.    if ( shape == null || meshes.Count == 0 )
    10.      return;
    11.  
    12.    if ( update )
    13.    {
    14.    }
    15. }
     
  22. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    If you could submit a support ticket at the website with some steps to recreate your slowdown I will take look as to what could be going on.
     
  23. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    My update in MetaScatterObject is this:

    Code (CSharp):
    1.     void Update()
    2.     {
    3.         Fill();
    4.  
    5.         Collider[] cols = gameObject.GetComponentsInChildren<Collider>();
    6.         for ( int i = 0; i < cols.Length; i++ )
    7.             cols[i].enabled = true;
    8.     }
    Just checked a clean import as well.
     
  24. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    That is very odd, I will do a resubmit as many times in the past the Asset Store tools does not always pick up on changes in scripts when submitting updates. There should be a new version on the store now so give that a try.
     
  25. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,356
    A question, are moving meshes combined too ?

    For example the grass in the wind is one mesh while moving ?

    Also comparing to using the standard unity terrain grass, how much slower or faster would be to scatter the 3d grass instead ?
     
  26. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    The grass in the video has been combined into one mesh indeed and the movement is done via a shader. The scatter system has an option to calculate the data required by such shaders and bake it into the vertex colors, so you can define how much something would bend and where the bending starts which is controlled by a curve in the inspector.
     
  27. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,356
    Thanks for the info, great job and opens up a lot of possibilities
     
  28. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Look forward to seeing what you create with it :)
     
  29. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Submitted a small update to the Asset Store that fixes the warnings that are shown when importing MegaScatter into a 4.5 project.
     
  30. perspecdev

    perspecdev

    Joined:
    Oct 25, 2013
    Posts:
    9
    First I just want to say how awesome MegaScatter is! I have procedurally generated voxel terrain, and after reading the Mesh Scatter section in the documentation, I was able to set it up to scatter objects on my terrain in less than 5 minutes. After I set it up and was about to click the play button in Unity, my first thought was, "It can't be this easy. There's no way this will work the first time. I must have missed something." To my delight, everything just worked!

    I do have one feature request, though. As it is, I can't really use it in my game because it takes too long to scatter the objects on the terrain. Actually, it doesn't take a long time, but it's long enough that it's not viable for my game. I generate several meshes for my terrain every frame and then call Rescatter() on each one. If I queue up the Rescatter() calls and only allow 1 call every other frame in the scene it's almost bearable, but it still makes the frame rate a little jerky. So if there's any way that the call to Rescatter() could be threaded (as much as possible), or somehow set up to be able to split itself up over several frames, that would be awesome.
     
  31. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    That is something I was thinking about adding in. If a scatter is taking a noticeable length of time it usually means that more than one mesh is being created so it should be a trivial matter to have it do a mesh per frame. I will get that moved up the todo list.

    Apart from that glad to hear you are happy with the system and found it easy to use, if you have any screen shots you can show do let me know :)
     
  32. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Just dropping by to say that all your products are really impressive. Keep up the good work.
     
  33. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Thanks Stephan, will be getting around finally to adding support for your fab text system in MegaBook, it was going to be the first system I used as you know but I got sidetracked with our own game when you sent the beta invite through.
     
  34. gonzorob

    gonzorob

    Joined:
    Dec 1, 2011
    Posts:
    96
    I see in the docs there is a seed value. Can this be supplied at run time before the scatter is generated? I ask because all my levels are procedurally generated and I'd like the scatter to be the same each time :)
     
  35. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Yes, all the values shown in the inspector are public values in the MegaScatter classes so you can change any value from script and then have the object scatter. There is a scatter at Start option as well so you can set the scatter up in the editor as you want it, then click the remove objects button so you are just left with the scatter object then when your scene starts the objects will be placed in the same places.
    Just noticed I haven't added the class definitions to the doc pages, so will get that done.
     
  36. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Hello!
    Just bought your mega scatter plugin, but I am having a hard time to figure out how to use the texture based scatter on terrains...
    Could you please provide the basics steps to generate scatter on a terrain, based upon a black / white mask?
    Regards!
     
  37. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Thank you for the purchase. I have been meaning to do a video guide to the texture based scatter, I will see if I can get that done today or this evening for you. There is a How to Use section on the help page for that scatter type, if you right click the inspector bar to get the context menu and then select help you will be taken to the web page for that scatter type.
     
  38. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Did a quick basic video on the Scatter based on Texture object in the Scatter System.
     
  39. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Excellent! :)
     
  40. KheltonHeadley

    KheltonHeadley

    Joined:
    Oct 19, 2010
    Posts:
    1,685
    Buying this! F***ing awesome.
     
  41. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    I purchased this but have no idea how to use it. where is the documentation? The Asset page has a link that says "More information and Docs" but I cannot find any documents on your site.
     
  42. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    @TemplarGFX - There is a pdf included in the asset with the docs, the docs are also available on the website at http://www.west-racing.com/mf/?page_id=4853 hold the mouse over the menu on the left to get the other pages, and also if you right click the inspector title bar for any MegaScatter component and then click help you will be taken directly to the help page for that component on the website.
     
  43. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    How did I miss that so many times! Thankyou a lot for pointing this out to an idiot like myself!
     
  44. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Just submitted a new version to the Asset Store which adds an option to recalc the static batching after a scatter is done, this is for when you use the scatter at run time option as normally Unity will calculate the static batching for a scene at player start up so before the scatter. With the new option you can ask the system to recalc the static batching so the draw call count will be even further reduced.

    Changes in v1.15
    • Option added to recalc static batching after a scatter, which means in projects that use the scatter at run-time option batching will now work better and reduce draw calls even further.
     
  45. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Thanks for these great Mega--- editor extensions. Brand new to making games because for years I just thought they were made by rocket scientists + magic and way over my head. These tools are more fun to play with than the games themselves. My steam account hasn't been touched since I loaded up Unity and bought a few things from the asset store. I picked up Mega-fiers, Mega Wires, and initially skipped Mega Scatter until I read more about it and realized the magnitude of what this tool can do. Now I really want to complete my Mega collection.
     
  46. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    I can't find it anymore, but did this have Curvy Splines support?
     
  47. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Hi Chris!
    Sorry to bother again, but after some time off, I am trying to re-use your tool again in order to place some mesh objects on a large terrain using masks. I also read the docs, but somehow, stuff works different with me on my scenes. So sorry to say, but I just don't get it. Some parameters and clicks doesn't seem to make sense to me. I am using a mask, but I have no idea how to use the colors. Same goes for parameter collision offset? What is it doing? And how am I suppose to place the gizmo it self? Results are always changing when I offset the gizmo in Y axe. Also, the max count doesn't do anything unless I randomly adjust the gizmo. Currently, I am just randomly doing stuff to get the best shot, but not sure what is really going on here. Is the collision offset a length of the ray or else?
    I think for example, the mask color feature would make more sense if you just add one color bar and leave black = no mesh, red = mesh object 1, green = mesh object 2 etc. So people can forget about setting up black. Also, it took me a while to figure out on how to add a surface for the mesh objects. Its parameter is somewhat hidden and I don't get any errors when I hit the update button. Also, there are two updates buttons, shouldn't this not just one button? And what is Texture object suppose to do if I can add a surface object?
    Anyways; I have so many questions when I am using this tool. I am sure this absolute works great and I still want to use it, but I think, in terms of UI some stuff can be improved. Just positive criticism from a user. It would be great to clean stuff up in the UI and let the advanced options really just advanced options. (e.g. width + height could be default set to bounding box of a terrain, instead of setting that up first. ) I am sure, I am very inpatient, but then again, one can buy so many assets to make Unity better, but one also need to learn those tools from so many different people that has different philosophy on how UI should look.
    Regards! Tom
     
  48. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    how do i make the placed object (trees) really dense like a jungle i put density to 0.001 but they are still very spaced out
     
  49. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    remove object just crashes unity
    also this is realy low performence when using unitys terrain i can have the max limit of trees and it runs smooth with this i have like 100 and im down to choppy fps
     
  50. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,765
    Just submitted a small update to the Asset Store and our webstore. We had a request to allow for surface colliders to not need to be enabled for the scatter to work and also to turn of surface colliders after a scatter so as to keep the number of active colliders in a scene as low as possible for mobile devices, so for each surface you want to scatter on to there are two check boxes in the inspector, the first will say to enable the collider pre build, the second says to disable the collider post build. For most cases you wont need to use them but for users who are doing runtime scattering and want to keep control of the colliders the option is useful. Also increased the raycast range to allow scattering over a larger vertical range.

    Changes since v1.15
    • Added option to the scatter surfaces to enable the collider before the scatter.
    • Added option to the scatter surfaces for all layers to disable the collider after the scatter.
    • Increased the raycast range from 1000 to 10000 so making it possible to scatter over a larger vertical range.
    • MegaScatter now imports into Unity 5.x with no autochanges required.
    • Updated the MegaShapes version to the latest, which will stop any errors if used alongside the full version of MegaShapes or MegaFiers
    • Added KML import option to MegaShapes.