Search Unity

Particle Playground

Discussion in 'Assets and Asset Store' started by save, Dec 4, 2013.

  1. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    481
    Have other users found this dependable?

    I can't file a bug because it's not consistent but I'm finding in both the editor and my builds I'd say about a 1/15 of the time particles fail to play. I have some projectiles that have trails and looping effects are enabled with a simple SetActive on the PP effect gameobject and yet nothing displays. If this is the editor and I pause and go click on the object this seems to goose PP and suddenly the FX kicks on so I can't tell what state anything is in. I do not have visibility pausing on.

    I've never seen this problem with any non PP particles.

    I have to admit this is really vague and hard to track down especially as its within a huge project but I can't seem to find a good place to start diagnosing the problem. My best guess is maybe connected to when PP creates Unity particle system effects? Is there any way to get it to minimize the time it modifies those systems? Does it ever destroy them and can that be prevented?
     
    Last edited: May 31, 2016
  2. ludos

    ludos

    Joined:
    Nov 14, 2011
    Posts:
    53
    i'm trying to modify the constant force in a particle system by a script, however i cannot find a example nor a hint where to look. could you point me where i can find informations to do that? thanks
     
  3. eroberer

    eroberer

    Joined:
    Nov 18, 2013
    Posts:
    8
    QUESTION: What is the best way to create a sin wave swirl, or sin-wave-like vortex line of particles between two transforms? That is, I'd really like the particles to swirl at a constant distance from some straight line, and propagate along it. In truth, I would like to have BOTH a "single" particle propagation like the heart monitor bezier curve example, and a continuous line of particles (i.e. the option to toggle this behavior).

    I see bezier curves, but it doesn't appear there is anything built in that will magically scale or add transforms for the node lists so the sin wave has a consistent amplitude. I also see forces and vortexes. Also, I see forces and manipulators (I believe), but I think I'd have to cleverly add manipulators at a consistent distance.

    I think I could accomplish this with something like the "Relation Position Transform", as seen in the "Transform Splines with Spline Targets" example scene.

    I feel like this has probably been answered a dozen times, and I'll come back and delete this post or edit it when I figure it out, but I wanted to ask really quickly unless there is no answer.
     
  4. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    222
    Quick question: is there something like a trial version of PP?
    Since the price for an seemingly unsupported asset is bit high to buy without having tested the asset beforehand.
     
  5. cjosewski

    cjosewski

    Joined:
    Mar 10, 2016
    Posts:
    1
    Has there been any traction on fixing Start Delay? We are in the middle of production and are in dire need of this working.
     
  6. Partiest-Cat

    Partiest-Cat

    Joined:
    Jan 16, 2014
    Posts:
    7
    Running into an issue with spawning multiple instances of the same emitter on the same frame, and I'm not sure how to solve it.. Hoping someone here can help me out!

    I've built a prefab that contains a handful of small emitters for a death effect when destroying some eggs. If the player destroys multiple eggs at the same time (IE more than one dies on the same frame), the particle calculations of all spawned emitters are identical.



    Is there a way to re-calculate particle velocities, speeds, scales, etc. on a per-object basis? A checkbox I'm missing in the settings, maybe? :p I'm hopeful it's just an oversight on my end.
     
  7. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey all! My humble apologies to all unanswered questions in this thread lately. There's been far too much the last couple of months which has put most support on hold, not great and it feels terrible to leave anyone in limbo.

    Playground is still under development and an update is being worked on. There's a bunch of small fixes and additions going into this update along with some major performance improvements.

    Indeed it's difficult to say exactly what could be going on. Can this occur to all your particle systems or a specific one? Try disabling the multithreaded startup on your particle systems that acts this way (Advanced > Misc > Multithreaded Startup). If that doesn't help it would be great if you'd like to have a chat over support@polyfied.com where we could dig deeper into what could be the cause.

    To change the constant force you can do this:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class ChangeConstantForce : MonoBehaviour {
    6.  
    7.     public PlaygroundParticlesC particles;
    8.     public Vector3 gravity;
    9.    
    10.     void Update () {
    11.         particles.gravity = gravity;
    12.     }
    13. }
    14.  
    This is being addressed for the upcoming update. I'll send you a PM with a version you could try.

    Like the art you've got going on!
    When you instantiate the particle systems you can use the prefab as a reference (instead of the particle system in the scene), that should give you a new random every time. Otherwise you can try this:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class RefreshRandom : MonoBehaviour {
    6.  
    7.     private PlaygroundParticlesC _particles;
    8.  
    9.     void OnEnable ()
    10.     {
    11.         if (_particles == null)
    12.             _particles = GetComponent<PlaygroundParticlesC>();
    13.         _particles.RefreshSystemRandom();
    14.     }
    15. }
    16.  
     
    zyzyx likes this.
  8. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Random post about particles following splines

    There's a recurring question regarding how to make particles follow splines in a more controlled manner. Using Manipulators can feel very clunky and requires a lot of fine-tuning, overall it's hard to make it look right as the features aren't fully there (yet). Another approach which is more customisable is controlling the particle flow through script. That way you can add in any features you find necessary, for example position scattering over the spline.

    Example:


    Script:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4. using PlaygroundSplines;
    5.  
    6. public class TargetSplineWithScattering : MonoBehaviour {
    7.  
    8.     public PlaygroundParticlesC particles;
    9.     public PlaygroundSpline spline;
    10.  
    11.     [Range(0.01f, 10f)]
    12.     public float emitTime = .1f;
    13.     public Color32 color = Color.white;
    14.     public bool applyPositionScatter = true;
    15.     public MINMAXVECTOR3METHOD positionScatterMethod;
    16.     public Vector3 positionScatterMin = new Vector3(0,-1);
    17.     public Vector3 positionScatterMax = new Vector3(0,1);
    18.     public bool applyScatterLifetimeMultiplier = true;
    19.     public AnimationCurve positionScatterLifetimeMultiplier = new AnimationCurve(new Keyframe[]{new Keyframe(0,1f), new Keyframe(1f,1f)});
    20.  
    21.     private float _emitTimer;
    22.     private Vector3[] _scatterPosition;
    23.  
    24.     void Awake ()
    25.     {
    26.         particles.scriptedEmissionIndex = 0;
    27.         particles.gravity = Vector3.zero;
    28.         particles.applyInitialVelocity = false;
    29.  
    30.         // Generate scatter for the available particles
    31.         GenerateScatter();
    32.     }
    33.  
    34.     void Update ()
    35.     {
    36.         // Ensure particle system is ready before we use it
    37.         if (!particles.IsReady())
    38.             return;
    39.  
    40.         // Emit
    41.         _emitTimer += Time.deltaTime / emitTime;
    42.         if (_emitTimer >= 1f)
    43.         {
    44.             // Emit onto the initial position of the spline
    45.             Vector3 emitPos = spline.GetPoint(0);
    46.             particles.Emit (emitPos, Vector3.zero, color);
    47.             _emitTimer = 0;
    48.         }
    49.  
    50.         // Ensure correct length of scatter positions (upon changing particle count)
    51.         if (applyPositionScatter && particles.particleCount != _scatterPosition.Length)
    52.             GenerateScatter();
    53.  
    54.         // Position
    55.         for (int i = 0; i<particles.particleCount; i++)
    56.         {
    57.             // If Playground Cache is resized while in here we need to exit the loop
    58.             if (applyPositionScatter && particles.playgroundCache.simulate.Length != _scatterPosition.Length)
    59.                 break;
    60.  
    61.             // Check if the particle is simulating
    62.             if (particles.playgroundCache.simulate[i])
    63.             {
    64.                 // Normalize the time for the particle
    65.                 float t = Mathf.Min (particles.playgroundCache.life[i] / particles.lifetime, .99f);
    66.  
    67.                 // Create a position on the spline along with the generated scattering
    68.                 Vector3 pos = spline.GetPoint (t);
    69.                 if (applyPositionScatter)
    70.                 {
    71.                     pos += applyScatterLifetimeMultiplier? _scatterPosition[i] * positionScatterLifetimeMultiplier.Evaluate(t) : _scatterPosition[i];
    72.                 }
    73.  
    74.                 // Set the position of the particle
    75.                 particles.ParticlePosition(i, pos);
    76.             }
    77.         }
    78.     }
    79.  
    80.     void GenerateScatter ()
    81.     {
    82.         if (!applyPositionScatter)
    83.             return;
    84.  
    85.         _scatterPosition = new Vector3[particles.particleCount];
    86.         System.Random random = new System.Random();
    87.         for (int p = 0; p<_scatterPosition.Length; p++)
    88.         {
    89.             if (positionScatterMethod==MINMAXVECTOR3METHOD.Rectangular)
    90.                 _scatterPosition[p] = PlaygroundParticlesC.RandomRange(random, positionScatterMin, positionScatterMax);
    91.             else if (positionScatterMethod==MINMAXVECTOR3METHOD.RectangularLinear)
    92.                 _scatterPosition[p] = Vector3.Lerp (positionScatterMin, positionScatterMax, (p*1f)/(_scatterPosition.Length*1f));
    93.             else if (positionScatterMethod==MINMAXVECTOR3METHOD.Spherical)
    94.                 _scatterPosition[p] = PlaygroundParticlesC.RandomRangeSpherical(random, positionScatterMin.x, positionScatterMax.x);
    95.             else if (positionScatterMethod==MINMAXVECTOR3METHOD.SphericalLinear)
    96.                 _scatterPosition[p] = PlaygroundParticlesC.RandomRangeSpherical(random, positionScatterMin.x, positionScatterMax.x, (p*1f)/(_scatterPosition.Length*1f));
    97.         }
    98.     }
    99. }
    100.  
     
    Last edited: Jul 14, 2016
    jashan, hopeful and chiapet1021 like this.
  9. kumar123k

    kumar123k

    Joined:
    Jul 5, 2016
    Posts:
    25

    nice to hear you again on forums.
     
  10. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Thanks @kumar123k, getting everything back on track one step at a time. :)
     
  11. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
  12. Partiest-Cat

    Partiest-Cat

    Joined:
    Jan 16, 2014
    Posts:
    7
    Thanks for the reply! I've tried the script you provided and that didn't seem to do anything. For better context, we're pooling these objects on scene load all at the same time (which is why I presume the random is identical for the entire set). Does OnEnable not run every time the object is set to active?
     
  13. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Ok thanks then I see what's going on.
    OnEnable will run but the random distribution happens when constructing the caches and upon each separate particle birth the next cycle.
    I'll get back to you over PM as soon as I have the chance with a framework update so you can handle that a bit more flexible. There are some updates to handle all randoms better in the next version.
     
  14. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    This is finally a thing (for the soon to come update)


    The seed will determine if a particle system behaves in the same manor as another. It will make it easier to for example distribute scattering in the exact same way for separate systems or make sure two particle systems doesn't have the same velocity patterns.

    That certain obvious things isn't implemented yet is a bit scary to me even...
     
    hopeful likes this.
  15. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Random post about spiral effects

    From time to time I get the question how to create more controllable spiral (or visual spring) effects. Every time that happens I see the unforgettable, and quite unforgiving good old Quake Railgun in front of me. It's actually really straight forward if you're comfortable with using the scripting part of Playground. To make it as easy as possible you can create a start- and end point from two Transforms, then generate a spiral in between using sinus and cosinus while rotating that generated offset according to the direction in between the two points. Another thing which could come in handy is determining the radius over time from point A to B by an Animation Curve. The rest of the settings is up to your particle system, where the Lifetime Sorting, particle sizes over lifetime and colour settings can create quite unique behaviours while playing out the effect together.

    Example:


    Script:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. [ExecuteInEditMode()]
    6. public class ParticleSpiralBetweenTwoPoints : MonoBehaviour {
    7.  
    8.     public PlaygroundParticlesC particles;
    9.     public Transform start;
    10.     public Transform end;
    11.     [Range(1, 100)]
    12.     public int swirlIterations = 10;
    13.     public float radius = 1f;
    14.     public AnimationCurve radiusTimeScale = new AnimationCurve(new Keyframe[]{new Keyframe(0,1f), new Keyframe(1f,1f)});
    15.     public Color32 color = Color.white;
    16.  
    17.     private Vector3[] _spiralInterpolations;
    18.     private Vector3 _startPos;
    19.     private Vector3 _endPos;
    20.     private Vector3 _lookDirection;
    21.     private float _r;
    22.     private int _i;
    23.  
    24.     void Start ()
    25.     {
    26.         particles.source = SOURCEC.Script;
    27.         particles.onlySourcePositioning = true;
    28.         GenerateSpiralInterpolations();
    29.     }
    30.  
    31.     void Update ()
    32.     {
    33.         if (!particles.IsReady() || particles.particleCount < 2)
    34.             return;
    35.  
    36.         // Generate new interpolation positions if needed
    37.         if (_spiralInterpolations.Length != particles.particleCount ||
    38.             _startPos != start.position ||
    39.             _endPos != end.position ||
    40.             _i != swirlIterations ||
    41.             !Mathf.Approximately(_r, radius))
    42.             GenerateSpiralInterpolations();
    43.  
    44.         for (int i = 0; i<particles.particleCount; i++)
    45.         {
    46.             // If particles cache is resized in the middle of execution we need to exit the loop
    47.             if (_spiralInterpolations.Length != particles.playgroundCache.simulate.Length)
    48.                 break;
    49.  
    50.             // Emit or position particles to the calculated spiral position
    51.             if (!particles.playgroundCache.simulate[i])
    52.                 particles.Emit (_spiralInterpolations[i]);
    53.             else
    54.                 particles.ParticlePosition(i, _spiralInterpolations[i]);
    55.         }
    56.     }
    57.  
    58.     void GenerateSpiralInterpolations ()
    59.     {
    60.         _startPos = start.position;
    61.         _endPos = end.position;
    62.         _lookDirection = (_endPos - _startPos).normalized;
    63.         _r = radius;
    64.         _i = swirlIterations;
    65.         _spiralInterpolations = new Vector3[particles.particleCount];
    66.         float totalDistance = Vector3.Distance (_startPos, _endPos);
    67.         float pi = Mathf.PI;
    68.  
    69.         for (int i = 0; i<_spiralInterpolations.Length; i++)
    70.         {
    71.             // Create the 'flat' (non-rotated) spiral position, the distance to the end point will determine the z depth
    72.             float t = (i*1f) / particles.particleCount;
    73.             float radiusT = radiusTimeScale.Evaluate(t);
    74.             Vector3 spiralPosFlat = new Vector3(_r * radiusT * Mathf.Sin (_i * t * pi * 2), _r * radiusT * Mathf.Cos (_i * t * pi * 2), t*totalDistance);
    75.  
    76.             // Rotate the spiral position as an offset and take the start position offset into account
    77.             Vector3 finalSpiralPos = _startPos + (Quaternion.LookRotation(_lookDirection) * spiralPosFlat);
    78.  
    79.             // Cache the summary (for performance in the Update loop)
    80.             _spiralInterpolations[i] = finalSpiralPos;
    81.         }
    82.     }
    83. }
    84.  
    (not sure if this can be of any inspiration to your recent question @eroberer)
     
    Last edited: Jul 20, 2016
    ZJP likes this.
  16. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    @Partiest-Cat: It seems you haven't enabled private messaging. If you send a hello to support@polyfied.com I can help you out with the random starting points for the particle systems.
     
  17. s_guy

    s_guy

    Joined:
    Feb 27, 2013
    Posts:
    102
    I understand that the singleton pattern needs to be enforced for the Playground Manager, but what is the best practice for using Particle Playground 3 with additive scene loads?

    If I keep the first Playground Manager around when the next scene is loaded, would the newly loaded particle systems be expected to work properly with the previously existing PM?

    Thanks!

    EDIT: They do appear to work properly with this solution, but I was wondering if there might be some gotchas since I'm kind of pulling the rug out from under the PM.

    EDIT2: Digging in a little deeper, everything seems to be happy with this approach. Just be mindful that the first Playground Manager to run OnEnable will be the one enforcing the singleton.
     
    Last edited: Aug 2, 2016
  18. ChosenWell

    ChosenWell

    Joined:
    Mar 8, 2015
    Posts:
    23
    Top of logo example cut off in version 3

    When using the logo example the texture is cut off on the top. This is the same for the any texture put in place (even the one in the package).
    Currently building with Unity 5.4.0f3.

    If anyone knows of a way to change this behavior please let me know.
     
  19. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Indeed that's the approach, first one should catch them all in a standard setup. However let me know if you experience any odd behaviours.
     
  20. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    I think we might have solved this over a support errand but for anyone else experiencing this:
    Go to Source > State and unfold the state's settings. There you can press a button called 'Set Particle Count'. The issue is that there's not enough particles to match the amount of pixels in the texture, as the cached particle array is linearly matched to the texture's colour array (read from bottom left) you'll have missing birth positions at the top when particle count is less than pixels.

    As a disclaimer: Keep in mind to try having as few pixels as possible in a State texture as each particle generated will have a performance cost. The visual effect of disintegration, build-up or any other image effect can many times be faked with less particles than pixels or better off solved through shaders.
     
  21. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    By accident when trying out new features I realised we can make some procedural nature things without any further scripting going on. Upcoming version will have a bit more advanced Events as well.



    Will include some nature themed presets to have fun with.
     
    Malveka, red2blue, Bhanshee00 and 2 others like this.
  22. Situacao

    Situacao

    Joined:
    Dec 4, 2013
    Posts:
    21
    Hey guys!

    I'm having some problems here regarding particle rotation, specifically when I want that said particle system to render as a mesh. My problems arise because I want full control over the rotation of the particles over the three axis, and, under the Rotation panel, I can only rotate particles around one axis. Furthermore, the particles will have no initial or lifetime velocity.

    Is there any way I can do this? For a reference, I wanted to achieve a speed ghosting effect, like seen here but using a 3D object. Since my gameObject can be rotated anywhere, I wanted my particles (the "duplicates" of the original GameObject) to copy its rotation on birth.

    I would greatly appreciate your help here. Thanks in advance!
     
  23. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    201
    I'm very keen to see a speed improvement for this too, using trails sparingly kills performance for me right now. Tried cutting down to the bare minimum of trails (like 12 particles with trails) and even that is expensive with a high distance between each point.
     
  24. Situacao

    Situacao

    Joined:
    Dec 4, 2013
    Posts:
    21
    Adding to my last question, how do you assign a Source Transform at runtime? From what I've seen, it should be as simple as adding an item to the PlaygroundParticlesC.sourceTransforms list, but I can't seem to convert a Unity transform to a PlaygroundTransformC.

    Thanks again in advance!
     
  25. gevarre

    gevarre

    Joined:
    Jan 19, 2009
    Posts:
    132
    Animating Scale of Entire Particle System?

    Hi, I'm trying to create an effect that's basically a "warp in" for a space ship. Your Abstract - Hypnosis system is a great place to start, but I need the whole thing to get smaller over time and I can't figure out a way to animate that other than some messy scripting of the Source Scatter Scale properties. Any thoughts on a better solution?
     
  26. gfunk

    gfunk

    Joined:
    Mar 17, 2015
    Posts:
    23
    Hi! Is there a way to randomly rotate emitted particles - like rotation over lifetime in Shuriken? Thank you, any input on this is much appreciated!
     
  27. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi! 3d rotations are coming very soon. Sorry about the wait!

    This is being worked on for the upcoming update, there are some significant performance improvements that is being made overall to Playground while trails are being revised to batch and reuse allocated memory.
    They will still be running on the CPU which is a bottleneck in itself in comparison to compute shaders on the GPU.
    I'm experimenting with making a separate scalable thread aggregator along with the particle system thread aggregation for more flexible scenarios of trails, as each system emitting trails currently require an allocated thread each. This is far from ideal as it seems to be more likely to have several systems emitting trails at the same time, where the particle systems alone can require all available CPUs.
    The most likely bottleneck is although constructing all the separate meshes, where batching will really help bringing the CPU time down. So to summarise they don't work well in particle system quantity nor trail quantity, where the allocated memory for each reuse of a thread piles up quickly to call garbage collection far too often.

    Just to give some background why they suck, and how they are being improved. :)

    The fastest way is to use:
    Code (CSharp):
    1. PlaygroundC.CreatePlaygroundTransform (yourParticleSystem);
    This will automatically wrap the transform into a PlaygroundTransformC, add it to the sourceTransforms and also return the transform created.
    Here's an example:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. using ParticlePlayground;
    4.  
    5. public class CreateNewSourceTransform : MonoBehaviour {
    6.  
    7.     public PlaygroundParticlesC particles;
    8.     private List<Transform> _transforms = new List<Transform>();
    9.    
    10.     void Update ()
    11.     {
    12.         if (Input.GetKeyDown (KeyCode.Space))
    13.             _transforms.Add (PlaygroundC.CreatePlaygroundTransform (particles));
    14.  
    15.         for (int i = 0; i<_transforms.Count; i++)
    16.             _transforms[i].position = new Vector3(i, Mathf.Sin (Time.time + (i*.1f)));
    17.     }
    18. }
    19.  
     
    Situacao and Exbleative like this.
  28. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi! Here's an example to how you could approach it extending on the existing particle system scaler. It doesn't solve origin offsetting so in this case you would need to simulate the particle system at world space zero to scale from the effect's centre as all trails have their origin at zero world space. If not else it's hopefully a start!

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class ParticleSystemScalerWithTrails : ParticleSystemScaler {
    6.    
    7.     public bool scaleTrails = true;
    8.     public Vector3 trailScalePosition;
    9.     private PlaygroundTrails _trails;
    10.     private Vector3 _origTrailScale = Vector3.one;
    11.     private float _prevScale;
    12.  
    13.     void OnEnable ()
    14.     {
    15.         if (_trails == null)
    16.             _trails = GetComponent<PlaygroundTrails>();
    17.         _prevScale = scale;
    18.     }
    19.  
    20.     void OnDisable ()
    21.     {
    22.         if (_trails.GetParentTransform() != null)
    23.             _trails.GetParentTransform().localScale = _origTrailScale;
    24.     }
    25.    
    26.     void Update ()
    27.     {
    28.         if (_trails.GetParentTransform() != null)
    29.         {
    30.             if (scaleTrails && !Mathf.Approximately(scale, _prevScale))
    31.             {
    32.                 _trails.GetParentTransform().localScale = _origTrailScale*scale;
    33.                 _prevScale = scale;
    34.             }
    35.             _trails.GetParentTransform().position = trailScalePosition;
    36.         }
    37.     }
    38. }
    39.  
     
  29. Wuzseen

    Wuzseen

    Joined:
    Apr 19, 2011
    Posts:
    20
    I'm having difficulty understanding how I can set up Playground systems in different scenes. I have a couple of effects that are present in every scene that I access from the playground manager. Yet some scenes need effects unique only to that scene. As I can't have multiple playground managers at the same time, I'm not sure what to do. I can make prefabs and spawn them at runtime for each level, but then that makes it more difficult to edit the systems efficiently. Is there a best practice here?

    To clarify:
    • Playground manager is set to not destroy on load
    • Manager has a couple basic effects every scene uses
    • Unique scenes have unique effects, but I can only have 1 playground manager. This conflicts with the previous two points.
    Basically, I'd like to sort of be able to "merge" playground managers.
     
  30. s_guy

    s_guy

    Joined:
    Feb 27, 2013
    Posts:
    102
    Can anyone share some tips on making a seamless loop with the Playground Recorder? I'd like to optimize some effects that can just run the same way every time by using a looping recorded playback, but I'm having problems getting continuity from the last frame to the first frame.

    http://polyfied.com/products/particle-playground/playground-recorder/
     
  31. s_guy

    s_guy

    Joined:
    Feb 27, 2013
    Posts:
    102
    @Wuzseen

    You may already know this, but effects don't exist within the the playground manager; they're only referenced by it. Effects also typically don't need to be children of the PM, and probably shouldn't be for most non-trivial cases. I find it better to put them in the hierarchy just like how I organize other things.

    When you do a normal scene load, it will destroy the PM from the last scene and load any PM in the new scene. You could use a paradigm that reused the same PM from scene to scene. The main reason I can see that you might want to use DontDestroyOnLoad on the PM is if you wanted effect continuity across (additive async?) scene loads. Otherwise, it's probably not worth the trouble to just get the same kind of effect in another scene. That's what prefabs are for.

    Just put instances of an effect object prefab in each scene where you want it. Due to Unity's weird decision not to show a prefab's whole hierarchy in the project view, you'll often need to select an instance of that prefab in a scene (or put one there), edit it, then apply the changes to the prefab. (And then delete that instance in the scene if you don't need one there.) It's a bit of a pain, but still, you probably shouldn't use DontDestroyOnLoad if you only need an instance of something in the next scene.

    If you're sure you want to use DontDestroyOnLoad for the PM, the effects associated with that PM will be destroyed on a normal scene load unless they're children of the PM or the associated effect objects themselves use DontDestroyOnLoad. The PM for the new scene will destroy itself (and its children) when it sees the preexisting PM.

    You could also try to make sure scenes don't save with a PM, but this package is pretty aggressive about making sure there is a PM in every scene. So you might just roll with it. It's also nice to be able to run any scene directly from the editor and having a PM in every scene makes this convenient.

    There doesn't appear to be any existing formal way to merge PM lists or manually refresh a PM effect list, though this doesn't seem necessary. Any effects remaining in the new scene will be added to and managed by the previous scene's PM, if one was carried over. Old effects from the previous scene appear to get removed from the PM correctly too. Apparently this is also confirmed as an acceptable use from the author's comments on my earlier questions in this thread.

    To recap for your apparent use case:
    • Let there be one PM in each scene
    • Don't persist the PM or effects themself with DontDestroyOnLoad unless you actually need effect continuity across scenes. If you do, make sure effects aren't children of the scene PM or they'll get destroyed along with the PM when an existing PM comes in.
    • Use prefabs for instantiating the same effect around different scenes
    • You can leave unique effects without prefabs, but use prefabs as soon as you want two copies to rely on the same settings
     
  32. kdm3d

    kdm3d

    Joined:
    Jul 20, 2012
    Posts:
    15
    I have around 15 manipulators (combined with gravity and color) on a single particle system with 1500 particles. it runs great for a while, but when changing the position of the manipulators a couple of times (at runtime via script), the particle system freezes. The app is still running (unity and/or the build still functions normally). Is there a calculation limit I'm not aware of? or a safeguard for game crashes?
     
  33. s_guy

    s_guy

    Joined:
    Feb 27, 2013
    Posts:
    102
    ZJP likes this.
  34. julienrobert

    julienrobert

    Joined:
    Sep 15, 2014
    Posts:
    45
    Hi
    I did a scene based on the logo demo. (using particle playground 2.03) So, the source is an image logo feeding 80k particles. (see image attached)
    I'd like to add depth of field image effect to my camera but I'm not able to properly focus on the particles. The only way to get it in focus is to increase the focal size a lot, but it's not the goal of that effect to have everything in the scene in focus...
    Do you have an idea how to do this? Is there something I'm missing?
     

    Attached Files:

  35. AustellaDev

    AustellaDev

    Joined:
    Sep 22, 2016
    Posts:
    1
    Does anyone have any examples of particles forming a mesh? I know there is the robot kyle example but i'm looking more for the particles to fall from the sky and form the mesh. Apologies if this has been posted before, anyway i'm going to play around with PP now and see if I can create something in the mean time.

    EDIT: Another quick question, is it possible to set the lifetime to longer than 100 seconds? Is it possible in code to extend this to something around 300?
     
    Last edited: Sep 22, 2016
  36. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,105
    The posting about making particles follow a spline was very helpful, thank you!

    Do you have an ETA? I'll be implementing lots of "spline-stuff" with particles involved and I had run through a few approaches already (I currently have a working implementation with "Magical Box" splines but it's quite cumbersome to use and doesn't look too great). If you already have something to test, I'd be quite happy to do that and give feedback as I'll be using particles following spline paths very heavily.

    But at the same time you also lose a lot of what particle playground offers, don't you? I haven't gotten into scripting particle playground, yet, but from the example it seems like you can't edit this (and see how your changes effect the visuals) when not playing, and when playing, there's the issue of playmode changes not being persistent. Also, anything that's related to moving particles (from Particle Playground) seems to be overwritten that way, as well as anything related to emission.

    But it seems it's still the best we currently have for what I need ...
     
  37. Real20Games

    Real20Games

    Joined:
    Jun 2, 2016
    Posts:
    3
    Hey! Great Asset! I have a question. How can you do a shotgun-like effect?
     
  38. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey, before I answer any of the questions I'd like to share where Particle Playground is in development and give some background to why occasionally there's this radio silence. Hopefully this can give some answers to any of you who wonders what is going on and why it might take so long in replying back.

    I joined another company back in 2015 as a programmer, mainly because I wanted to give the family better stability and I felt the need to progress my knowledge. Depending on where we are in the project cycles it can require a lot of extra attention which puts support on hold during these periods. With a newcomer to the family earlier this year it got even more difficult to keep up with everything, where stress has been a recurring factor to dampen reasonable production paste and me showing up here to answer any questions. I still feel terrible for any customers that really need help in their production and there's no answers for a long while, I'm trying to get better at doing more regular checkins up ahead.


    So Playground then, you might wonder what type of shape the project is in. It's actually in a somewhat good state despite the huge delays coming into a beta phase. Here's some of the features and fixes done in the repo for version 3.1 at the moment:

    • 0 GC
      Improved use of multithreading and calculation calls allows for 0 memory allocations. This is a huge improvement for mobile resulting in faster calculation cycles and far less occasional stuttering.

    • 3d rotations for particles
      Keeping up with what Shuriken can do, having X, Y and Z rotations of particles.

    • Random seed
      Random seed for an entire particle system and all its random features. This able particle systems to behave similar to one another, where random starting positions and velocities will be the very same when using the same seed.

    • Emit quantity for Events
      Emit x number of particles upon an event call, random velocity ranges available.

    • Preset and Category Manager
      A manager found in the Particle Playground window through the "Manage Presets" button. The manager lets you create, rename or remove preset categories. You can also select multiple presets to move, remove or publish them from here.

    • Set layer of Playground Trails
      Use an enum dropdown to set which layer the particle trails should be in.

    • Delayed emission fix
      Fix for particle systems starting to emit a couple of frames late upon enabling emission.

    • Export preset fixes
      Selection of presets was not accurate at all times. Playground Spline and Trail components not forced to be included when exporting.

    • Windows 10 Universal IL2CPP fix
      Platform dependant compilation not set correctly caused division by zero exception in IL2CPP.

    • Additional examples (simple scripts)
      - How to make a spline target with scattering.
      - Particle teleporter.
      - Nested particle system sequence.
      - Particle spiral between two points.


    What has been holding the release back is that I've been working on and off with an overhaul for the trail component, as the released approach just isn't up to par in terms of performance (of what it could be). Some time has been put into R&D for making a separate particle renderer custom made for Playground, which has been successful but the idea becomes more and more obsolete the more Unity upgrades Shuriken.

    To get 3.1 into beta I'll put the trail update on hold till the release after, so we can have nice things soon.

    Up ahead is mainly continuing adding in features to not fall behind from Shuriken in important features and finally giving vector fields a good go. Project is still alive, but has been running on fumes the last months.

    I'm sorry for the wait, thanks for all your patience!
     
    red2blue, chelnok, hopeful and 2 others like this.
  39. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi,
    There's no limits, a guess is that there could be an issue with some manipulator and its execution order if it's passing over frames due to calculation times. The next version will catch exceptions without having the need to put all calculations to the main-thread, which will let us detect issues like this and fix them right away. Hang in there, would you like to join in on the beta to test this early? Just send me a pm with your email and I'll add you.
     
  40. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    It will be compatible, there's some small tweaks being added to make it compile and function correctly. In terms of the new additions Playground won't have them at launch but some is possible to inherit and introduce in smaller updates. The idea is to keep Playground on its own track though to remain a separate workflow. Unity has chosen to natively implement some of Playground's already available features, which is a great addition to Shuriken. :)
     
    s_guy likes this.
  41. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey,
    For what it's worth this late of an answer, you can use a target manipulator to target vertices in skinned or regular meshes, there's also splines and transforms which can be targeted. I'm not sure if that helps in forming the object the way you need it.

    The Inspector limits can be set in Window > Particle Playground > Settings > Editor Limits. There you'll find Particle Lifetime which you can set to a higher number. You can also set a PlaygroundParticlesC component's lifetime variable through script.
     
  42. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    There's no new additions being made this update cycle to the splines and their functionality. There are some things in the backlog such as position scattering for splines but they haven't made it to daylight due to other more requested features. I'd love to have you onboard testing either way of course!

    It's true, once you script their position constantly over frames then any positioning features gets overridden. Some things I do as a proof of concept through script first to ensure that it's a viable solution, the spline scattering is a good example of something that would really work well in the native calculation cycle. Some things are although a bit too narrow for general use, such as the spiral effect. But perhaps that could have a small place in the Force Annihilation tab if the feature was improved with a bending curve etc.

    If you have any ideas how you'd like to improve the use of splines then I'm eager to hear them, as soon as things clears up more features will be added.
     
  43. iileychen

    iileychen

    Joined:
    Oct 13, 2015
    Posts:
    69
    How can i Pause&Play the particles? I have searched the source code of ParticlePlayground.cs, can not find any similar method for that.
    And i tried call ParticlePlayground.shurikenParticleSystem.Pause(); but it does not works.
     
  44. iileychen

    iileychen

    Joined:
    Oct 13, 2015
    Posts:
    69
    Finally i implemented with modify emissionRate property from 0 ~ 1 to simulate Pause/Resume, is there other way?
     
  45. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi! The best way is to set:
    Code (CSharp):
    1. particles.particleTimescale = 0;
    The Shuriken component will be completely controlled by Playground, that is why the attempted Pause() call won't have any effect.
     
  46. iileychen

    iileychen

    Joined:
    Oct 13, 2015
    Posts:
    69
    Thank you, particleTimescale works, and it pause all the emitted particles.
    emissionRate is better for me with this case, since i need the already emitted particles goes on - while new emission will stop, so the emissionRate better.

    But there's a sequence issue sometimes, which looks like : no particles emitted, and then a bunch of particles suddenly come out. Seems like non-continuously emission, it casually occur after i modified emissionRate from 0 to 1.
     
  47. Dubz

    Dubz

    Joined:
    Feb 20, 2012
    Posts:
    18
    Hey i'm having a simple problem.

    The particle playground assets can't be found and i need to edit the paths to match the current project.

    Trouble is i've no idea what those paths are supposed to look like.

    In a fresh import of the package the path is just - Particle Playground/
    This doesn't work when i try doing this to my current project.

    I've also tried - D:\Artwork\01_Freelance\!_Jixal_Boxx\ParticleProject\Assets\Particle Playground which seems like the correct path?

    Some clarification would be great.

    Currently my paths look like data, maybe they are corrupted somehow? Picture attached.
     
    Last edited: Oct 27, 2016
  48. DragonSix

    DragonSix

    Joined:
    Jul 2, 2013
    Posts:
    31
    I have the exact same problem, I don't know what the plugin expects me to put in these fields.

    I tried deleting the particle playground folder and reinstalling, but the fields are still random numbers.


    Edit: oh, alright I found the culprit: "Particle Playground/Playground Assets/Settings/Playground Settings.asset", I had to reset this scriptable object for the plugin to work again.
     
    Last edited: Nov 12, 2016
    hopeful likes this.
  49. Lszt

    Lszt

    Joined:
    Sep 28, 2015
    Posts:
    38
    Any news on a possible update ? :) We are waiting so hard the 0 GC alloc :3
     
  50. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744

    Yes! Sorry for the late response regarding this, hopefully you got it up and running. Resetting the Playground Settings asset is one way to go about it. This is unfortunately happening when you import the package into a project which forces text as asset serialization (set in Edit > Project Settings > Editor). Why this is happening is still unclear but there are a couple of straight forward options.

    To answer your question, these are the default values:

    Playground Path: Particle Playground/
    Languages Path: Playground Assets/Settings/Languages/
    Resources Preset Path: Resources/Presets/
    Assets Preset Path: Playground Assets/Presets/
    Preset Icon Path: Graphics/Editor/Icons/
    Brush Path: Playground Assets/Brushes/
    Script Path: Scripts/
    Update URL: http://www.polyfied.com/products/playgroundversion.php
    Extensions URL: http://www.polyfied.com/products/playground/extensions/extensions.xml

    Fix option 1:
    Resetting the Playground Settings asset will have Unity set the default values. Keep in mind any other settings will be set to default as well.
    1) Select Particle Playground/Playground Assets/Settings/Playground Settings.
    2) In Inspector press the small cogwheel (top right) and choose Reset.

    Fix option 2:
    If option #1 didn't reset the paths to readable text you can try removing the settings file and let Playground recreate it.
    1) Remove the asset Particle Playground/Playground Assets/Settings/Playground Settings.
    2) In Window > Particle Playground > Settings, press Create to generate a new Playground Settings file.
    3) Select the Playground Settings in Project View (found at the same location as in step 1) and set Languages array (found at the very bottom) to 1 and assign English at Element 0.

    Fix option 3:
    If this is a recurring issue due to several users in a version control system you could force the settings through script. Add this into a C# script placed inside an Editor folder:
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3.  
    4. public class SetPlaygroundPaths : Editor {
    5.     [MenuItem ("Window/Particle Playground - Set Paths")]
    6.     public static void SetPaths ()
    7.     {
    8.         PlaygroundSettingsC r = PlaygroundSettingsC.GetReference();
    9.         if (r != null && !r.IsInstance())
    10.         {
    11.             r.playgroundPath = "Particle Playground/";
    12.             r.examplePresetPath = "Playground Assets/Presets/";
    13.             r.presetPath = "Resources/Presets/";
    14.             r.iconPath = "Graphics/Editor/Icons/";
    15.             r.brushPath = "Playground Assets/Brushes/";
    16.             r.languagePath = "Playground Assets/Settings/Languages/";
    17.             r.scriptPath = "Scripts/";
    18.             r.versionUrl = "http://www.polyfied.com/products/playgroundversion.php";
    19.             r.extensionsUrl = "http://www.polyfied.com/products/playground/extensions/extensions.xml";
    20.  
    21.             EditorUtility.SetDirty(r);
    22.         }
    23.         else Debug.Log("Reference to Playground Settings is not set, try opening Window/Particle Playground first.");
    24.     }
    25. }
    You can then go to the Window menu and choose Particle Playground - Set Paths. Make sure you have opened Window > Particle Playground so it has set the object reference to the Playground Settings.asset so it can store the values back (otherwise the changes will only occur in memory during the Editor session).