Extend particle lifetime to beyond 32768.
Moderator: GZDoom Developers
Extend particle lifetime to beyond 32768.
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.
- 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.
Come to think of it, aren't those particles removed similarly to the corpse queue when the threshold is reached?
Re: Extend particle lifetime to beyond 32768.
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.
Re: Extend particle lifetime to beyond 32768.
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.
But this limit has nothing to do with their time to live. It’s stored in short variable indeed.
Re: Extend particle lifetime to beyond 32768.
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)
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)
Re: Extend particle lifetime to beyond 32768.
Thank you for this.
Re: Extend particle lifetime to beyond 32768.
How can I say no to a man in a santa hat with a candy cane?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Extend particle lifetime to beyond 32768.
I wonder how many other such 'shorts' still exist in ZDoom. This was a very unfortunate consequence of typical 90's space saving methods.
- drfrag
- Vintage GZDoom Developer
- Posts: 3141
- Joined: Fri Apr 23, 2004 3:51 am
- Location: Spain
- Contact:
Re: Extend particle lifetime to beyond 32768.
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Extend particle lifetime to beyond 32768.
I guess that happens if you work with a 'space optimized' data structure and don't subconsciously want to whack it.