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. Dismiss Notice

MegaScatter - Easy Procedural object placement

Discussion in 'Assets and Asset Store' started by SpookyCat, Feb 7, 2014.

  1. thieum

    thieum

    Joined:
    Apr 8, 2011
    Posts:
    59
    Thanks for your quick reply!
    I tried this workaround, but load time is more important if I scatter on start up. My proper issue is due to the fact that I load asynchronous levels, i.e. the tiles of an open world, so generating all the instances means a few seconds lag...
    I'll give a try to my idea to generate proxy gameobjects and replace them with my prefabs in runtime.
     
    Last edited: Mar 2, 2016
  2. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    402
    Hey Chris

    I'm having a few problems with MegaScatter Mesh Texture and I am seeing this:

    x == 0 && y == 0 && blockWidth == dataWidth && blockHeight == dataHeight
    UnityEngine.Texture2D:GetPixelBilinear(Single, Single)
    MegaScatterMeshTexture:FindPos(Int32, Int32, Vector3&, Vector3, Single&, Single, Single&) (at Assets/Mega-Fiers/Scripts/MegaScatter/MegaScatterMeshTexture.cs:103)
    MegaScatterMeshTexture:Fill() (at Assets/Mega-Fiers/Scripts/MegaScatter/MegaScatterMeshTexture.cs:331)
    MegaScatterMesh:Update() (at Assets/Mega-Fiers/Scripts/MegaScatter/MegaScatterMesh.cs:228)

    I am trying to follow the docs, and it would help if there was a sample scene showing how to scatter into a texture with a color mask, but I seem to have got it working as per picture below, but there is the above error.

    Also, there seems to be a rogue gizmo, which I cannot explain on the right. Any ideas what this could be?

    thanks

    Nalin
    Screen Shot 2016-03-30 at 09.25.08.png
     
  3. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    @puzzlekings - If you could submit a support ticket at our website with some pictures showing all the settings in the scatter inspector we can take a look for you.
     
  4. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    402
    ok, thanks will do
     
  5. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    A small update submitted to the Asset Store, this updates adds a new feature to the Run time scatter option, you can now tell the system to use a CoRoutine to do the scatter so the scatter task is spread over multiple frames, there is also a param to say how many object will be scattered per frame so you can throttle the scattering process as you need. This new feature works with the Scatter Mesn, Scatter Texture Mesh, Scatter Object and Scatter Texture Object layers, if you use it with the Scatter Mesh layers then the scatter objects will appear when a mesh is filled (remember you can set the vertex count limit per mesh) if used with the Scatter Object layers then the scatter objects will appear at the rate you set per frame.

    Changes in v1.29
    • Added new option to 'build on start' for Scatter Mesh, Scatter Object, Scatter Mesh Texture and Scatter Object Texture so it can be spread over multiple frames, if the option is selected the scatter will be done by a CoRoutine and the amount scattered per frame is set by the 'Num Per Frame' option.
     
    thieum likes this.
  6. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    402
    Thank you Chris :)
     
  7. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Let me know if there are any problems.
     
  8. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    402
    Hey Chris,

    Is there any way of getting scattered objects to stack upon each other? or maybe like being able to specify layers for scatter?

    cheers

    Nalin
     
  9. ldlework

    ldlework

    Joined:
    Jan 22, 2014
    Posts:
    46
    It would be nice if this asset offered some kind of event handling so that we could post-process or otherwise respond to scattering.
     
  10. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    If you let me know which events you would like I will get it put on the todo list for the next update.
     
  11. droderick

    droderick

    Joined:
    Aug 25, 2008
    Posts:
    169
    Hi Chris,
    Is there a way to scatter/place objects uniformly along a spline? Looking to place objects along the side of a road with fixed distances between them. thanks
    d
     
  12. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    There are the Scatter Mesh Along spline and Scatter Object Along spline options which allow scattering of meshes and objects along or around splines but probably not what you need. What you need is actually in our MegaShapes asset that allows for objects to be regularly positioned along a spline with start and end objects as well as different rules for placing extra objects along the spline as seen in the video below.
     
  13. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Just submitted an update to the Asset Store and our webstore. This makes MegaScatter full Unity 2017 compatible, we have also updated the MegaShapes component included in MegaScatter with all the improvements and fixes we have made to that recently.

    Changes since v1.29
    • Fixed a bug where splines were being deleted if the 'Add' option was used when Loading a spl file.
    • MegaScatter made fully Unity 2017 compatible.
    • Updated MegaUtils.cs so if MegaScatter and MegaFiers used together there wont be missing methods.
    • Added option to the texture scatter layers to use the alpha channel in the mask texture to control scatter density.
    • Changes made for the latest Unity 5.6 obsolete methods for the final release of Unity 5.6
    • Fixed a problem with the Position handles when editing splines.
    • Splines now default to Free Handle mode for editing.
    • MegaScatter is fully 5.6 compatible.
    • Added new improved spline smoothing, you can now choose between old and new smoothing modes in the Shape Inspector. New method will produce a perfectly smooth spline through all the control points.
    • Added option to auto smooth the spline when you drag a knot, this will recalc the knot control points if you have changed any.
    • Rewritten the spline editing bit, making it easier to select and move spline knots and handles.
    • Move gizmos are now only shown for the currently selected knot.
    • To edit a spline knot you just need to click the green sphere for the point you want to edit, that will then select that point.
    • Option to freeze y movement when editing spline points, useful if using the free move handle type.
    • No need to click and drag mid point gizmos to add a new point you can now just click the circle to add a new knot.
    • Move handles now point along the spline.
    • Added extra circle gizmo at end of open spline for easier creation of splines by easily allowing addition of knot on the end.
    • Add Undo system for spline editing, you can now undo any changes made to a splines knots by clicking the Undo Edit Spline button.
    • Added option to set the max Undos that can be stored.
    • Fixed bug that caused splines to get corrupted if you tried to use the Spline animation builder on a spline with an imported animation.
    • Added the missing SetHandles method to the MegaShapes API.
    • Fixed error when target platform is Windows App.
    • MegaScatter now fully Unity 5.5 compatible.
     
    Last edited: Aug 8, 2017
  14. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Another quick update, we have improved the Spline Undo feature to undo all the changes you could make to a spline instead of just the moving of knots, so adding or deleting knots, flattening, reversing, open or closing the spline etc.

    Changes in v 1.37
    • The Undo for MegaShapes now recognizes adding and deleting of knots as well other the other options that change the spline such as Autocurve, scale etc.
     
    Last edited: Oct 29, 2017
  15. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    We have submitted an update for MegaScatter to the Asset Store this fixes an issue in Unity 2017.2 where you could not move the spline knots or handles. We have also made MegaScatter fully compatible with Unity 2017.2 and Unity 2017.3.

    Changes in v1.38
    • Fixed an issue in Unity 2017.2 that stopped the spline knots from being moved.
    • MegaScatter made fully Unity 2017.2 compatible.
    • MegaScatter made fully Unity 2017.3 compatible.
     
  16. NotQuiteSmith

    NotQuiteSmith

    Joined:
    Oct 27, 2013
    Posts:
    92
    Hi,
    I have levels where I'd like to scatter gatherable game objects in various spline regions i.e. the amount/type of object and location is decided at runtime and the player will run around grabbing the objects! Does MegaScatter support this? Not sure if it's an "environment only" kind of tool.

    Thanks!
     
  17. NotQuiteSmith

    NotQuiteSmith

    Joined:
    Oct 27, 2013
    Posts:
    92
    Decided to go ahead and buy this anyway, for "environment only" use (I have a scatter script I can use for gatherables anyway).

    Could anyone confirm if MegaScatter will produce consistent results when used in a multiplayer networked game. i.e. if the random seed is set the same on all machines, will all scattered objects appear in the same place for all players?

    Thanks.
     
  18. ecfelts

    ecfelts

    Joined:
    Aug 7, 2017
    Posts:
    11
    Hello,

    I have a question that may be kind of basic, because I cannot find any info on it so I am assuming that anyone who might need to know already knows what to look for...

    How do you set up MegaScatter to operate during runtime rather than prebuilding all of your scatter objects and attaching them to the terrain in some way?

    I see posts where people are talking about doing it, but nothing about how to set it up. I figure that I am just looking in the wrong places.

    Any help? I would really appreciate anything anyone might be able to let me know about this.