Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Particle Playground

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

  1. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    There's no such thing out of the box, but very quick to set up:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class EmitAllChildren : MonoBehaviour {
    6.  
    7.     public Transform parentTransform;
    8.  
    9.     PlaygroundParticlesC[] particleSystems;
    10.  
    11.     void Start () {
    12.         particleSystems = parentTransform.GetComponentsInChildren<PlaygroundParticlesC>();
    13.     }
    14.    
    15.     void Emit (Vector3 position, Vector3 velocity, Color color) {
    16.         foreach (PlaygroundParticlesC particles in particleSystems)
    17.             particles.Emit (position, velocity, color);
    18.     }
    19. }
    20.  
     
    flexum and I_Dont_Know like this.
  2. victor874

    victor874

    Joined:
    Jan 20, 2015
    Posts:
    4
    Loving this particle system, im new to it all but having a ton of fun learning. I was wondering if there is a way to make a trail follow a particle. Im trying to make some streak across the screen but cant seem to figure out a way to create a trail.
     
  3. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Hi.
    How to 1 particle hit the ground, spawn many particle?
    Now I use collision event, but 1 particle collide the ground, spawn 1 particle...
     
    Exeneva likes this.
  4. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    321
    frontakk, is Particle Playground the source of all your wonderful particle packs in the asset store? If so, I may be interested in hiring you for a custom commission :)
     
    OnePxl likes this.
  5. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Hi.
    My released asset is made by shuriken particle system.
    But I may rebuild using particleplayground. :)
     
  6. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,646
    Very nice idea. :cool:
     
  7. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    That's great to hear! I noticed your question on Answers a couple of days ago. If anyone else wants to do this here's the temporary solution: http://answers.unity3d.com/question...ail-in-particle-playground.html#answer-884748 (updated with caching).
    The script can be used to make any type of object follow a particle system and will tag along the soon to come update with an example scene.

    Note that using trail renderers isn't optimized for mobile as every trail requires one draw call, I'm working on a promising system for that which will be implemented into Playground in the future (multithreaded, batched and some further options to trails overall).

    Hey!
    I'm a big fan of the illustrations. :) To emit several particles upon an event you must currently use an event listener. Such as:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. /// <summary>
    6. /// Emit several particles upon a particle event.
    7. /// </summary>
    8. public class MultiEmitOnEvent : MonoBehaviour {
    9.  
    10.     public PlaygroundParticlesC particlesEvent;                    // The event particle system
    11.     public PlaygroundParticlesC particlesEmit;                    // The emission particle system
    12.     public int emitCount = 8;                                    // The amount of particles
    13.     public Vector3 randomVelocityMin = new Vector3(-1f,0,-1f);    // The minimum random velocity
    14.     public Vector3 randomVelocityMax = new Vector3(1f,1f,1f);    // The maximum random velocity
    15.     public Color32 color = Color.white;                            // The color of particles
    16.  
    17.     void Start () {
    18.  
    19.         // Specify which event you would like to listen to
    20.         PlaygroundC.GetEvent (0, particlesEvent).particleEvent += EmitOnEvent;
    21.     }
    22.  
    23.     /// <summary>
    24.     /// Emits particles whenever the event is triggered. You could use more info from the passed in event particle if you'd like for more advanced emission behaviors.
    25.     /// Note that this will by default be called on a second thread.
    26.     /// </summary>
    27.     /// <param name="particle">Event Particle.</param>
    28.     void EmitOnEvent (PlaygroundEventParticle particle) {
    29.         particlesEmit.ThreadSafeEmit (emitCount, particle.collisionParticlePosition, randomVelocityMin, randomVelocityMax, color);
    30.     }
    31. }
    32.  

    Remember to set the event's Broadcast Type to EventListeners. You could use more info from the passed in event particle to create more interesting behaviors as well.
    I'll look into having some more options for events further down the road, they could be better and more flexible for sure where less scripting would be needed.

    Hi!
    That sounds terrible, could you send me the prefab in a UnityPackage to support@polyfied.com?
    As a workaround for now you could instantiate them separately and then set:
    Code (CSharp):
    1. yourParticleSystem.skinnedWorldObject = PlaygroundC.SkinnedWorldObject (yourSkinnedMeshTransform);
     
  8. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Let me know if you do. :)
     
  9. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    So cool!!:D
    Very thanks.
    I'd make fall down asteroid particle.
     
  10. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Now I rebuilding my FT_ImpactEffect_Vol01 asset.
    If finished, I sent asset unitypackage.:)
     
  11. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    121
    Hey, I'm trying to modify the laser script so that the width stays constant no matter how long the laser is -- in other words, if the laser hits something right now, it gets thicker because the same number of particles are created over a smaller bunched up length, and I want to avoid that. At first I tried PlaygroundC.SetParticleCount() every frame, but that seems like it's not meant to be used constantly. Then I tried the particle mask setting, which almost works, but due to the nature of the laser particle effect I suppose, it hides the particles closest to the transform rather particles evenly distributed along the overflow offset. My question is, can I modify the laser so it stays the same thickness no matter what length it becomes due to the raycasting in the script? Thanks a lot, and your project is really awesome. Will be messing around with it for days if not weeks there's so much to play with!
     
  12. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    Hi so I'm playing around with this. I suck at coding but I got it to start emitting whenever I want. What I cannot figure out (and I know this might be simple for some of you) is how to make it start with turbulence and then make the turbulence fade and the particles stabilize into a shape. I'm using an image as source for the emission. Your help will be appreciated. :D
     
  13. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Great! I'll keep an eye out. :)

    Thanks Alic!
    You'll find a mask sorting in 2.2 with a scramble option, that should sort things up! :) Another solution could be to set the Particle Scale (particles.scale) along with the raycast hit distance.
    Setting particle count over time is currently a bit wonky as it has to rebuild the arrays and reboot to have all lifetime sortings intact. A more elegant solution to that will come later.

    Hey!
    You'll find a variable called turbulenceStrength on a particle system. Here's an example:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class ChangeTurbulenceStrength : MonoBehaviour {
    6.  
    7.     public PlaygroundParticlesC particles;
    8.     public float speed = 1f;
    9.  
    10.     void Update () {
    11.         if (particles.turbulenceStrength>0)
    12.             particles.turbulenceStrength -= speed*Time.deltaTime;
    13.     }
    14. }
    15.  
    For further reference you can have a look at the "Logo Example" scene, the particle system "Turbulent Logo" has a script called PlaygroundLogoExample.cs which alters turbulence (inverse of your description though). You'll also find a GUI example to changing turbulence strength and type in the "Procedural Mesh Target" example scene in a script called PlaygroundProceduralMeshTarget.cs.
     
  14. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Playground 2.2 has finally arrived, and it's a big one!



    Playground Splines
    Introducing the Playground Spline component to create and edit splines in the scene. A particle system can emit from the spline, use it as an alternative to Lifetime Positioning and target it with a Spline Target Manipulator. A Playground Spline is not exclusive for particles, you can use it for any other component as well. See the example scenes found under the Splines folder for more details how to work with splines and particles.

    Multiple Transforms as Source
    Introducing the possibility to create source positions from a list of transforms. You can specify if the particle distribution should see the source as separate or conjoint transforms, this has effect on how particles birth positions are placed and noticeable when working with any method reading the particle array linearly (for instance Overflow Offset, Lifetime Sorting: Linear/Reversed, Particle Mask and Color Method: Particle Array). See the Square Frame preset for example use.

    Prewarming
    A particle system can now prewarm its simulation upon creation (Advanced > On Load > Prewarm). Use Prewarm Lifetime Cycles to determine where in its lifetime it should start and Prewarm Cycles to determine how many calculation steps should be used (higher means more accurate but will demand more CPU). Prewarming is multithreaded for performance.

    Particle Time Scale
    You can now set the simulation time seamlessly (Advanced > Time Scale). This also lets you pause an effect by setting Time Scale to 0.

    Reworked update routines
    Preparation, calculation and final particle output has been restructured. This was to create an overall smooth particle repositioning and give better time sync. Each particle also has an individual calculation check to not interfere with final output when Sync Particle To Main-Thread is enabled. Previously you may have experienced jaggy movement especially on heavier scene setups.

    Size particle by array
    A new size option to particles is introduced where you can set the size depending on the particle’s position in the array over a normalized AnimationCurve (X:0 means first particle and X:1 means last particle).

    Lifetime Emission
    It’s now possible to specify the Lifetime Sorting pattern over a normalized Lifetime Emission value (Particle Settings > Lifetime > Lifetime Emission). Essentially this lets you emit particles during a specified period of time and break the otherwise obvious Lifetime Sorting pattern. For instance a Lifetime Emission of 0.5 will emit all particles during the first half of the specified Lifetime. The Lifetime Sorting will still remain intact.

    Transition Back To Source
    Every particle can now transition back to their source position during their lifetime. When having transition enabled you determine the amount to transition with a normalized AnimationCurve, where 1 on the X-axis means full lifetime and 1 on the Y-axis means full interpolation time. You will find it in the Forces > Force Annihilation tab.

    Spline Target Manipulator
    You can now target splines using a Property Manipulator set to Spline Target. Use the Target Method to determine if particles should position over the Spline Time or the Particle Time.

    State Target Manipulator
    Will make particles target a State (pixels/vertices) within a Property Manipulator.

    State Chroma Key
    You can now filter out a desired color (with spreading option) when creating a State. This can be used to remove any unwanted colors which can come in handy if your texture doesn’t have alpha but instead a solid background color.

    Color Method
    The Color Method lets you determine how particles get their gradient colors distributed. Using Lifetime will apply the gradient over a particle’s lifetime (as previously). Using Particle Array will color the particles linearly using the array of particles as time for evaluating the color gradient, where leftmost color in gradient is the first particle and rightmost color is the last particle. This can be useful when working with any linearly positioned particles (using Playground Splines, Lifetime Positioning or Overflow Offset).

    Particle Mask Sorting
    Sorting methods for the particle mask by linear, reversed and scrambled is introduced. For performance and more versatile use you can now enable and disable the particle mask (rather than by setting Particle Mask to other than 0). To refresh the scrambled sorting you can call yourParticleSystem.RefreshMaskSorting().

    Texture Sheet Animation
    Texture Sheet Animation (for particle UVs) is now implemented directly into the Particle Playground Inspector. You can find it in the Rendering tab.

    Sort Mode & Sorting Fudge
    Sorting particles within the particle system is now available in the Rendering tab.

    New Nearest Neighbor Origin methods
    When using Lifetime Sorting: Nearest Neighbor/Reversed you can now specify the origin method by Source Point (as previous), Vector3 or Transform. Using a Vector3 or Transform will determine the sort origin from a point in world space. Using Source Point will determine the origin from a generated particle birth position in world space.

    Cast & Receive Shadows
    Cast- and Receive shadows is now available in the Rendering tab. In Unity 5 you will see a Shadow Casting Mode instead of a toggle. Note that you will need a shader which can work with shadows (particle shaders doesn’t by default).

    Improved calculations
    An improvement to certain routines such as distance checks makes parts of the particle calculation loop faster to execute (such as collisions and all Manipulators).

    Distance effect for Size and Color Property Manipulators
    Resizing or coloring particles from a Size or Color Manipulator will now apply the Smoothing- and Distance Effect. This ables you to apply the effect additive with the distance from the manipulator taken into account. Note that Manipulator Strength will determine the multiplier over distance when not using a Transition method, where Manipulator Strength will be the speed of the effect over time when applying a Transition effect.

    Minimum to maximum spherical shape
    A new method to calculate minimum to maximum random Vector3 values is introduced where you can choose between Rectangular (behaves as previously), Rectangular Linear, Spherical, Spherical Linear. This can be applied to the Initial Velocity and Source Scatter values to get a spherical emission/position shape instead of a quadratic. Using any linear method means the distribution will take the array of particles into calculation.

    The Range determines the size of the sphere in minimum to maximum random value. When applied to Source Scatter the Range of 0-0 means no scattering, 0-1 means random within one unit from source position, where for instance 1-2 creates a random shell one unit thick.
    When applied to a force, the Range will amplify the force within a minimum to maximum random spherical direction.

    Collision improvements
    -
    Calculating collisions is faster to execute.
    - You can now also invert the affect upon rigidbody collision.
    - An exclusion list is introduced, to keep specified transforms from colliding with particles.

    Improved UI
    The Inspector of a particle system has been divided into section tabs for easier navigation. Also introducing quick info at the far right of each tab.

    More Emit() overload options
    You can now call custom emission through script by these new overloads:
    Code (CSharp):
    1. Emit (Vector3 givePosition) //Other values set by Inspector
    2. Emit (Vector3 givePosition, Vector3 giveVelocity) //Color set by Inspector
    3. Emit (float giveLifetime) //Set lifetime of particle, other values set by Inspector
    4. Emit (Vector3 givePosition, float giveLifetime) //Set lifetime of particle, other values set by Inspector
    5. Emit (Vector3 givePosition, Vector3 giveVelocity, float giveLifetime) //Set lifetime of particle, color set by Inspector
    6. Emit (Vector3 givePosition, Vector3 giveVelocity, float giveLifetime, Color32 giveColor)
    Out Of View - a reworked calculation culling
    There’s a new section called Out Of View found in Advanced. The previous Auto-Pause Calculation is reworked to get triggered by the camera frustum, along with that trigger options where you can set trigger positions from a Transform, size of the trigger area and its offset. The trigger will only work in Play Mode and will only disable calculation when no camera (including Scene Camera) no longer is rendering the particle system.

    Render toggle
    You can now control the render output by toggling Rendering > Render Mode > Renderer.

    Particle stretching improvements
    Lifetime Positioning can now cope with Render Mode: Stretch and its settings. You’ll also find a toggle for Start Stretch. Thanks to the reworked update routines stretching will also appear more stable.

    Sync Particles On Main-Thread
    Previous setting Sync Positions On Main-Thread has been reworked to sync particle time, birth positions, rotation and size. This will ensure smooth updates for each particle.

    Particle Tracking Method and improvements
    A Manipulator tracking its particles can now use a much faster method by comparing each particle by its Manipulator Id. This will only work for non-overlapping Manipulator areas. The original method is done by the Particle Id. This will work for overlapping areas but requires a particle-to-particle comparison, which naturally makes it heavier to compute.

    You can now also use IsParticleInsideManipulator (particleId, manipulator) to detect if a certain particle is within a specified Manipulator. This method doesn’t require any tracking.

    Hierarchy icon - an indicator
    An icon in the Hierarchy is added to each Playground system. This serves as an indicator if the particle system isn’t currently calculated (for instance when out of view or when the simulation has expired) by turning beige. The icon will turn red to indicate that the calculation loop is reporting a slow iteration, this is a good way to detect which particle system is slowing down a scene.

    For the full list of updates, see the version history document.
     
    Last edited: Feb 1, 2015
    overthere, DMeville, red2blue and 5 others like this.
  15. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,181
    (Crikey! That's a lot!)
     
  16. Toad

    Toad

    Joined:
    Aug 14, 2010
    Posts:
    297
    Amazing update. Thanks for the excellent support.
     
    Last edited: Feb 1, 2015
  17. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    121
    Hey Save, thanks for your response earlier. Also, 2.2 looks incredible -- how did you pack so much in there!? I'm really excited about trying it out but I'm running into this error every time I try to install it (by deleting the old pp folder and then importing the new package from the asset store):

    DynamicHeapAllocator out of memory - Could not get memory for large allocationCould not allocate memory: System out of memory!
    Trying to allocate: 5592408B with 32 alignment. MemoryLabel: Texture
    Allocation happend at: Line:411 in C:/BuildAgent/work/d63dfc6385190b60/Runtime/Graphics/Texture2D.cpp
    Memory overview


    [ ALLOC_DEFAULT ] used: 346139245B | peak: 0B | reserved: 394667388B

    [ ALLOC_GFX ] used: 386450341B | peak: 0B | reserved: 398109414B

    [ ALLOC_CACHEOBJECTS ] used: 11470562B | peak: 0B | reserved: 52428800B

    [ ALLOC_TYPETREE ] used: 51912144B | peak: 0B | reserved: 83886080B

    [ ALLOC_PROFILER ] used: 222424B | peak: 0B | reserved: 8388608B
    Could not allocate memory: System out of memory!
    Trying to allocate: 5592408B with 32 alignment. MemoryLabel: Texture
    Allocation happend at: Line:411 in C:/BuildAgent/work/d63dfc6385190b60/Runtime/Graphics/Texture2D.cpp
    Memory overview


    [ ALLOC_DEFAULT ] used: 346139245B | peak: 0B | reserved: 394667388B

    [ ALLOC_GFX ] used: 386450341B | peak: 0B | reserved: 398109414B

    [ ALLOC_CACHEOBJECTS ] used: 11470562B | peak: 0B | reserved: 52428800B

    [ ALLOC_TYPETREE ] used: 51912144B | peak: 0B | reserved: 83886080B

    [ ALLOC_PROFILER ] used: 222424B | peak: 0B | reserved: 8388608B

    UnityEditor.AssetDatabase:LoadAssetAtPath(String, Type)
    PlaygroundSettingsC:GetAssetsOfType(Type, String) (at Assets\Particle Playground\Scripts\Editor\PlaygroundSettingsC.cs:258)
    PlaygroundSettingsC:SetReference() (at Assets\Particle Playground\Scripts\Editor\PlaygroundSettingsC.cs:183)
    PlaygroundSettingsC:GetReference() (at Assets\Particle Playground\Scripts\Editor\PlaygroundSettingsC.cs:175)
    PlaygroundHierarchyIcon:Set() (at Assets\Particle Playground\Scripts\Editor\PlaygroundInspectorC.cs:946)
    PlaygroundHierarchyIcon:.cctor() (at Assets\Particle Playground\Scripts\Editor\PlaygroundInspectorC.cs:942)
    System.Runtime.CompilerServices.RuntimeHelpers:RunClassConstructor(IntPtr)
    System.Runtime.CompilerServices.RuntimeHelpers:RunClassConstructor(RuntimeTypeHandle) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs:101)
    UnityEditor.EditorAssemblies:RunClassConstructors() (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\EditorAssemblies.cs:67)
    UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[]) (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\EditorAssemblies.cs:55)

    [C:/BuildAgent/work/d63dfc6385190b60/Runtime/Allocator/MemoryManager.cpp line 917]
    (Filename: Assets/Particle Playground/Scripts/Editor/PlaygroundSettingsC.cs Line: 258)

    Any ideas? I do have a lot of assets loaded into this project, but out of memory?
     
    Last edited: Feb 2, 2015
  18. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200
    This is so fantatstic. Thanks a lot for your efforts. I am even more a happy customer! :)
     
  19. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    2.2 was a really intense and exhausting cycle! :)

    That is interesting, I've been doing some tests and it seems GetAssetsOfType will run no matter what upon unpacking. After that it will only run if Playground Settings.asset or the hierarchy icons isn't found at the default location (which is the intended behavior). So for some reason the editor searches for yet unallocated assets on a new installation.
    To work around that, here's a fix: http://www.polyfied.com/development/unity/playground/pp2.2-installmemoryfix.unitypackage. It will simply skip any searching for assets.

    1) First download and install the fix into your project.
    2) Click the import-button for Particle Playground 2.2 on the Asset Store.
    3) Disable import of PlaygroundSettingsC.cs:


    Let me know how it works out!

    Edit: I forgot to say, this will be fixed soon in a small update. So you who experience this in a heavy project will only need the install fix for version 2.2.
     
    Last edited: Feb 2, 2015
  20. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Thanks guys, hope the update treats you well! :)
     
  21. HoMeBoYErik

    HoMeBoYErik

    Joined:
    Mar 12, 2014
    Posts:
    23
    How can I remove the debug info and stats (like particle counts) from appearing in the game window (they are also showing in the final build)???
    I can't find anywhere the option to hide this info. They are like several white lines of text in the top left corner. Thank you
     
  22. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Search for playgroundscenes in the Hierarchy view then remove the PlaygroundScenes.cs component from the GameObject.
     
  23. EricGree

    EricGree

    Joined:
    Jan 30, 2015
    Posts:
    3
    When I create a system that a Death Event and the linked Death Event system is suppose spawn multiple particles (eg. an explosion), however, only one particle is spawned. I noticed that its Emission Rate is greyed out, supposedly under the control of the script but I don't see how or where parent system controls the child's Emission Rate under Events.

    We're still using Particle Playground 2.14 and have yet to integrate 2.2 into our build so I don't know if this issue has been resolved yet.
     
  24. maxthecat

    maxthecat

    Joined:
    May 26, 2014
    Posts:
    27
    Awesome update.

    I'm doing an iOS build with the latest 4.6.2f Unity and IL2CPP enabled, and I am not seeing any particles except the one that still uses the Unity system.

    I've double-checked with one of your example scenes and don't see any particles either. I haven't investigated much more than that sorry.

    Thanks
     
  25. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    The event system when using a particle system as target will work like this, it basically goes into scripted emission where each event broadcasted means one particle. It is on the todo to be able to set quantity of emission.
    Currently to be able to customize the emission further you need to use event listeners instead, see the post a bit earlier on this page.

    Thanks! I'll be doing some tests tonight and see if I get the same results. I'll get back to you as soon as I'm done.
     
    EricGree and maxthecat like this.
  26. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    I've been doing some tests and I get the same result you're seeing. Multithreading may not be implemented yet for iOS in IL2CPP (it doesn't seem to be yet in WebGL at least).
    The good news is things seem to work as expected using Scripting Backend: Mono (2.x), till any Unity update you would have to rely on the good ol' backend is my best guess. I'll contact Unity about it though to see if we can get some clarification.
     
  27. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Version 2.21 is available, it's a small update addressing the issues reported since the 2.2 release (release notes).
    An updated source info for you who is curious about the sources:
     
  28. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    121
    Hey saved, sorry I didn't get around to trying your 2.2 fix, but 2.21 works great for me! I see you fixed a bunch of timescale stuff (my game goes into slow motion a lot and it was making some particle systems behave differently before 2.2). I have one more timescale thing for you: Delta Movement Strength doesn't take timescale into account... or in other words it gets confused by timescale changes and it applies less force from Delta Movement when the game is in slow motion. Is there an easy way to fix this? I could see it being tricky depending on how/where you're calculating the delta movement, so if it's better left working the way it currently does within playground, I can just write my own script to apply directional velocity. I just thought I'd mention it in case it wasn't intentional behavior.

    Someone was suggesting a page ago in this thread that you should try to package more ready-to-go particle systems to get people started, and you mentioned that getting some really polished effects would require focusing a good amount of effort on assets rather than the codebase. It got me thinking, have you considered seeing if any of the particle pack creators on the asset store want to do a cross promotion, where they give you a sample pack of their work to include in particle playground, and you advertise their other work within the package? For the asset creator, it would be a really good way to sell a larger pack of their particle playground stuff, since it would reach all of their target market (owners of particle playground).

    You actually have (for my money) the best vfx artist on the asset store posting in this thread -- have you seen Frontakk's cartoon packs? They're incredible. And the non cartoon packs are really high quality as well.

    Anyway, sorry to ramble. Thanks for all the work you do, save.
     
  29. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    321
    Knowing what save is capable of, I would prefer him to create his own assets that utilize Particle Playground instead of cross-promoting with assets that don't use it.

    Also because everything I've seen in save's videos look top-notch AAA quality. Don't get me wrong, there are other 'good' particle packs on the asset store, but I doubt most would be able to match the quality of what save is capable of producing.
     
  30. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    121
    Hey ex, I suggested finding an asset creator who uses or is starting to use particle playground, and including a sample of their effects made with particle playground. Not sticking effects that have nothing to do with particle playground into the package! (Which would admittedly be a very strange move.) If anything, it could be a good way of jump starting a market for particle playground based packs on the asset store.

    That said, I agree that saved seems quite capable a producing great looking particle effects. And I'd love to see what he can do with more focus shifted to the art side of things!
     
    Exeneva likes this.
  31. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    159
    Sorry if this has been asked before, i went trough a few pages of the thread without seeing those questions :

    1 : Unity 5 support ?

    2 : I have a pool for my turrets / units of my game. I deactivate / reactivate when i need. What would be the best approach regarding their particle effects : Like a cannon turret firing. Should i make an effect, attached to the turret itself, that gets activated or deactivated at the same time. Or should i make a pool of particle effect only that the turret call when needed ? ( I am asking to have the best performance possible ). O, should i simply spawn / destroy the effects ?

    Thanks in advance ! And congratz on this awesome plugin !!
     
  32. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey Alic!
    Thanks! It's an interesting concept. I'm hoping, and it looks like things are starting to happen here and there, that artists creates additional packages now that the framework is strong enough in features and has a good user base. I have a hunch we will start to see additional material soon. This is also something I'm trying to layout with the Asset Store team and PP in Editor / external site, so it is beneficial for the artists in terms of exposure. It's really a project in itself making that a nice liftoff. :)

    Once the ball starts to roll we'll see some amazing things I believe, I have seen newcomers to the framework doing quite remarkable stuff for their projects with only a couple of hours spent digging into the PP features. I really hope such talents take it a step further to share their effects in a profitable way for them.

    From my perspective in where I believe PP is headed, my time is currently best spent in making that platform available and keep making more awesomesauce features for the creativity that is starting to flourish. However, see answer to Exeneva below for some further details. All in all, great thanks to sharing those thoughts, perhaps there will be some deals made in the future with promising content from certain artists.

    For the Delta Movement not being connected to the time scale, next version will have the real simulation time taken into account as such in PlaygroundParticlesC.cs at line 3577:
    Code (CSharp):
    1. playgroundParticles.playgroundCache.velocity[p] += (deltaVelocity*playgroundParticles.deltaMovementStrength)/playgroundParticles.realSimulationTime;
    You could also alter the deltaMovementStrength accordingly to your time scale.

    Thanks a lot Exeneva, I really appreciate this!
    I've been thinking a lot about your request in between hectic coding hours. I really hope to have time to make additional packages with high quality effects. These will in that case be stand-alone as separate packs and run without the need for having Playground installed. If such packages will cost made from my end is too early to say. This would be in line with expanding towards having a beneficial platform for fx artists which is the goal in the long run.

    What I want to stay away from is putting Playground into a genre of my own art style and any game style, this is why the example effects that come with the base package is somewhat neutral (a bit cartoonish perhaps). The same thing still stands for the 2.2 video example effects, where they don't fall specifically under an art style. They're simply there to give an idea of possibilities (colorful dots showcasing the features). Currently from a project perspective, it is already kind of filled to the max with example scenes, a "stand-alone" example project, scripts for all sort of situations and particle systems to build from.

    The framework in itself though needs a lot more learning material, and this is where I've fallen short during the stage of evolving the product. Once that part has become better I hope a lot of artists will feel comfortable to just give it a go, to enable the community more ready-made effects, and it would benefit all parties involved.

    The roadmap for Playground is long, and for every release it seems to keep extending as we tread into new waters. I want to make sure that for every step the framework becomes more accessible to newcomers, but try to keep a clean slate of the starting point. Does that make sense from a user perspective?

    Don't get me wrong, I really appreciate these requests because they can help push forward in a much better direction - and they can help other PP users take action where it is needed. ;)

    Hey Feydwin,

    1. Yes, the package is tested along with the Unity 5 beta.

    2. You could attach the effect to the turret itself, once the particle system's GameObject goes inactive it will simply stop using any resources. If you have a lot of turrets with the same effect you may benefit from using either Source: Transform mode (which takes several transforms) or Source: Script mode to emit from script, to have all particles running from one system. Feel free to ask for any specific details!
     
    Last edited: Feb 5, 2015
    Exeneva likes this.
  33. EricGree

    EricGree

    Joined:
    Jan 30, 2015
    Posts:
    3
    I'm having issues creating a system with a State source -- in Create State I select a texture and then click Create but nothing happens. However, if I select the Particle-Playground-2 texture (used in the Logo Example scene) I am able to create a new State.

    If I try to change the Source State's texture from the Particle-Playground-2 texture to something else the emitted particles remain rendered in the same shape as the Particle Playground Logo (as used in the Logo Example). I cannot delete a Source State if it's using a texture that's not the Particle-Playground-2 texture.

    The odd thing was that the technical artist managed to change the Source State's texture. Regrettably he quit so I don't know what he did differently.

    Was there a step I missed? (We're still on Particle Playground 2.14 for now).
     
  34. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Check that the texture you're trying to apply has Read/Write enabled in its Import Settings. You should see a message in Console as well when trying to assign a non-readable texture.


    After setting a new texture to an already created state you may have to press the "Refresh" button. This will extract the pixels or vertices from the updated state.
     
    EricGree likes this.
  35. aandreyev

    aandreyev

    Joined:
    Nov 25, 2014
    Posts:
    1
    Hey save,
    I have one issue I faced recently. I have my scene with Playground manager in it, along with four global attractor manipulators, and also I have a prefab with one playground system. So, when I initiate this prefab right in the scene it completely refuses to interact with those global manipulators in the scene I set up earlier. Any ideas why it happens?
    Also, Thank you so much for your amazing work you've done for community.
     
  36. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey, thanks!
    I'm not entirely sure why that could be, do the Manipulators have the same Affect layer set as the particle system?



    In case you keep experiencing the same behavior you're welcome to contact me through support@polyfied.com with some further details (preferably with a stripped down version of your project).
     
  37. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Last edited: Apr 10, 2015
  38. victor874

    victor874

    Joined:
    Jan 20, 2015
    Posts:
    4
    Hi Save, i was wondering if you happened to know of a way to create a blood squirt in playground? Very nice 2.2 update btw, really liking all of the new features that you added.
     
  39. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    victor874 likes this.
  40. victor874

    victor874

    Joined:
    Jan 20, 2015
    Posts:
    4
  41. maxthecat

    maxthecat

    Joined:
    May 26, 2014
    Posts:
    27
    Good news, particles are working for me with the latest Unity patch release 4.6.2p2

    Did have to fix the following issue with the patch

    http://forum.unity3d.com/threads/4-6-2p2-ios-arc-restrictions-compiler-error.297802/#post-1961845
     
  42. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
  43. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Playground 2.22 is available. This is the first candidate with Windows Store Apps SDK 8.1 support, utilizing the Windows 8.1 thread-pool. This implementation is still in beta, but I wanted to get out a version which compiles and runs ASAP. Currently you will not be able to build debug releases for SDK 8.1 and you may experience issues with reading Unity's builtin Gradient.Evaluate(). This might be a restriction reading gradients from the thread-pool in UNITY_METRO. Investigation keeps going to add improved support for Windows phone/tablets in future releases.
    Huge thanks to Troy Walker and Saeed HasanZadeh for your time in testing!

    Apart from the W8.1 thread-pool compatibility some necessary bug fixes and optimizations for all platforms is implemented. See the updated version history for more info.
     
    Last edited: Feb 15, 2015
  44. GarethWestCoast

    GarethWestCoast

    Joined:
    Feb 4, 2015
    Posts:
    4
    Hey,

    I am currently using particle playground for a racing game to simulate the vehicle kicking up dust. I am trying to change the particle count on the effect to emit more when the vehicle is travelling faster. The problem with this is that the particle effect restarts every time the particle count is changed. Do you have any suggestions about how I could get around this ?

    Cheers,
    Gareth
     
  45. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi Gareth,
    There are a couple of options:

    #1 Particle Mask
    The Particle Mask can change the visible particles in simulation. In your case you could connect the mask amount to the speed of your vehicle. If you'd like you could use the Mask Time to fade in/out. Use Mask Sorting: Scrambled to create an arbitrary masking list of particles.
    Here's an example of masking particles by percentage:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. /// <summary>
    6. /// Mask particles by percentage.
    7. /// </summary>
    8. [ExecuteInEditMode()]
    9. public class ParticleMaskingPercentage : MonoBehaviour {
    10.  
    11.     public PlaygroundParticlesC particles;    // Assign your particle system in the Inspector
    12.     public float maskingPercentage;            // The percent of particles to be masked
    13.  
    14.     void Start () {
    15.         particles.applyParticleMask = true;
    16.     }
    17.  
    18.     void Update () {
    19.         maskingPercentage = Mathf.Clamp (maskingPercentage, 0, 100f);
    20.         particles.particleMask = Mathf.RoundToInt(particles.particleCount*(maskingPercentage/100f));
    21.     }
    22. }
    23.  
    How the percentage changes could be controlled by the vehicle, for example:
    Code (CSharp):
    1. maskingPercentage = Mathf.Clamp (maskingPercentage*(currentVehicleSpeed/maximumVehicleSpeed), 0, 100f);
    #2 Several particle systems in a sequence
    You could use several particle systems in correlation to each other which are enabled at certain speeds. This way you can control how textures behave as well, for example where each particle is turning to more dense and darker dust at higher speed of the vehicle.
    Here's an example of a sequencer controlled by one single input:
    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using ParticlePlayground;
    6.  
    7. /// <summary>
    8. /// Enables/disables emission on sequenced particle systems determined by minimum to maximum range.
    9. /// This can be used to control emission of several systems by one single input.
    10. /// </summary>
    11. public class ParticleSystemsSequence : MonoBehaviour {
    12.  
    13.     public float input = 0f;                                            // The current input
    14.     public float maximumSequenceRange = 100f;                            // The maximum sequence possible
    15.     public List<SequenceRange> sequences = new List<SequenceRange>();    // The list of sequenced particle systems
    16.  
    17.     void Update () {
    18.         Sequencer();
    19.     }
    20.  
    21.     void Sequencer () {
    22.  
    23.         // Repeat the input
    24.         input = Mathf.Repeat (input, maximumSequenceRange);
    25.  
    26.         // Enable emission if input is within the min-max range of the assigned sequences
    27.         for (int i = 0; i<sequences.Count; i++)
    28.             sequences[i].particles.emit = sequences[i].IsWithin(input);
    29.     }
    30. }
    31.  
    32. [Serializable]
    33. public class SequenceRange {
    34.     public PlaygroundParticlesC particles;    // Particle systems
    35.     public float minRange;                    // The minimum value for enabling
    36.     public float maxRange;                    // The maximum value for enabling
    37.  
    38.     /// <summary>
    39.     /// Determines if f is within min-max range.
    40.     /// </summary>
    41.     /// <param name="f">Float to compare with.</param>
    42.     public bool IsWithin (float f) {
    43.         return (f>=minRange&&f<=maxRange);
    44.     }
    45. }

    #3 Scripted emission
    The most seamlessly fluid solution would be to control the emission by script, where you could emit at a rate which is connected to the speed of the vehicle. This way you have exact control over when and where the particles emit where you can have a flexible velocity, color and lifetime each Emit(). The particles will be reused in their pool so if you need more dust just turn the Particle Count up till you have enough.
    For example you could have a look at EmitOnTranslation.cs that tags along in the Simple Scripts folder, where minSpace determines the emission rate:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. [ExecuteInEditMode()]
    6. public class EmitOnTranslation : MonoBehaviour {
    7.  
    8.     public PlaygroundParticlesC particles;                // Assign the particle system in Inspector
    9.     public Transform movingTransform;                    // Assign the moving Transform in Inspector
    10.     public float minSpace = .1f;                        // The minimum space required for emission
    11.  
    12.     bool isReady;
    13.     Vector3 previousPosition;
    14.  
    15.     void Start () {
    16.         if (particles==null)
    17.             particles = GetComponent<PlaygroundParticlesC>();
    18.         if (movingTransform==null)
    19.             movingTransform = transform;
    20.         if (particles!=null&&movingTransform!=null)
    21.             isReady = true;
    22.         previousPosition = movingTransform.position;
    23.     }
    24.  
    25.     void Update () {
    26.         if (isReady)
    27.             EmissionMoveCheck();
    28.     }
    29.  
    30.     /// <summary>
    31.     /// Emit when particle system is moving.
    32.     /// </summary>
    33.     void EmissionMoveCheck () {
    34.         if (movingTransform.position!=previousPosition) {
    35.             float emissionStepper = 0;
    36.             float deltaDistance = Vector3.Distance (previousPosition, movingTransform.position);
    37.             if (deltaDistance<minSpace) return;
    38.             Vector3 delta = previousPosition;
    39.             Vector3 velocity = Vector3.zero;
    40.             Color color = Color.white;
    41.             while (emissionStepper<deltaDistance) {
    42.                 delta = Vector3.Lerp (previousPosition, movingTransform.position, emissionStepper/deltaDistance);
    43.                 particles.Emit(delta, velocity, color);
    44.                 emissionStepper += minSpace;
    45.             }
    46.         }
    47.         previousPosition = movingTransform.position;
    48.     }
    49. }
    50.  
    Other scripting examples which can be useful:
    - EmitByAmountC.cs
    - EmitFromTransformsC.cs
    - PlaygroundInk.cs
     
    Last edited: Feb 17, 2015
  46. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    For anyone who wants really neat magic effects I can highly recommend FT ImpactEffects Volume01 by the incredibly talented @frontakk from FlyingTeapot.

    Playground license is not required to run the effects and you'll find additional Legacy and Shuriken versions in the package.
     
    ZJP and Exeneva like this.
  47. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,646
    Nice to see someone who has upgraded their tool with PP. Better result and on my buy list. :cool:
     
  48. frontakk

    frontakk

    Joined:
    Jan 8, 2011
    Posts:
    292
    Hi save,
    Thank you for introducing my asset;)
    I love PP!
     
  49. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    321
    Yeah, definitely on my buy list too!

    @frontakk, you might be receiving a message from me soon about a contract job ;)
     
  50. GarethWestCoast

    GarethWestCoast

    Joined:
    Feb 4, 2015
    Posts:
    4
    Thanks a lot , This is a really great tool.

    Gaz
     
unityunity