[Added] Extend particle lifetime to beyond 32768.

Moderators: Developers, ZDoom.org Team

Extend particle lifetime to beyond 32768.

Postby Lud » Wed Dec 06, 2017 9:12 pm

Currently the particle lifetime will overflow if you put in any number larger than 32768. The reason why I'm requesting this is that I'm using some long-lived particles for effects and 15 minutes is definitely not enough. A workaround would be to spam 1-tic-lifetime particles every tic, which I find quite a bad idea when there's 50 actors that do it.
User avatar
Lud
Pirates of the Somallean.
 
Joined: 11 Feb 2016
Location: Somalia

Re: Extend particle lifetime to beyond 32768.

Postby Major Cooke » Wed Dec 06, 2017 10:27 pm

Come to think of it, aren't those particles removed similarly to the corpse queue when the threshold is reached?
User avatar
Major Cooke
Slaughterer of Sewers
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Extend particle lifetime to beyond 32768.

Postby Rachael » Wed Dec 06, 2017 10:28 pm

I don't know, Major Cooke, I'd have to look into that, but I will say this - if that were the case I doubt he'd come to such an exact number.
User avatar
Rachael
QZDoom Project Lead + Webmaster
 
Joined: 13 Jan 2004

Re: Extend particle lifetime to beyond 32768.

Postby _mental_ » Thu Dec 07, 2017 1:13 am

Maximum number of simultaneously active particles is controlled by r_maxparticles CVAR.
But this limit has nothing to do with their time to live. It’s stored in short variable indeed.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Extend particle lifetime to beyond 32768.

Postby Rachael » Thu Dec 07, 2017 1:51 am

Yep. Both my suspicion based on Lud's accurate count, as well as _mental_ were right.

In particle_t, ttl is a short - so that's why particle lifespans were .... "short". I'm hoping it's just as simple as changing it to an int32_t - but I need something to test with to confirm this. (Nothing broke when I changed it, so I figured it safe to commit to master)
User avatar
Rachael
QZDoom Project Lead + Webmaster
 
Joined: 13 Jan 2004

Re: Extend particle lifetime to beyond 32768.

Postby Lud » Thu Dec 07, 2017 2:09 am

Thank you for this.
User avatar
Lud
Pirates of the Somallean.
 
Joined: 11 Feb 2016
Location: Somalia

Re: Extend particle lifetime to beyond 32768.

Postby Rachael » Thu Dec 07, 2017 2:31 am

How can I say no to a man in a santa hat with a candy cane? :P
User avatar
Rachael
QZDoom Project Lead + Webmaster
 
Joined: 13 Jan 2004

Re: Extend particle lifetime to beyond 32768.

Postby Graf Zahl » Thu Dec 07, 2017 2:58 am

I wonder how many other such 'shorts' still exist in ZDoom. This was a very unfortunate consequence of typical 90's space saving methods.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Extend particle lifetime to beyond 32768.

Postby drfrag » Thu Dec 07, 2017 7:18 am

Actually you changed it to short in a commit from 01/07/17 (widened ttl variable in particle_t to short to allow longer living particles than 6 seconds), before it was a BYTE. :) I've left it as pending for now BTW.
User avatar
drfrag
ZDoom32 developer.
 
Joined: 23 Apr 2004
Location: Spain

Re: Extend particle lifetime to beyond 32768.

Postby Graf Zahl » Thu Dec 07, 2017 7:29 am

I guess that happens if you work with a 'space optimized' data structure and don't subconsciously want to whack it. :mrgreen:
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Bing [Bot] and 2 guests