Author Topic: "$Ship Death Effect:" not working  (Read 544 times)

0 Members and 1 Guest are viewing this topic.

Offline Nightmare

  • 210
"$Ship Death Effect:" not working
I've been playing with the Particle Effect from the wiki ( http://wiki.hard-light.net/index.php/Particle_Effects ), trying to work around the issues I had with the Death flash script (lag, not working on debug builts) and the description of "$Ship Death Effect:" ( http://wiki.hard-light.net/index.php/Ships.tbl#.24Ship_Death_Effect: ) seemed just to fullfill all my needs. When I used it however, the effect that worked with the script did not show up, not matter what I did.

First I've tried something that equals the description on the wiki:

Code: [Select]
#Particle Effects
$Effect: TestTest
$Type: Single
+Filename: ExpFlashBlue
+Size: (19000)
#End

After that didn't worked I also took a look at the JAD table, but it did not work either. (I did a couple more attempts, but neither worked).

Code: [Select]
#Particle Effects
$Effect: TestTest
$Type: Single
+Filename: ExpFlashBlue
+Size: (19000)
+Lifetime: (1000)
+Duration: Always
#End

The only thing there was in the Debug log is following:

Quote
TBM  =>  Starting parse of 'ExploNew-part.tbm' ...
BMPMAN: Found EFF (ExpFlashBlue.eff) with 39 frames at 10 fps.

Any thoughts?
« Last Edit: July 15, 2018, 12:45:35 pm by Nightmare »

 

Offline Nightmare

  • 210
Re: "$Ship Death Effect:" not working
OK, I've managed to find the problem- apparently $Ship Death Effect: is simply not working. I used the same TestTest particle effect as weapon impact, and it worked properly. One thing I've noticed though, is that the quality of the effect is extreme low, as if the resolution of the effect used (1024*1024 png) would've been just 64*64 pcx files. In case somebody wants to fix this someday, would it be possible to have them in full quality (or atleast, higher)?

 

Offline m!m

  • 211
Re: "$Ship Death Effect:" not working
 :banghead:

Quick test, try to add a dummy effect before your real particle effect. That should fix it. This is another instance of stuff not working because a single character is missing. While I'm working on the particle code I might as well fix this by using a better type for these handles...

EDIT: This should fix the death effect: https://github.com/scp-fs2open/fs2open.github.com/pull/1797
« Last Edit: July 15, 2018, 01:23:20 pm by m!m »

 

Offline Nightmare

  • 210
Re: "$Ship Death Effect:" not working
Ah, OK thank you! :) :yes:

Maybe you could link the detail level to "+Size:" of the particle effect? I like the idea of having some sort of native "Death flash" rather than the scripted one, but it looks horibble underdetailed (I can add pics if required).
« Last Edit: July 15, 2018, 01:39:00 pm by Nightmare »

 

Offline Nightmare

  • 210
Re: "$Ship Death Effect:" not working
I've got another problem. I'm using following code:

Code: [Select]
$Effect: Hecate
$Type: Composite
+Child effect: $New Effect
$Type: Cone
+Filename: CapFlash
+Size: (15)
+Lifetime: (4)
+Deviation: 180
+Velocity: (500)
+Number: (1)
+Direction: Reflected
+Trail effect: $New Effect
$Type: Single
+Filename: exp20
+Size: (150)
+Lifetime: (6)
+Duration: Always
+Duration: (4)
+Delay: (2)
+Child effect: $New Effect
$Type: Cone
+Filename: CapFlash
+Size: (15)
+Lifetime: (4)
+Deviation: 180
+Velocity: (1250)
+Number: (1)
+Direction: Reflected
+Trail effect: $New Effect
$Type: Single
+Filename: exp20
+Size: (150)
+Lifetime: (4)
+Duration: Always
+Duration: (4)
+Delay: (2)

As far as I understood the wiki, I should be seeing 2 effects, each with a particle trail; with effect generation starting 2 seconds after the effect is triggered (i.e. ship destroyed) and last for 4 seconds. The delay works as far as I can see this, but the engine creates about 2 dozen effects from this, and every number larger than 2 entered in "+Number:" will cause FPS to drop below 10.

 

Offline m!m

  • 211
Re: "$Ship Death Effect:" not working
Do you have a test mod I could test this with? That would make it much easier to reproduce and fix this bug.

 

Offline Nightmare

  • 210
Re: "$Ship Death Effect:" not working
I've noticed another thing- while using these tables with my mod, they create a sphere, but when I'm using the isolated files they always only produce a forward cone, even though I use exactly stats. It's still a forward-only cone if I set "deviation" to 360. The problem with the number of generated effects is the same, however.

 

Offline m!m

  • 211
Re: "$Ship Death Effect:" not working
Thank you very much! That will help me immensely. I can reproduce the bug so I'll investigate what is going wrong here.

 

Offline Nightmare

  • 210
Re: "$Ship Death Effect:" not working
Thanks for your efforts! :)

One thing that I forgot to say - I'm wondering that I have to specify "+Duration" 2 times in a row. As it's only a optional field, I don't understand how the game can distinguish whether it was relating to the main effect or the particle trail if only one is specified.

 

Offline m!m

  • 211
Re: "$Ship Death Effect:" not working
When the engine parses a $New Effect construct it consumes all the options that are possible for that effect. So, when the engine is at line 18 of your file it is currently in the process of parsing a "Single" type effect. "+Duration" is a valid option for that so it will use that if it exists. If you specify that in line 18 (regardless of indentation) then the engine will not be intelligent enough to figure out that you may want to specifcy that for the "Cone" effect.

That is actually a bug in the parsing code since such ambiguities should be avoided when writing such code. I will have to do something clever here to avoid breaking old tables but I will move the +Trail effect: to the end of the list which will fix that ambiguity.

 

Offline m!m

  • 211
Re: "$Ship Death Effect:" not working
So, I figured out what is wrong here. If you specify a duration for an effect that means that for that time new particles of this effect are generated. So, with your config the engine would try to create effects for 4 seconds after the delay. That gets cut down to a lot less since the host of the effect (the ship) is invalid shortly thereafter but there are still a few frames in which the engine will create new particles with particle trails.

So, if you want to only create very few particles you should specify a very short duration for the Cone effects. You can't use "Onetime" though since that only works if you don't specify a delay.

Even though I think the described issue is a configuration issue you still found some issues that I improved upon so I'll submit a pull request with those changes soon.

 

Offline Nightmare

  • 210
Re: "$Ship Death Effect:" not working
So +Number is not good for handling how many effects are being created? I hoped that  if I set +Number to, say, 60 and duration to 4 that 15 effects are being created per second. Would it be possible to implement something like that in in the future, possibly through a new option? It would make the effect easier to specify, as it seems to be a guessing game right now (one that is a bit hard to solve, for me at least).

 

Offline m!m

  • 211
Re: "$Ship Death Effect:" not working
No, that is not how +Number works. That specifies how many particles are created per frame.

A "particles per second" specifier would be interesting but I'll have to think about how such an option could be implemented in this system since the system is specifically designed to that sources do not have effect type specific data in them so I'll have to figure out a generic way of producing a consistent number of particles per frame even if the frame rate is very high or very low.

 

Offline Nightmare

  • 210
Re: "$Ship Death Effect:" not working
OK I didn't knew that, the only thing the wiki told me about +Number: was

Quote
Sets the amount of created particles.

 

Offline m!m

  • 211
Re: "$Ship Death Effect:" not working
Yes, that's pretty vague. I changed it to be more precise.