Extend particle lifetime to beyond 32768.

Moderator: GZDoom Developers

Post Reply
Accensus
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Extend particle lifetime to beyond 32768.

Post by Accensus »

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
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Extend particle lifetime to beyond 32768.

Post by Major Cooke »

Come to think of it, aren't those particles removed similarly to the corpse queue when the threshold is reached?
User avatar
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Extend particle lifetime to beyond 32768.

Post by Rachael »

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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Extend particle lifetime to beyond 32768.

Post by _mental_ »

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.
User avatar
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Extend particle lifetime to beyond 32768.

Post by Rachael »

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)
Accensus
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Re: Extend particle lifetime to beyond 32768.

Post by Accensus »

Thank you for this.
User avatar
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Extend particle lifetime to beyond 32768.

Post by Rachael »

How can I say no to a man in a santa hat with a candy cane? :P
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Extend particle lifetime to beyond 32768.

Post by Graf Zahl »

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
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Extend particle lifetime to beyond 32768.

Post by drfrag »

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Extend particle lifetime to beyond 32768.

Post by Graf Zahl »

I guess that happens if you work with a 'space optimized' data structure and don't subconsciously want to whack it. :mrgreen:
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”