Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by DawdleDev · Mar 06, 2019 at 05:00 PM · performanceparticlesoptimizationefficiencyobjectpool

Particle System Optimization (.IsAlive but more efficient)

Hello,

I am currently making a game with a lot of particle systems that need to be in place to allow lots of entities to use them simultaneously. This means that there are about 500 particle emitters in total. I have them running from an object pool to reduce garbage collection, so I disable them after they finish running instead of using Destroy. However, I've run into a bit of a problem. Checking whether each particle effect is done every single frame is extremely slow. I have to disable them when they finish because otherwise they cause even more lag than checking every frame. So here's my question: How can I achieve the same effect without running .IsAlive in Update for each particle? As I said before, I am using object pooling, so I can't use Destroy (x time) on its creation. I could skip some frames for the .IsAlive checks, but I'm worried that this will only help a little because it's still running checks every frame (albeit much cheaper ones). I could also run the checks from an overhead script or something, but that would only help so much, and with such a large number of particles, it might be even slower to access their particle systems every frame. Is there a way I could use Unity's event system here to speed this up, or some equivalent system? Is it even possible to avoid this issue, or am I just going to have to design around it?

Thanks in advance, The Koala Squad.

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TreyH · Mar 06, 2019 at 07:13 PM 0
Share

Sounds like a good use case for the New Entity Component System.

avatar image DawdleDev TreyH · Mar 06, 2019 at 08:35 PM 1
Share

Thanks for the tip! I’ll test this out when I get the chance.

avatar image DawdleDev TreyH · Mar 09, 2019 at 03:49 AM 0
Share

I've spent a couple days learning how to use ECS and implementing it in place of the current systems, and I don't think it's going to work. Strangely enough, the ECS version actually runs slower than the normal version. $$anonymous$$aybe I'm just doing it wrong, and that would be reasonable enough, considering that this is the first time I've ever touched ECS. I tested it a little and recorded approximate FPS counts. The $$anonymous$$ax is with no particles being used, and the $$anonymous$$ is with most or all of them.

ECS System - 525 $$anonymous$$ax, 150 $$anonymous$$in. Normal System - 550 $$anonymous$$ax, 210 $$anonymous$$in.

Anyway, thanks for the help. It didn't work out for me, and I can't tell whether it's Unity's or $$anonymous$$e, but thanks anyway! At least I had an excuse to check out ECS for the first time.

avatar image TreyH DawdleDev · Mar 09, 2019 at 04:04 AM 0
Share

Oh too bad.


How many kinds of particles are there? Are the particles all unique, or are there multiple emitters for the same kind of particle?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by richardkettlewell · Apr 21, 2019 at 07:35 PM

How about https://docs.unity3d.com/ScriptReference/ParticleSystem.MainModule-stopAction.html ? (Can set via the Inspector or via script)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DawdleDev · Apr 21, 2019 at 09:22 PM 0
Share

That’s exactly what I needed! Thank you!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

128 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Optimize Particle Emitter with Massive # of Particles 0 Answers

Is shuriken well performing on iDevices? (iPhone, iPad) 1 Answer

If you're not using dynamic lighting, is there any performance benefit to turning off cast/receive shadows on shuriken particles? 0 Answers

What slows down my game? 1 Answer

Improving script performance 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges