Search Unity

  1. Unity 2019.2 is now released.
    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
    Great and important addition, this is added to the next release! I'll get in touch with some more thorough info.
     
    mcmorry likes this.
  2. Hilbert

    Hilbert

    Joined:
    Dec 3, 2014
    Posts:
    10
    I have not tried implementing this yet and it might be too expensive because it requires additional state, but my idea would be the following (I hope that I have managed to write this down in a way that can be understood):
    - If one remembered with which value the sin/cos manipulator was called in the previous time step, one could then add only the difference between the old and the new sin/cos value during the next step. This way one superimposes a proper sine/cosine onto the underlying value (which can be freely manipulated by forces etc.).
     
  3. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Very interesting idea, thanks for sharing that! I'll do some experimentation of this for an upcoming release, there's probably some really handy features that could come out of that approach. :)
     
  4. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    287
    Hi save,

    I'm using a manipulator to change the attracted particles' colour, but it seems like a hit and miss. More if I use a box shape compared to a sphere. The particles themselves are attracted, it's just the colour of some particles doesn't change at all. If the particles exit and reentered the manipulator bounds then the colour changes, and even that isn't 100% guaranteed.
     
  5. Lee7

    Lee7

    Joined:
    Feb 11, 2014
    Posts:
    136
    Does particle playground work when game is using DX11?
     
  6. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Could you possibly send the particle system to support@polyfied.com (preferably as a preset which can be done through the Preset Wizard), it would be interesting to see how the particle system is setup.
     
  7. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Yes it's compatible with Dx11 but doesn't utilise anything from the library (non GPU accelerated). If you're looking for GPU accelerated particle systems I can recommend TC Particles.
     
  8. moh05

    moh05

    Joined:
    Nov 26, 2015
    Posts:
    65
    Hello,

    First great work there! Loved the video demos :)

    I am working on a card game ( yeah I believe you already got tons of similar questions, sorry for that :D )...I am using UI Images and want to have a nice highlight effect when user clicks a card. I was wondering about the following:

    1- Is it possible to achieve that using the new Unity UI elements ( i might add effects on buttons too)

    2- Is the solution "performance" friendly with mobile devices?

    Thanks in advance :)
     
  9. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi @moh05!
    Thanks, that's great to hear.

    1) There's no built-in functionality to directly support any of the UI elements, you can however emit from the pixels in a texture but you would need to position and scale this accordingly to your UI element (basically faking it). You could also setup your emission positions to match any shape using a spline for instance. It comes down to what type of result you're after.

    2) PP's optimisations are oriented around CPU times and memory efficiency with ability to scale up based on available CPUs. All features are mobile friendly, it rather comes down to the more extreme setups where simulated particle amount and the more performance heavy features (such as turbulence and collisions) will make a difference for how the device performs. The performance article could perhaps be of interest how PP balance the calculations on available CPUs (and how you could configure this for your needs).
     
    moh05 likes this.
  10. moh05

    moh05

    Joined:
    Nov 26, 2015
    Posts:
    65
    Thank you for the reply :)
     
  11. Lee7

    Lee7

    Joined:
    Feb 11, 2014
    Posts:
    136
    So I am thinking about buying Particle Playground and I have a a use case that may or may not work with it.

    I have a collection of "trails" defined by Vec3's, I would like particles to follow these trails from beginning to end. This seems like it would work but I also want the particles to change colors based on how many other particles are around. Basically if alot of particles are in an area, they would get bright red, if only a little they would just be green or yellow or something.

    Does PP have features that can support something like this?

    Thanks!

    Oh yeah, I would be looking at upwards of 100k vec3's defining the trails, so the solution should be performant, one of the reasons I am looking at PP.
     
    Last edited: Feb 8, 2016
  12. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi @Lee7,

    The short answer is: Don't use Playground for this, the longer answer:

    There's no prebuilt functionality for particle-to-particle relations in PP. What can be done to shift particle color based on world positions is using Manipulators which possibly could simulate what you'd like to achieve to some extent.

    For targeting positions there's several methods but none that is using only Vector3s, the solutions available there are more oriented to what's easy to setup through the Inspector (transforms / splines / meshes). There really should be more programmatically and advanced available Manipulators though for more extensive use, something to look into for an update! :)

    For simulating around 100k you would potentially need to break apart the particle system into several to distribute the calculations over more cores. I'm leaning towards recommending a solution that is able to run GPU accelerated particle calculations in your case, which PP does not. Your case sounds so very specific that I'm also thinking you might want to use something that is specifically handmade for that implementation, it's quite a big dataset of relations which could need its own specialised fields for controlling the particles behaviour. Using Playground in this scenario would rather complicate the matter and will only add an unnecessary overhead.
     
    Last edited: Feb 8, 2016
  13. Lee7

    Lee7

    Joined:
    Feb 11, 2014
    Posts:
    136
    Well, I already bought PP because I know I can use it for basic stuff like explosions for which I am currently using detonator.

    So far I have converted my list of vectors into a spline, the spline emits particles. I think that if I use the spline method I can get away with far less "actual" positions (using the spline as a form of interpolation). Based on this, I can probably get away with less than 50k actual positions.

    The colors on the other hand are still the mystery. I noticed the "Ink" example scene, it is possible using that effect I can achieve similar results to what I am aiming for.

    To give you a better picture of what I am trying to do: I record the position of all players throughout a match ever .25 seconds, match length being between 20 and 30 minutes, 20 max players) Based on these numbers is where I got the 100k figure.

    After the match is over, I wish to display a heatmap type analytics function for the players to see, my game being an FPSZ means a traditional heatmap wont work, also traditional heatmaps resolution very low and when scaled up performance is bad. I wish to use particles to display the "trails" of the players throughout the match, and get brighter or change colors when multiple trails converge to signify more "heat" in that area. Since I only need this effect to display when the round is over, performance doesnt need to be super good, just like 30fps would be fine. I am using this effect as basically a tool, not a part of gameplay.

    Since I already bought PP I will see what I can do in that regards. I am also interested in GPU particles as well.

    Code (CSharp):
    1.     public void Render(HeatmapEvent heatmapEvent)
    2.     {
    3.         spline.Reset();
    4.  
    5.         Vector3[] points = new Vector3[heatmapEvent.positions.Count * 3 - 2];
    6.  
    7.         for (int i = 0; i < heatmapEvent.positions.Count; i++)
    8.         {
    9.             if (i > 1)
    10.                 spline.AddNode();
    11.  
    12.             if (i != 0)
    13.                 points[i - 1] = heatmapEvent.positions[i];
    14.  
    15.             points[i] = heatmapEvent.positions[i];
    16.  
    17.             if (i != points.Length)
    18.                 points[i + 1] = heatmapEvent.positions[i];
    19.         }
    20.  
    21.         spline.SetPoints(points);
    22.     }
     
    Last edited: Feb 9, 2016
  14. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    847
    how do I get a particle based mesh e.g. a hover car to repeat a loop from the beginning of the spline to the other end. been a while since I have used this.
     
  15. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Thanks, that makes it more clear. Did you have any progress in the matter? I think it should be possible performance-wise, especially if the heat map doesn't need to update each frame. There's no good solution ready for particle to particle calculations, however a possible solution could be to add color Manipulators into the most dense areas of your recorded trail positions.
     
  16. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    I'm not sure if you want to move the mesh over a spline or if you want the particles lifetime cycle to repeat over the mesh vertices. To translate something over a spline you can read a spline position like so:
    Code (CSharp):
    1. using UnityEngine;
    2. using PlaygroundSplines;
    3.  
    4. public class GetPositionFromSpline : MonoBehaviour {
    5.  
    6.     public PlaygroundSpline spline;
    7.     public float time = .5f;
    8.  
    9.     void Start () {
    10.         Vector3 position = spline.GetPoint (time);
    11.     }
    12. }
    To make the particles sequence over a mesh vertices you could use Particle Settings > Lifetime > Lifetime Sorting: Nearest Neighbour. The Sort Origin will determine the starting point.

    Did this get you in the right direction or were you looking for something else?
     
  17. YoMucka

    YoMucka

    Joined:
    Jan 11, 2016
    Posts:
    2
    Hi, how can you make particles follow an object? Because with Playground Trails or Playground Follow, you can make particles/objects follow particles, I want to do the opposite which is object first, then particles follow it just like Unity Trail Renderers Component.

    I'm building a shooting game, players shoot bullet which is a prefab of actual game object, and I want to add some trails effect to it.
    I can do it pretty easily with Unity Trail Renderer Component by just adding the component to the object, but I can't get the way to do it with Particle Playground. Because both Playground Trails and Playground Follow need playground particles first to follow.
     
  18. Lee7

    Lee7

    Joined:
    Feb 11, 2014
    Posts:
    136
    I did some initial work on it, I believe I should switch to trails that never expire. The following image shows my initial progress, you can see the white area on the ground, that is where I stopped and walked around for a bit. It glows white indicating more "heat".

    I believe my next course of action is to make a gameobject follow the spline from beginning to end over about 5 seconds and emit some particles as its going, the particles can have some trail renderers attached, the trail renderers should not expire but the particles can once the trail is finished being traced.

     
  19. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    Question. How could I detect when a particle effect has done playing?
    Is there any callback? or handler method?
     
    Last edited: Feb 22, 2016
  20. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Have a look at the many Manipulator options to guide particles! :)
    Let me know if you need further guidance of course.

    Things get so much clearer with images. It looks interesting! As you say, and to judge from the image, trails would be an extreme amount more efficient, but it depends how complex a path can get. Just ask if you need any ideas how to proceed where you believe Playground can be involved.

    Yes, you can use IsAlive() to determine if particles are still in simulation.
     
  21. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
  22. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    @save Hi I'm generating a nice quantity of trails and in the profiler I get every few seconds a spike of 100ms in the method PlaygroundQueue.EnqueueTask().
    The methods inside (Monitor.Puls and Queue.Enqueue) are not the issue. It seems that the locking is causing this.
    I also tried to disable threads, but it still go through the locking and the spike is still there.
    Any hint?
     
  23. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    I am experiencing a problem that all effects look like same.
    I investigated and found the reason.
    The random seed is based on creation time.
    So if I create many effects simultaneously, it is all same.

    I modified a sources file.
    I want for you to apply this modification.

    OnEnable() method of PlaygroundParticlesC.cs
    Code (CSharp):
    1. //in member declaration
    2. static System.Random random = new System.Random();
    3.  
    4. //line 6527
    5. //original code
    6. //// Set new randoms
    7. //RefreshSystemRandom();
    8.  
    9. //new code
    10. if( internalRandom01 == null )
    11. {
    12.     internalRandom01 = new System.Random(random.Next());
    13. }
    Pros.
    - Random seed is not based on creation time.
    User can create many effects at once.
    - Allocation count is decreased.
    It will not allocate System.Random() whenever effect plays
     
    Last edited: Feb 24, 2016
  24. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi,
    I'll look into it, how many trails are you approximately generating? Could it be connected to garbage collection at that point?
    I'm reworking the structure for trails for the next update to be more efficient upon creation in terms of GC and rendering (grouping the meshes). This should solve any GC related issues upon particle birth.
     
  25. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Nice! This function is available to set seed:

    Code (CSharp):
    1.         /// <summary>
    2.         /// Sets the random seed for the internal System.Random.
    3.         /// </summary>
    4.         /// <param name="seed">Seed.</param>
    5.         public void SetRandomSeed (int seed)
     
  26. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    [/QUOTE]
    Code (CSharp):
    1.         /// <summary>
    2.         /// Sets the random seed for the internal System.Random.
    3.         /// </summary>
    4.         /// <param name="seed">Seed.</param>
    5.         public void SetRandomSeed (int seed)
    [/QUOTE]

    Yes. I know the function.
    But even if I set the seed by using SetRandomSeed(), it is overwritten whenever OnEnable() happened in original code.
    So I suggest my modification.
     
  27. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    579
    Is not CG related. I'm sure. Also using the profiler with deep profile it points to the method I told you.
    I'm generating a few random sun explosions. The trails are based on 20 or 30 particles with a lifetime of 3 seconds. The trails time is 5 seconds. I use also manipulator. I could send you the effect if you need, but I don't know much it depends on the settings.

    On thing that could be useful is that I turn on and off the effects by code at random intervals using Emit(true) and Emit(false);
     
  28. Jotunn

    Jotunn

    Joined:
    Jan 10, 2014
    Posts:
    22
    Hello @save,
    I wonder if "simulation space - Local" does not work when set transform other than Particle Playground System as Source - transform.

    I want to create a GameObject(named "Root") has 2 children, children are particle emitter and emit particles toward "Root".
    And while "Root" rotating, particles keep drawing straight line.

    First, I tried a simple method.
    1. create 2 Particle Playground System
    2. set their simulation space to "Local"
    3. make them children of "Root".
    4. Rotate "Root"

    This method works fine as shown in the figure below.
    (blue square is "Root", orange circle is emitter)

    Next, I tried to use other transforms.
    1. create 1 Particle Playground System
    2. set its simulation space to "Local"
    3. create 2 empty objects
    4. In "Source - Transform" section of Particle Playground System, create 2 transform and set 2 empty objects.
    5. make them children of "Root".
    6. Rotate "Root"

    Result of this method is not good.
    When "Root" rotate, particles stay world position and draw curved lines.
    Are there any methods to use both "Local" simulation space and transform other than Particle Playground System as Source ?
     

    Attached Files:

  29. Jackrabbit82

    Jackrabbit82

    Joined:
    Mar 13, 2013
    Posts:
    12
    I've got a little question on what can be achieved with the event listener and event system. Let's say i want to instanciate a blood puddle decal when blood particles hit an environement collider. I'm trying to understand all of this and i can't get my head around the concept of the event listener and event system. Would you have a little example C# script or could you explain a bit to a noob programmer like myself how i can put in games event liked to the particles event ? I know it's a large question haha but i hope you can get me in a good direction to research on the event system.
     
  30. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Gotchya, indeed that makes sense.

    Ok thanks, I'll try to replicate the behaviour to see what's up with that thread lock.
     
    mcmorry likes this.
  31. failman

    failman

    Joined:
    Sep 11, 2014
    Posts:
    23
    Hi everyone! So I've been banging my head on this problem. I have a particle system that toggles emission on a gameplay event. The system's emission is looped. When the emission is toggled ON for the first time, the particles begin to smoothly appear. When the emission is toggled OFF and then ON again, the particles appear instantly. How can I restart a looped system or make a smooth fade-in? The particle mask won't help as I have only 3 particles at most. Thanks!

    Example
     
    Last edited: Feb 27, 2016
  32. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi @Jotunn,
    Thanks for the details! Indeed using local simulation space on an external source will not counter for updated rotations but rather handle repositioning (Advanced > Movement Compensation). Previously this was not looked over due to my own limited knowledge and that it has to run through the threaded routines (where handy things like InverseTransformPoint can't run and shouldn't due to optimisation reasons), but I think today there could be better implementations of things like this. I'll add this to the todo to have rotations accounted for as well in an update!
     
  33. Jotunn

    Jotunn

    Joined:
    Jan 10, 2014
    Posts:
    22
    Thanks @save for the reply.
    If local simulation space works on external source, I can create effects more efficently.
    Great to hear this is added to the todo.
    Thank you !
     
  34. Jackrabbit82

    Jackrabbit82

    Joined:
    Mar 13, 2013
    Posts:
    12
    Hi save I'm struggling with a little thing and maybe someone found a work around for it, but i'm looking for a way to emit particles by distance like in shuriken. My emitter is following a really fast object and it seems like i can't spawn enough particles to fill the gaps between the emission, also performance wise i don't want to emit like 10 times what i would really need. Any solution tips on this ? :) thx in advance !
     
  35. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    You can find an example how to script towards the event system in the example scene found in Examples/Example Scenes/Interactive/Event Listener. The script of interest is called PlaygroundEventListener.cs. You can also find out more in the manual on page 28 (Deeper Into Events chapter).
     
  36. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    This is connected to how lifetime along with its sorting is set at start of emission, this is something I'm looking into to improve. Till then you could have another go with the mask to fade based on emission:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class EnsureFade : MonoBehaviour {
    6.  
    7.     private PlaygroundParticlesC particles;
    8.  
    9.     void Start () {
    10.         particles = GetComponent<PlaygroundParticlesC>();
    11.         particles.particleMaskTime = 1f;
    12.     }
    13.    
    14.     void Update () {
    15.         particles.particleMask = particles.emit? 0 : particles.particleCount;          
    16.     }
    17. }
    18.  
     
  37. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hey! There are two general approaches to this. One is to use Advanced > Simulation Space: Local together with Movement Compensation and have a slack in Compensation Lifetime Strength (for example two keys where first key is X:0, Y:1 and second key is X:1, Y:0). What this generally does is transition between local to world space.

    The second approach is to emit by script to ensure any missed particle birth positions. There is an example of this called EmitOnTranslation.cs found in Examples/Example Scripts/Simple Scripts/. It will simply interpolate between the last frame's position to current frame's position and fill in the gap. It should give a good starting point at least for making something that works with the intended behaviour. In case you wouldn't have it here's a copy:

    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.  
    It would make sense to have this functionality out of the box as an option, but it would have to wait till there's a more sophisticated particle cache and lifetime sorting available. Hope it helps!
     
  38. Jackrabbit82

    Jackrabbit82

    Joined:
    Mar 13, 2013
    Posts:
    12
    Thx a lot ! sorry about that i haven't seen all those script example it's really cool i'll be able to tweak what i need with those ! :) Great package and great support ! You're a god mister !
     
  39. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Haha well great that it comes in handy! Just ask if you're looking for anything in particular.
     
  40. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    91
    Bug Report:
    I bought and just downloaded Particle Playground, and I am getting major errors on importing the package.

    Unity 5.3.2f1
    Particle Playground 3.0.3

    Console right after import: Screen Shot 2016-03-02 at 10.48.01 PM.png

    Settings window:
    Screen Shot 2016-03-02 at 10.47.28 PM.png


    Preset Wizard:
    Screen Shot 2016-03-02 at 10.47.40 PM.png

    :(
     
  41. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,913
    @fastgamedev - Not sure if this is the right fix, but maybe you need to switch Asset Serialization to "Mixed" and then re-import it?
     
  42. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    91
    @hopeful - That might be so, but we use git and need text serialization. All the other assets I've tried work fine with text serialization, is there some particular reason why Particle Playground can't handle it?

    I did update the garbage paths to correct ones in the settings, and reimported the Particle Playground folder (not the package, just the folder - this rebuilds the .meta files, but keeps the updated settings). Seems to be working now. But I am concerned that something else might have broken on that package import that I don't know about.
     
  43. BlankMauser

    BlankMauser

    Joined:
    Dec 10, 2013
    Posts:
    104
    Is there any way to make particles emit during lateupdate?
     
  44. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    480
    How do I pause/resume particles from script? I can't find anything like normal particle systems .Pause and .Play. There are lots of time and deltaTime variables but none of them are commented or are in the docs.
     
  45. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    The settings are stored in a Scriptable Object called Playground Settings in Playground Assets/Settings/ where the locations are plain strings, I'm not sure why it would ever convert those. I'm not sure if it is of any help but I had a similar support errand a couple of days ago where the user had copied the paths directly from Explorer which turned into the very same garbage strings. Did this happen on package import from the Unity Asset Store or a git pull?

    Either way error messages is not so welcoming. Misformatted strings should be addressed and give some sort of notification, I'll look into if I can add some layer of notification and help from within Playground.
     
  46. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    The calculations and emission procedure is called from LateUpdate, however if you run the calculations on a separate thread the routines are asynchronous from the Update loop. What you can try is setting your particle system to Advanced > Misc > Particle Thread Method: No Threads to sync the particles to the Update loop. What is it that you'd like to achieve?
     
  47. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    To pause a particle system you can set particleTimescale to 0.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using ParticlePlayground;
    4.  
    5. public class TogglePausePlay : MonoBehaviour {
    6.    
    7.     public PlaygroundParticlesC particles;
    8.  
    9.     void Update () {
    10.         if (Input.GetKeyDown(KeyCode.Space))
    11.             particles.particleTimescale = 1 - particles.particleTimescale;
    12.     }
    13. }
    14.  
     
  48. snlehton

    snlehton

    Joined:
    Jun 11, 2010
    Posts:
    95
    Hi, we're having problem with the trails. They're glitching for some reason, probably something to do with the reset of the particle. See the trail_glitch.gif

    The trails also leak meshes. When the game has been running a while, there's a lot of dynamic meshes around (about 1100 at the time of taking this screenshot) each taking 17.5KB). See the profiler shot.

    upload_2016-3-7_11-5-46.png

    I also noticed that spawning trails does not use any kind of caching, and is actually trashing memory quite bad.

    upload_2016-3-7_11-20-11.png

    What were doing is adding a trail per particle. There are 32 particles alive at the same time.

    Are we using PP in a way its not supposed to be used? Are the trails supposed to be used on just few (1-5) particles with long lifetime? Because anything more than that is just creating so much overhead.

    Also, why are there a mesh per trail? Shouldn't the trails of a single system be in one mesh? Or is there a reason for this?

    Cheers,
    Sampsa Lehtonen / Draconus Entertainment
     

    Attached Files:

  49. BlankMauser

    BlankMauser

    Joined:
    Dec 10, 2013
    Posts:
    104
    I was simply trying to make the particles spawn after the character's animation updated.

    Is it possible to emit particles through script? Is this something I would look at the shuriken API for? I would like to have particles emitted on a skinned mesh in bursts. So that it bursts an "After Image" effect every few frames.
     
  50. save

    save

    Joined:
    Nov 21, 2008
    Posts:
    744
    Hi Sampsa,
    Sorry about that. This is a known issue and I'm looking into it to have it massively improved in the next update. The structure should instead batch and reuse available instances. As you say the trails should preferably batch into one mesh or configurable group of meshes, also a feature coming up.