Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Legacy Particle System deprecation

Discussion in 'General Graphics' started by superpig, Aug 1, 2016.

  1. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    Greetings,

    In Unity 5.4, we have finally begun the process of removing the Legacy Particle System from Unity.

    The Legacy Particle System classes (ParticleEmitter, ParticleAnimator, ParticleRenderer, etc) have been marked as [Obsolete] in the API, and using them in the Inspector will now display a warning message. We have also begun work on reducing the number of packages in the Asset Store which are using the Legacy Particle System.

    If your project is still using the Legacy Particle System, you should upgrade your effects to use the newer ParticleSystem component soon. (We're exploring whether we can create some kind of automatic upgrader tool, but we cannot promise anything).

    If you're using the Legacy Particle System via packages that you obtained from the Asset Store, we recommend monitoring the store for new versions of your packages. We will be encouraging Asset Store authors who have Legacy particle effect packages to update their effects as soon as they can.

    We don't have a fixed date for when the Legacy Particle System will be removed; instead we're going to monitor how widely it is still being used, and try to wait until that's dropped to a sufficiently low level. (But we're not going to wait forever).

    A lot of effort has gone into improving the new ParticleSystem over recent Unity 5 releases - through removing limitations such as the lack of API for system properties, through new features such as the Trigger module in 5.4, and through general performance optimizations such as multithreading support. At this point we believe there is nothing you can do with the Legacy Particle System that you cannot also do with the new ParticleSystem. But, we never know about all the use cases out there. If you're currently using the Legacy Particle System and cannot upgrade to the new ParticleSystem component because of technical limitations, please reply to this thread and explain what's blocking you.
     
  2. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    It's about time guys, correct me but Shuriken is available since Unity 4, it's about like, 20 years ago? :D
    Keep moving forward !
     
    dadude123 and richardkettlewell like this.
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    You asked to be corrected, so...

    Shuriken was available in Unity 3.5
     
    idurvesh likes this.
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Same will happen to legacy animation at some point I guess? No surprises there :)
     
    LaneFox likes this.
  5. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,015
    If Unity offered a tool to automatically convert existing legacy particle systems to Shuriken systems, then I bet most people would be pretty happy about it. I am guessing that the people still using the legacy particle systems are doing so simply because that is what they initially set some of their prefabs to use. I cannot think of any reason to actively choose legacy particle systems over Shuriken at this point.
     
  6. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    That could be a dark day, comparable to the loss of Beast...
     
    drawcode and ZJP like this.
  7. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    You're right, I'm getting old...I'm using Unity since the version 2.6 (like many of us I guess?)
     
    idurvesh and AcidArrow like this.
  8. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    The sooner legacy animation disappears the better it will be for every model asset and buyer on the store.
     
    theANMATOR2b likes this.
  9. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    If it's not broke, why remove it?
     
  10. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    Because keeping it not-broke takes effort on our part that we'd rather spend on making the newer (faster, more capable) particle system better.

    Also, it's confusing for new users to have two different incompatible particle systems in Unity.
     
  11. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    That's fair enough. If you can't get an auto-converter working, would there be any pointers in how to go about converting any you have from the legacy to the new system? Sort of a "these settings in the legacy system correspond to these settings in this module and that module in the shuriken system"

    I have very little experience in the particle systems, either legacy or shuriken, other than accessing them via code to switch them on/off as required. :)
     
  12. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    Not a bad idea. I'll run it by the relevant people to see if we can add some kind of 'migration guide' or similar to the docs.
     
    rippag likes this.
  13. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    imo at some point if you want to keep working on old stuff, you will have to live with previous versions of Unity, that's it.
    The way UT is handling obsolete part of their engine is one the best solution for their users.
     
    theANMATOR2b likes this.
  14. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    But a potential disaster for anyone that needs full code control over animation playback and loading...

    There's things I've done with legacy anims that just weren't possible with Mecanim. Something as simple as resetting an animation controller (e.g. for reusing prefab instances when object pooling) was impossible not so long ago. And loading an anim clip from resources and assigning it to a Mecanim state was impossible last time I tried.

    I've also written tools that could display animations in editor mode, by setting the exact anim times and blend state, and using Animation.Sample - couldn't see any way to do the equivalent via Mecanim at the time.

    If the old animation data format is removed, that's probably great - but I don't think we can afford to lose that more direct control over loading and playback of animations that the Animation component gives. And while Mecanim in principle is great for main characters with lots of anims/transitions, setting up a new animation controller for every little 'door opens' or 'UI bounce+spin' animation seems kind of overkill, and additional work.

    (Sorry, this was rather off-topic... losing legacy particles doesn't affect me - but losing Beast hurt. The year of broken lightprobes. So losing legacy animation is a scary prospect, given that my Mecanim experiences so far have been fairly mixed)
     
    drawcode likes this.
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You might want to check out playables api, it should mirror the functionality as far as I've checked. As it eventually will go (it is depreciated after all), you should be moving to it as the day will come when you don't have the choice (same for all depreciated stuff I guess).
     
  16. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    Regarding animation: yes, we will eventually begin to deprecate it in the same way that we're deprecating the legacy particles (the particles are acting as a sort of 'pilot programme' for doing this stuff). But we're not going to do it while there is still a significant gap in use cases covered and in usability.

    That said, @hippocoder is right: a lot of the things people want to do with the legacy animation system, they can actually do with the Playables API - to the point that you can more-or-less build your own version of the Animation component on top of Playables if you want. I'd definitely recommend checking out what can be done with it.
     
  17. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    ( *cough* Beast, Enlighten? :p )

    But anyway, I'm all for deprecating the legacy particles. I recently went and switched a few particle effects we still had that used the old system and I didn't find any trouble replicating the effects.
     
  18. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Well...most of the time :D
     
    AcidArrow likes this.
  19. 3dorange

    3dorange

    Joined:
    Aug 25, 2011
    Posts:
    3
    Hello.
    Particle.color is now marked as Obsolete. But I need to change color property of the individual particle not changing other's particles properties. What should I do to make it right now? (the same for size of particle for example)
     
  20. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    You should use the Particle struct which is nested inside the ParticleSystem class, instead of the one that is at the top level of UnityEngine.
     
  21. WhendricSo

    WhendricSo

    Joined:
    Jan 1, 2011
    Posts:
    171
    I like being able to create new animations in the editor. I hope you're not planning on removing that because it's really useful!
     
  22. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    Nope, that capability is not going anywhere :)
     
    NeatWolf and theANMATOR2b like this.
  23. WhendricSo

    WhendricSo

    Joined:
    Jan 1, 2011
    Posts:
    171
    Awesome, it's one of my favorite features. In fact I wrote an article on GamaSutra about it awhile back because I wanted other people to know that the editor has this amazing animation system built into it. I had a lot of clients that were animating all of the objects in 3DS and some of them were very frustrated with the workflow for that so I am glad that it's a priority :)
     
  24. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    I'm still using the legacy animation system. :'( Mind you I'm also still using Unity 4.7.
     
  25. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Care to share the link to the article? Searching Gamasutra I came up with bupkis! :)
     
  26. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    353
    Alverik and theANMATOR2b like this.
  27. testure

    testure

    Joined:
    Jul 3, 2011
    Posts:
    81
    Actually, the animation window is actually getting some improvements in the next couple of versions. One of the Unite talks back in July went over a lot of the stuff they're adding.. IE) keyframe scaling, etc.

    My guess is that it all ties into Sequencer eventually, so they need to keep it relatively cutting edge.
     
  28. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    I think you're actually referring to Shuriken, and not the Legacy Particle System, with this question?

    We renamed that property to startColor (and startSize) to resolve an ambiguity - it was getting/setting only the start color of the particle, not the current color (i.e. not factoring in Color Modules), so the new name is better.

    This is the script warning we display for you:
    color property is deprecated. Use startColor or GetCurrentColor() instead.
    The new GetCurrentColor() method will evaluate the color curves to calculate the current color based on the age of the particle, if you need it. Otherwise, you can set the initial particle color using startColor.

    Hope this helps!
     
    theANMATOR2b and karl_jones like this.
  29. zombox

    zombox

    Joined:
    Aug 10, 2011
    Posts:
    119
    Last time I tested Shuriken (a few Unity versions ago), it was slower than legacy particles and certain equivalent functions generated garbage.

    Is Shuriken fairly garbage-free at this point? How does the speed compare? I use legacy particles all over my mobile projects, where every millisecond of performance counts. Hearing that they'll be deprecated is a pretty massive blow, if they don't yet have fully equivalent functionality/speed of legacy...
     
  30. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    As far as we're aware, it's both faster and garbage-free. If you disagree with that, you'll need to show us example situations so we can investigate - best thing to do is file them via the bug reporter.
     
    Alverik likes this.
  31. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    As Richard says, as far as we know we are garbage-free in Shuriken where we should be.
    There were specific fixes made to functions such as IsPlaying, IsAlive etc for 5.4 (or maybe 5.3, I can't recall), which were generating garbage due to internal for-each loops.

    Speed should be comparable-or-faster in all cases. Plus, if your target hardware has many cores, then Shuriken should win decisively.

    If you can prove us wrong, we will definitely look at any examples you can provide :)
     
    Alverik likes this.
  32. zombox

    zombox

    Joined:
    Aug 10, 2011
    Posts:
    119
    Great, sounds like it's time to upgrade then :)
     
    Alverik likes this.
  33. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Shuriken has been a massive improvement from the legacy particles for my uses, though as others are saying it would be a shame to see legacy animation leave right now. Totally forgot about the Playables API, it looked useful in the introduction talk and could fill the gap missing from Legacy Anim, but I haven't seen much else about it.

    Will there be more examples/tutorials/documentation on Playables before legacy animation is deprecated?
     
  34. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521

    Please keep in mind that not all people who work with animation can program, so if any old features are removed, they should ideally be auto converted to the new version that can do the equivalent.
     
    theANMATOR2b and SomeGuy22 like this.
  35. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Second +1 for personal reasons.
    Although Ive found (with limited fx work) very few instances where Shuriken has come up short.
     
  36. Soledev

    Soledev

    Joined:
    Feb 18, 2015
    Posts:
    3
    Haven't tried 5.5 Shuriken update yet but would be cool if particles had unique id. The id would change when the particle dies/respawns. Would be possible to know which particle is which when controlling them by script. And could link some metadata to them with the id.
     
  37. the_Bad_Brad

    the_Bad_Brad

    Joined:
    Nov 2, 2014
    Posts:
    278
    An automatic upgrade tool would be much appreciated because we are a small team and I have to do triple duty as a scripter, 3d modeler and a music composer lmao.
     
  38. zombox

    zombox

    Joined:
    Aug 10, 2011
    Posts:
    119
    Just wanted to report back that I converted 100+ legacy particles system to Shuriken in my current game, and despite the task being fairly time consuming (I wrote an auto-converter to speed up the process but not everything translates nicely), I am now much happier with how Shuriken is working, and am really appreciating all the extra options and customizations it offers. Definitely glad I made the switch!
     
    richardkettlewell and hippocoder like this.
  39. psychentist

    psychentist

    Joined:
    Apr 12, 2009
    Posts:
    75
    -_-
    So I'm just coming back after a few months away from Unity, and it looks like I have to recode a few thousand lines across dozens of projects, and rebuild hundreds of particle emitters...
    I get that these are improvements, but as an indy developer with literally no one helping me, being slammed with six hundred man hours of mandatory update work across every game project is not a good feeling.
    Please stop doing this to the little guy. I hate to be the one who points out the negatives, but you guys really need to be bringing these auto updates along if you're going to force the new protocols on us. Not everybody has a team of programmers at their disposal, and for a lot of us, that's why we came to Unity in the first place.
    I really hope I don't wake up one morning to discover I have to recreate every single animation.
     
  40. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Unity do what they can with script updating where possible. It's recommended you go from version to version rather than a giant leap if upgrading a (very) old project.

    I recently updated a 3.5x project which was relatively simple. I made sure to from 3.x to 4.x then to 5, fixing issues as I went, and it took 30 mins for 15,000 lines of code - ie not much. This is a full game as well.

    Also, IMHO I would rather see progress with engines. You don't necessarily have to upgrade.
     
    KyleOlsen, Corvwyn and theANMATOR2b like this.
  41. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Unity does not have to break anything, they have enough manpower to make an autoupgrade to a new api.

    Can you imagine the uproar if adobe photoshop files could not be read in a newer version? this is the same kind of situation.

    Nobody whats to stop progress, just
    make the progress seamless. its better that unity spends more time to autoupgrade things they brake rather than let every developer spend time.

    lets say unity spends 100 hours to fix this, now muliply this number to the million developers unity has, then you have a figure how much time unity could save its userbase.

    it's not a small number
     
    Last edited: Nov 8, 2016
  42. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    Care to share the code? :)
     
    richardkettlewell likes this.
  43. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Good, I am glad we are getting rid of it... never liked it to be honest. Shuriken is very easy to use...
     
    richardkettlewell likes this.
  44. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    I did not update Unity for a while (5.2.4f), are all Shuriken bugs ironed out in the newer versions? Since there were objective reasons to use Legacy system over it. For example, if the Shuriken emission had been disabled while off camera, all particles belonging to it just disappear even if their lifetime wasnt over. Legacy particles treated this situation properly.
     
  45. ifurkend

    ifurkend

    Joined:
    Sep 4, 2012
    Posts:
    350
    @karl_jones' blog post may have an answer for you.
     
    karl_jones and richardkettlewell like this.
  46. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    So by the looks of it, it is intended behavior, and legacy emitter did not display it because it isnt fully "procedural" and can not be culled. Okay that answers my question. Shame that the culling can be only disabled by indirect means when it is not needed.
     
  47. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    Hi all,

    Periodically, changes and improvements to the core parts of Unity require that existing systems are upgraded to work correctly. This is an ongoing maintenance overhead, and for legacy components, we would rather be investing that developer time on more important work. When these changes come around, it forces us to reconsider when to remove support for a legacy feature. You'll see other examples of this from time to time, such as https://blogs.unity3d.com/2017/07/10/deprecating-directx-9/ and https://blogs.unity3d.com/2017/08/11/unityscripts-long-ride-off-into-the-sunset/.

    Right now, we are changing how Unity exposes its scripting API. It is purely an internal engine change (no user-facing changes), but brings many benefits for the future, and requires that we update all our existing script bindings in the engine.

    As part of this, we have decided not to update the script bindings for the Legacy Particle System, and, as a result, 2018.1 will remove support for interacting with Legacy Particle Systems via script.

    This is a first step to completely removing Legacy Particles.
     
    hippocoder likes this.
  48. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    I understand, will there be an auto conversion to the new system?
     
  49. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    Currently we don't have anything planned for that.
     
  50. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    So you think all the projects using legacy particle systems will be fixed by using the artist and programmers time for each project, that is gonna be a lot of hours.

    I dont mind removing old stuff, just don't let it break anything please.