I'm working on a standalone game based on ioQuake3 and I've merged in the Tremulous particle and trail systems. Everything works great, except for the "fadeOutTime" parameter that allows trail systems that are attached to something at both ends to fade out over time ( http://tremmapping.pbwiki.com/Trail+System ).
I confirmed that this also didn't work in unmodified Tremulous, and went digging around in the code. I found that fadeOutTime depends on destroyTime being greater than zero, but trails with a >0 destroyTime never get populated with beam nodes. Also, the code where a vert's alpha is calculated based on lifetime and fadeOutTime is all integers, so you'll only ever see full or zero alpha.
I've created a patch with these changes... they work fine in my project, but I haven't tested them with Tremulous. Not sure if this would be considered a fix or merely an "enhancement" given that none of Tremulous's FX content (that I could find) makes use of fadeOutTime. Take it or leave it.
Forum topic that led me here: http://tremulous.net/forum/index.php?topic=8057.0
Just recently I discovered a bug that my last patch inadvertently caused, namely that trail systems didn't get garbage collected when their attached client entities. The new fix ended up being even simpler. Patch is attached.
I'm pretty sure that this patch started Stannum's new trail systems misbehaving. I don't want to just revert the patch because I think it fixes a legitimate bug, so I think there's something else going wrong.
As it stands, trails with a fadeOutTime just don't die. At all. This isn't hard to fix. The condition in the patch:
> + if( ( ts->destroyTime <= 0 ) || ( btb->fadeOutTime > 0 ) )
should probably be something like:
> + if( ts->destroyTime <= 0 || ( cg.time - ts->destroyTime ) < btb->fadeOutTime )
But even with that change applied, I still don't observe any actual fading. It looks like the alpha parameter on the trailBeamNode is being set correctly, but in-game there is no visible effect.
Created attachment 1756 [details] patch for cgame/cg_trails.c
Comment on attachment 1756 [details] patch for cgame/cg_trails.c This patch causes another bug, obsoleted.
Created attachment 1772 [details] updated patch with fixed fadeOutTime and proper garbage collection for single-attachment trails.