Author Topic: Particle effects - Cone not quite working right  (Read 2679 times)

0 Members and 1 Guest are viewing this topic.

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Particle effects - Cone not quite working right
Today I've been spending quite sometime learning how to wield the new Particle effects.
The wiki page documentation is... Well, let's just say that the formating could use some work on making things clearer for the end user. But through much trial and error, I more or less got an handle on it now, at least.

The issue I've run into though, is that the Cone effect only seems to work properly on laser impacts. Whenever cone is assigned to a beam impact, or a missile launch, the direction of the particles being spawned will always be sideways. And reverse will just make the particles spawn sideways to the other side.
So far I've had this happen while trying to use a Cone effect on $Freeflight Effect: and after much fiddling just resigned myself to using a bunch of Single effects instead. Because it just wouldn't spawn in any direction but sideways.

This for example, results in
Code: [Select]
$Effect: BreakerBeamImpact
$Type: Composite
+Child effect: $New Effect
$Type: Single
+Filename: flashexp
+Size: (30 35)
+Lifetime: (0.2)
+Child effect: $New Effect
$Type: Cone
+Filename: missilespew05
+Size: (0.65 0.75)
+Lifetime: (3.45)
+Deviation: 7
+Velocity: (150 175)
+Number: (2 4)
+Direction: Normal
+Child effect: $New Effect
$Type: Cone
+Filename: missilespew06
+Size: (0.65 0.75)
+Lifetime: (3.65)
+Deviation: 8
+Velocity: (125 150)
+Number: (2 3)
+Direction: Reverse
+Child effect: $New Effect
$Type: Cone
+Filename: missilespew03
+Size: (0.65 0.75)
+Lifetime: (4.00)
+Deviation: 5
+Velocity: (125 150)
+Number: (3 4)
+Direction: Normal

Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline m!m

  • 211
Re: Particle effects - Cone not quite working right
The issue with the beam impact seems to be caused by a missing particle source direction and that was easy to fix. For the weapon in-flight effect I'll have to create a test-case so that might take some more time until I can determine what's wrong there.

What could be improved in the wiki article? I did my best with the layout but I am not familiar with what an end user would expect from the documentation of this feature.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Particle effects - Cone not quite working right
The issue with the beam impact seems to be caused by a missing particle source direction and that was easy to fix. For the weapon in-flight effect I'll have to create a test-case so that might take some more time until I can determine what's wrong there.
  :yes:
You work quick (:

What could be improved in the wiki article? I did my best with the layout but I am not familiar with what an end user would expect from the documentation of this feature.
The primary issue when I look at the wiki page, is that I can't tell at a glance in what order everything goes. While I get the intention behind having links going to the Common syntax constructs. It makes everything really unclear and confusing at a glance, and makes it tedious when repeatedly having to look things up. Rather than having the links, It's much better to just repeat the information for each effect entry.
Also, there's no clear visible seperation between Single, Composite, Cone and Sphere (no spaces, or lines, or colors etc), it looks like its one big list, which adds to the confusion when trying to make sense of it as a first time reader.

I had to make my own list in a notepad so I could tell at a glance how many inputs Single, Cone and Sphere actually take. Since on the wiki page, I constantly have to scroll down and up and try to piece things together. Look at Ships.tbl and the Weapons.tbl wiki pages for example, the contents list has everything in the order that the game expects it in.
Code: [Select]
Single
 +Filename:
 +Size:
 +Lifetime:
 +Duration:
 +Delay:
 
Cone
 +Filename:
 +Size:
 +Lifetime:
 +Deviation:
 +Velocity:
 +Number:
 +Direction:
 +Trail effect:
 
Sphere
 +Filename:
 +Size:
 +Lifetime:
 +Velocity:
 +Number:
 +Direction:
 +Trail effect:

My notepad list after some puzzling and trial&error.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline m!m

  • 211
Re: Particle effects - Cone not quite working right
I tried to reproduce your missile issue and I did find an issue which caused the particle source to disappear after just one frame but I can't reproduce your issue where the particles would spawn sideways.

The primary issue when I look at the wiki page, is that I can't tell at a glance in what order everything goes. While I get the intention behind having links going to the Common syntax constructs. It makes everything really unclear and confusing at a glance, and makes it tedious when repeatedly having to look things up. Rather than having the links, It's much better to just repeat the information for each effect entry.
Also, there's no clear visible seperation between Single, Composite, Cone and Sphere (no spaces, or lines, or colors etc), it looks like its one big list, which adds to the confusion when trying to make sense of it as a first time reader.

I had to make my own list in a notepad so I could tell at a glance how many inputs Single, Cone and Sphere actually take. Since on the wiki page, I constantly have to scroll down and up and try to piece things together. Look at Ships.tbl and the Weapons.tbl wiki pages for example, the contents list has everything in the order that the game expects it in.

I guess I tried to optimize the size of that that page too much :p I'll fix that as soon as all these bugs are fixed. I have to build a test mission to check if the beam impacts are really fixed now but that shouldn't take too long.

EDIT: I found more bugs in the beam code and fixed those too. I have submitted the changes for code review: https://github.com/scp-fs2open/fs2open.github.com/pull/1493
« Last Edit: October 04, 2017, 03:55:12 am by m!m »

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Particle effects - Cone not quite working right
I neglected to mention that it was a missile launched by a turret, which is probably relevant information!

I guess I tried to optimize the size of that that page too much :p I'll fix that as soon as all these bugs are fixed. I have to build a test mission to check if the beam impacts are really fixed now but that shouldn't take too long.

EDIT: I found more bugs in the beam code and fixed those too. I have submitted the changes for code review: https://github.com/scp-fs2open/fs2open.github.com/pull/1493
  :yes:
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline m!m

  • 211
Re: Particle effects - Cone not quite working right
Ok, I can reproduce the issue now and the only reason I didn't see the issue before was that the ship I fired the missile from was pointing along the z-axis which is also the direction the bugged particles travel on by default :banghead:

EDIT: I think I fixed the missile issue as well now. The changes are in the same PR as the other fixes.
« Last Edit: October 04, 2017, 09:01:25 am by m!m »

 

Offline m!m

  • 211
Re: Particle effects - Cone not quite working right
I overhauled the documentation based on the comments in this thread: http://www.hard-light.net/wiki/index.php/Particle_Effects
I also added a few clarifications to how the syntax of uniform ranges works and added an explanation for when Normal is not a valid source direction.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Particle effects - Cone not quite working right
Much better! Nice job  :yes: :yes:
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Particle effects - Cone not quite working right
One other thing I ran into, this time regarding trails. Would it be possible to add an option for the trails to behave like missile trails/engine contrails etc?

Because when you add a missile trail as an effect currently, it looks like this:
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline m!m

  • 211
Re: Particle effects - Cone not quite working right
I'll have to look into how the engine handles trail rendering and management. In any case, you shouldn't use trail bitmaps for particles since particles have no "direction" which means that the engine has no way of rendering them properly.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Particle effects - Cone not quite working right
Ah, I was afraid of that ):
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them