Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pooled particle count
#1
Hi there,
I am currently experimenting with runtime length modification (working great!)

However I don't yet know what the optimum number of pooled particles is. Setting to 1000 was more than enough, however I noticed that upon trying to reduce the count that the editor value does not seem to be used but rather the value that was cached upon initial initialization.

Re-initializing solves the problem, however, in doing so my handles (created via the editor) no longer function, requiring them to be re-created.

Is the pooled particle count not updating a bug? If not, is it necessary to re-init or am I missing some workflow steps? / Generally doing things wrong?

Thanks,
Chris
Reply
#2
(09-07-2019, 03:10 AM)chipmeisterc Wrote: Hi there,
I am currently experimenting with runtime length modification (working great!)

However I don't yet know what the optimum number of pooled particles is. Setting to 1000 was more than enough, however I noticed that upon trying to reduce the count that the editor value does not seem to be used but rather the value that was cached upon initial initialization.

Re-initializing solves the problem, however, in doing so my handles (created via the editor) no longer function, requiring them to be re-created.

Is the pooled particle count not updating a bug? If not, is it necessary to re-init or am I missing some workflow steps? / Generally doing things wrong?

Thanks,
Chris

Hi,

The particle pool, as the name implies, is allocated once at initialization time. After the rope has been initialized, the pool size cannot be changed except by re-initialization. You're supposed to create a pool big enough to cover your rope's maximum possible length, so that no particle allocation takes place at runtime.

Allocating/deallocating resources at runtime is a big no-no and should be avoided in Unity when possible, that's why a pool is used Sonrisa
Reply
#3
(09-07-2019, 10:46 AM)josemendez Wrote: Hi,

The particle pool, as the name implies, is allocated once at initialization time. After the rope has been initialized, the pool size cannot be changed except by re-initialization. You're supposed to create a pool big enough to cover your rope's maximum possible length, so that no particle allocation takes place at runtime.

Allocating/deallocating resources at runtime is a big no-no and should be avoided in Unity when possible, that's why a pool is used Sonrisa
Hi Jose,
Thanks for the reply -
Perhaps I should have been more clear.
I'm not looking to allocate more at runtime, what I'm trying to do is find the optimum pool size to use such that I'm not making unecessary allocations when I initially define my pool size. The trouble is, that the only way to test is at runtime by getting a feel for the current pool size vs length and the only way to then adjust is by reinitializing (in edit mode) which destroys my existing handle connections.

I guess the question therefore is - is there a way to reinitialize in the editor without breaking existing handle connections?
Reply
#4
(09-07-2019, 06:33 PM)chipmeisterc Wrote: Hi Jose,
Thanks for the reply -
Perhaps I should have been more clear.
I'm not looking to allocate more at runtime, what I'm trying to do is find the optimum pool size to use such that I'm not making unecessary allocations when I initially define my pool size. The trouble is, that the only way to test is at runtime by getting a feel for the current pool size vs length and the only way to then adjust is by reinitializing (in edit mode) which destroys my existing handle connections.

I guess the question therefore is - is there a way to reinitialize in the editor without breaking existing handle connections?

Hi,

Not currently, when you re-initialize the rope, all per-particle properties (including handle connections) are lost. We're working on a redesigned workflow that allows exactly this:
http://blog.virtualmethodstudio.com/2019...5-preview/
Reply