Hack Request: Emitter-Particle Death Timer
-
I know you’ve been doing all sorts of crazy stuff adoxa, and people are really starting to ask a lot of you so don’t give this too much priority as it is mostly a graphics effects thing.
This is a somewhat complicated issue that I don’t know if it can be solved through a simple hex edit, but considering adoxa solved the capital ship turret turning problem like it was nothing, maybe there is hope.
One of my longtime goals of in FL was to create long missile trails that were reminiscent of Ace Combat 6.
This was actually the primary reason I picked up effects editing. I succeeded in doing what I wanted but I ran into one very annoying issue. All particles are destroyed exactly one second after their parent emitter died, regardless of what that particle was supposed to be doing in the meantime.
This creates the ugly effect of the long arcing missile trails abruptly diappearing once the missile is destroyed. I’ve tried every manner of workaround to the solution and to this day still do not have a workaround. The issue lies in the fact that when the missile is destroyed, the emitter is destroyed, which destroys the particles after one second.
The fact that the particles actually do survive one second after the emitter’s death leads me to believe that perhaps some sort of timer was actually built into the code. I’ve seen other implementation of particle systems in which particles are simply destroyed when the parent is, which is far simpler to code than having them stay behind for one second.
Help me adoxa, you’re my only hope.
-
I would love such a fix too.
-
That was quite a challenge
Freelancer.exe, 0xF86A3, 1.0f = Time in seconds for particle effects to stay after emitter died. ~ w0dk4
I think if you set this to 0, the effect will be played until it’s finished, but not sure about that (could also cause a memory leak). I wanted to test with setting it to 0, but the trail effect did not vanish instantly, setting it to 0.1 it does though.
-
w0dk4 wrote:
That was quite a challengeFreelancer.exe, 0xF86A3 1.0f - Time in seconds for particle effects to stay after emitter died.
I think if you set this to 0, the effect will be played until it’s finished, but not sure about that (could also cause a memory leak). I wanted to test with setting it to 0, but the trail effect did not vanish instantly, setting it to 0.1 it does though.
How did you find that? There’s got to be a billion 1.0f in the entire exe.
Be right back, playing Itano Circus again…
-
How did you find that? There’s got to be a billion 1.0f in the entire exe.
Be right back, playing Itano Circus again…
Debugging… a lot of debugging
But it was interesting. I already had a rough idea of how effects are handled (the main work is done in alchemy.dll, by breakpointing there when memory is freed you can backtrace to where the actual effect is destroyed).
-
Thank you so much w0dk4, you have no idea how thankful I am to finally be able to do this.
With this newfound knowledge I went back and edited some of my old missiles, also adding some new tricks and ideas I had picked up since then. The smoke and fire now get larger the further away they are, making them much easier to see at a distance. On top of that, I’ve also done some tweaking to make them “Robotechier.” Due to the way Freelancer does missiles, this has the great side effect of the missiles leaving fantastic trails when they fly off into nowhere.
-
Did you measure the fps? This costs a lot of fillrate and even newer graphics cards did not advance much at this, but rather in vertex processing power (since the number of texture units did not increase much).
-
Schmack, I think you underestimate how many particles new games spawn. I’ve easily put out four or five times the number of normal particles with no impact, even on slower machines.
Gisteron, edit the caps in dacom.ini.
-
Well we already had video lag as we used very particle intensive effects for torpedo trails in our mod. It is not an easy thing to guess how a system will be affected, since it depends very much on the gpu abilities and the scene which gets rendered. I also doubt that Freelancer renders as efficient as today’s games. Some reading on this topic for the interested you can find here.
Of course, if there is a trick how to reduce video lag introduced through effects I would very much like to know it.
-
All I can tell you is that in actual use cases, the impact seems pretty low overall. Technicalities don’t amount to much if they don’t reflect the real end result.
Of course there’s also the matter of efficiency. With some good design, two similar effects can have wildly different particle counts
-
Well that sounds like a fillrate problem. It should become more problematic the more the screen is covered. I have also experienced performance problems with very large effects which cover the screen from even some K away. But there could also be other factors which play a role.
-
Forcing antialiasing with large particles is an instant show-stopper, even on extremely high-end graphics cards.
I could run FL in 1680x1050 on my old 8800GTX with I think 16x CSAA and it’d run silky smooth… except for when I was going in my custom jumpgate sequence, which uses lots of large particles you have to go through. No AA and it goes fine, but even 2x AA does it.
-
I have a pretty good card for running Freelancer. I also run Freelancer with 4X AA. Honestly I pretty much never experience a drop below 60fps, and if I create an effect that makes it drop below 60 then I tone it down. *
Note that this offset will not have any real effect on performance. Performance is entirely up to the effects themselves. In this case the only reason performance would be worse here is because I am drawing more particles on screen than I did before, regardless of their timing. In fact, this whole “particles disappearing after emitter dies” thing was the only reason my missile trails were as short as they were. The longer trails performed just fine. (The picture in my OP is from an old version of Itano Circus that had really long missile trails and suffered from the problem.)
I will say that there was one point when my fps did drop below a perfect 60 fps, so at least where I have it now it may cause some issues. However, I am running my old pre-optimized Itano Circus texture. Fox and m0tah recently greatly reduced the size of the texture that my missile sprites use, and both reported a significant fps gain on their part, and that was with the old effects.
On top of that, there are several versions of my effects floating around. The oldest, which I believe were posted in the old effects showcase thread, are greatly unoptimized compared to the most recent versions. The Big Huge Effects Pack contains all the versions that I used in Itano Circus. Those should be the most optimized ones. I cannot recall if I optimized them further after the release of Itano Circus/Effects Pack. If you want to be 100% sure that you have the latest (and most efficient) version of the effects I’ve made, rip them from 88 Flak.
For sure, the optimized texture is in 88 Flak only, but feel free to take that texture.txm file. That optimized texture was Fox and m0tah’s idea, so it came after the Effects Pack and Itano Circus.
*The only exception I made for this rule was the capital ship explosions in Itano Circus. While I still got perfectly fine framerates, it did drop below 60. They were rare enough that I made the exception.)
-
FriendlyFire wrote:
Forcing antialiasing with large particles is an instant show-stopper, even on extremely high-end graphics cards.I could run FL in 1680x1050 on my old 8800GTX with I think 16x CSAA and it’d run silky smooth… except for when I was going in my custom jumpgate sequence, which uses lots of large particles you have to go through. No AA and it goes fine, but even 2x AA does it.
That makes sense, because I read somewhere about problems with anti-aliasing and transparent textures.
I dont believe this is at all a fillrate problem (the fillrates of todays cards are 100 times higher than back at FLs release time).
-
Yes, that was what I gathered too, the problem is at its peak when your ship is going through large transparent sprites.