Basically, I'm thinking that I'll do a very gentle change to the current FlameProjectile code, used for flamethrowers.
Right now, it's pretty cool- it uses Texture1, so we can actually have pretty nice-looking flames. However, I still think it can be improved more. Here's what I'm proposing to do.
After looking at the code, I think it would be very easy to have FlameProjectiles use RGBColor and RGBColor2. These two variables already have default values, so any WeaponProjectile can use them already, and not defining them won't cause problems.
Basically, here's what the current code for color, that changes it from almost-white to almost black red looks like. Forgive the paraphrasing- I'm at work, so I don't have the source in front of me:
Code: Select all
PSEUDOCODE
If TicksAlive<=33
Then Color = (1, 1, 0.8)
If TicksAlive>33 && TicksAlive <67
Then Color = (1, 0.5, 0.3)
If TicksAlive>=67
Then Color = (0.3, 0.1, 0)
What I'd like to do is make it like this:
Code: Select all
PSEUDOCODE
If TicksAlive<=33
Then Color = RGBColor
If TicksAlive>33 && TicksAlive <67
Then Color = ((RGBColor + RGBColor2) / 2)
If TicksAlive>=67
Then Color = RGBColor2
Why do I want this?
1. You could have a shotgun that acted true to physics, because the FlameProjectile already grows and has a hitsphere that grows also. It'd be simple- just make a graphic with alpha channel depicting the spray, and then don't do a lot of color-shifting between RGBColor and RGBColor2.
2. You could have "acid sprays", "freeze guns", and other things that need different colors than, er... fire.
3. If we ever get to the point where we can call these Projectiles as part of scripting events or custom ExplosionGenerators... hmm... we have a pretty decent particle spray-cone right here, waiting to happen. Blood, anybody? Oil spurting from ruptured hydraulics? Splashes of bright white metallic sparks? Hmm... yeah, that sounds good to me, too

4. If we simply stated a SizeGrowth of 0, or nearly 0(one of the new values we have to play with, specifically for FlameThrowers, and it's pwawesome) then we could have things like "plasma beams", where the shots changed color over time/distance but didn't change size much, if at all- or even... shrank! The value is a float, so I don't see why it couldn't shrink just offhand...
At any rate, I'm posting this here before I write a patch. This should be a very simple, lightweight addition to the current FlameProjectile code- it'll add just a couple more math steps. The variables are already there, and the values are already in memory (thank goodness for all that modder-friendly default value code!) so I do not foresee this will be a performance problem at all.
But there is one small hitch: all current mods using flamethrowers would need to set up RGBColor and RGBColor2, to still keep their flames looking "right". The default values for these things would look very weird. Is anybody really convinced that adding these two lines would be a big, hairy deal, or can I write this patch, show it working, and submit it to Spring's developers for commit- probably not in 0.73b, as it's technically a new feature, not a bugfix, but meh, we're talking teenie-weenie code here, for big results.