Jump to content
The Dark Mod Forums

particle request: candle smoke


Recommended Posts

Gravity effects the particles fine (they go upwards regardless of what direction the emitter is facing). The problem is that the offset value is not aligned to world gravity, so a particle that has an offset of 8 is 8 units away from the emitter in whatever direction the emitter is facing, irrespective of gravity. Is there a way to make the "offset" value respect world gravity?

Link to post
Share on other sites
  • Replies 112
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

I haven't quite got an answer to testing it on a candle yet, but I've done some research.   There's a single "emitter" for the entire map, so that's why it's always considered to be in view. The emitt

Ok, I'm an idiot. The elegant solution is obvious. Wish I hadn't spent 2 hours thinking aloud in the thread now!   The above suggestions were concerned with how to find the right place in the sequenc

Looking better. Proper fading and no inheritace of rotation etc. Now at timescale 0.3, particles still unnaturally spread out:   http://youtu.be/Gf0UY2wBXC8

Posted Images

I think that's the "upward bias" checkbox in particle editor. the only problem being that it doesn't seem to work with "cone", you'd need to change to "outward".

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to post
Share on other sites

Is it perhaps possible to do what I'm trying to do with only one stage instead of two? Are there settings that would keep the size of the particle very small for 75% of its life? Or does the growth from size 1 to size 2 have to happen evenly all the time? If the same particles could stay small as they travel up and then only become large at the top (a choked cone, essentially), that could work.

post-9-0-77029300-1417396287_thumb.jpg

Link to post
Share on other sites

It's purely linear I'm afraid. Growth, speed change and all the other factors are interpolated smoothly from the starting setting to the ending one. When I first started messing with particles I made some big fireworks but I couldn't make them look quite right because firework projectiles should start off fast and decelerate more and more markedly as they lose mass and so suffer from more drag vs their momentum. They just didn't look right with constant deceleration but that's all the particle system offers right now. You're stuck with aligning 2 stages.

Link to post
Share on other sites

I can't really think of a way out of this that doesn't require changes to the way the "offset" value works.

Link to post
Share on other sites

I can only think of 2 ways to handle it:

 

Option #1 would be to amend the tdm_light_holder script object so that when it changes particle from flame to smoke or vice versa, it rotates the light entity upright. That should take care of it, but it'd be a one-shot fix so if the player then turned or dropped the smoking candle on its side the smoke would turn too.

 

Then again the particle system has never been set up to support leaving a trail in the air. If the player waves a smoking candle round, the whole particle effect will go with the candle. (Actually, is this true? If it is, that would mean we can't we do steam-train effects by moving a func emitter... I've not noticed any code that would support leaving behind a trail so perhaps we can't).

 

Option #2 would be to provide a "WorldAxis" keyword for either the whole particle or for an individual particle stage. All effects would be aligned to world axis not the emitter's axis. I can't think of any more use cases but there are probably some and it's consistent with making particles more useful/flexible.

 

Neither option would take more than an hour or so to code and test, so it could go in to 2.03.

Link to post
Share on other sites

Correction to option 1: the script would rotate the entity upright when starting to smoke, but align it to the model again when starting the flame. That's so if the mapper has tweaked the vertex on a torch flame, it gets put back in the right place.

Link to post
Share on other sites
Then again the particle system has never been set up to support leaving a trail in the air. If the player waves a smoking candle round, the whole particle effect will go with the candle. (Actually, is this true? If it is, that would mean we can't we do steam-train effects by moving a func emitter...

 

When steambots walk they leave puffs of smoke behind them, don't they? Although those may be separate particles. I'm not 100% sure on this.

Link to post
Share on other sites

Could there be any sort of parallax effect aplied to the particle sprite according to movement on the source? Because that could be a way of simulating lateral movement on a smoke cone film strip like that. That was an old trick in 2D games, dont even know if its used nowadays, and it wouldnt look perfect, but anyway...

Link to post
Share on other sites

As suspected, quads don't get left behind when the emitter moves.

 

Could there be any sort of parallax effect aplied to the particle sprite according to movement on the source? Because that could be a way of simulating lateral movement on a smoke cone film strip like that. That was an old trick in 2D games, dont even know if its used nowadays, and it wouldnt look perfect, but anyway...

That would work in limited circs... it'd only look odd if the velocity / direction of the emitter changes during the life of the emitted quads, because they'd all move in line with what the emitter is doing right now. It might be the best we can do unless we decide we want to change the "stateless" nature of the particle rendering system. A particle quad has no memory, so it can't be left behind by a moving emitter, but the system could take account of the emitter's current velocity and offset the origin of all quads by their age times the velocity.

 

We do have the option of changing the "stateless" design. I said above that doing so would be unacceptable, but that was in the context of a minor bugfix. It's ok to do if we decide we want a particle system that behaves differently. We wouldnt store the state in the renderer -- which is a much bigger stateless system and doesn't want just one bit going its own way and storing info from frame to frame -- but we could store the necessary state in the game code and pass the renderer the info each frame.

 

Back to the candle... I can put one of the above options in this week. If we use the keyword, it won't be supported by the particle editor of course so we'll have to rely on the wiki to document it for now. I need to make myself a tracker for the things I need to add to the wiki when it's back online...

Link to post
Share on other sites
Back to the candle... I can put one of the above options in this week. If we use the keyword, it won't be supported by the particle editor of course so we'll have to rely on the wiki to document it for now. I need to make myself a tracker for the things I need to add to the wiki when it's back online...

 

Option #2 would be the best, I think.

Link to post
Share on other sites

Option #2 would be the best, I think.

 

Ok I've added the "WorldAxis" keyword and applied it to your new candle smoke effect to test. If you update from svn you can try it. For 2.03, I've used it for the particle offset and direction of travel. Later we can use it for the quad rotation too, though that'll take a slightly bigger code fix and we'll only need it when we come to use images that need to be oriented in a certain way.

 

NB I updated your tdm_fire.prt to add the keyword so if you've made changes since, you'll have to merge. I only added the "WorldAxis" keyword to each stage.

Link to post
Share on other sites

I can only think of 2 ways to handle it:

 

Option #1 would be to amend the tdm_light_holder script object so that when it changes particle from flame to smoke or vice versa, it rotates the light entity upright. That should take care of it, but it'd be a one-shot fix so if the player then turned or dropped the smoking candle on its side the smoke would turn too.

 

Then again the particle system has never been set up to support leaving a trail in the air. If the player waves a smoking candle round, the whole particle effect will go with the candle. (Actually, is this true? If it is, that would mean we can't we do steam-train effects by moving a func emitter... I've not noticed any code that would support leaving behind a trail so perhaps we can't).

 

Is this actually true? I remember that I tweaked the "firesparks" for my advanced torch particles so that if an AI carries a torch, the smoke+flints do not go straight up, but instead "trail". The same is done for the smoke trailing the firearrow.

 

If you are interested, I could dig up what I did tweak.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to post
Share on other sites

Looking at my special particles from Black Light, I believe to make a particle to "trail", you use:

 

	gravity			 world -2.000

 

instead of just "gravity -2.000".

 

I'm not sure if all particles should have "world" in there, too. My fire arrow explosion, f.i. doesn't have it, while the "smoke trail" has it. But technically, you could shoot a firearrow at a moving object, and then the explosion would not move with the object. This is an unusual thing, tho.

 

To get back to the original question (not sure if this is now resolved with the change from Steve, or not):

 

If the candle smoke is just the torch smoke, then it should be possible to improve it by:

  • making it smaller, use different particles
  • use "trailing particles", so they trail correctly while you move the candle during extinguishing it

However, the particles will still be just an approximation, we do not have "physical particles", so they will stil smoke through a solid object etc.

Edited by Tels

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to post
Share on other sites

Looking at my special particles from Black Light, I believe to make a particle to "trail", you use:

 

gravity world -2.000

 

 

Removing "world" just means the particle will travel in the direction of the emitter, rather than straight up, which doesn't work for smoke.

Link to post
Share on other sites

The "world" keyword just means use world (correct) gravity direction instead of the model's z axis. The new "WorldAxis" keyword does the same thing for offset and direction. We'll have to keep them separate for backwards compatibility.

 

There's code to support individual quads having their own origin and axis distinct from the render entity's origin and axis, but I haven't yet spotted anything that uses it.

 

Thanks, I'll go look for your code (and for anything that uses the separate origin). I'm interested to know what possibilities we have for particles nowe that I've mapped out pretty much every line of code, so I plan to read up on how other games use them too.

Link to post
Share on other sites

That doesn't change anything.

 

Are we talking about the same thing? The way I read the last posts (the thread is a bit jumbled) that Steve added a WorldAxis keyword. That aligns the axis of the particle to the world.

 

However, the "gravity" thing is for the movement (not the orientation!) of the particle. Steve said that particles always move with the emitter, e.g. when you move the emitter during the lifetime of the particle, the particle is "dragged" alogn with the moving emitter. With "world aligned" gravity, the particle stays where it was emitted and is only affected by the gravity value.

 

E.g. for a flame or sparks you want the particle be "bound" to the emitter of during the lifetime of the particle, for smoke you want it to trail.

 

Or did I confuse two things here?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to post
Share on other sites

Thanks, I'll go look for your code (and for anything that uses the separate origin). I'm interested to know what possibilities we have for particles nowe that I've mapped out pretty much every line of code, so I plan to read up on how other games use them too.

 

The add-on is here:

 

http://bloodgate.com/mirrors/tdm/pub/add-ons/tels_tdm_black_light.pk4

 

Just found out that the add-on is a bit broken due to changes in the TDM particles and entities, but the definitions might still be useful.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to post
Share on other sites
With "world aligned" gravity, the particle stays where it was emitted and is only affected by th

 

That's not the case. With world gravity on, the particles move straight up regardless of the orientation of the emitter, but they still move as the emitter moves.

 

I presume trailing smoke in projectiles uses the "aimed" orientation.

Link to post
Share on other sites

That's not the case. With world gravity on, the particles move straight up regardless of the orientation of the emitter, but they still move as the emitter moves.

 

I presume trailing smoke in projectiles uses the "aimed" orientation.

 

Ah, that could be the case. Sorry for the confusion.

 

(We really should have a better documentation on the wiki for the particle system. All the different keywords with pictures showing their effect.)

 

Edit:

 

Here is what I used back then: I don't see "aimed" in there, either:

 

// For the gas arrow while flying
particle tels_gasarrow_trail {
   {
    count			   35
    material		    textures/particles/smokepuff
    time			    0.700
    cycles			  0.000
    deadTime		    0.000
    bunching		    1.000
    distribution	    rect 1.000 1.000 1.000
    direction		   cone "0.000"
    orientation		 view
    speed			   "13.000"  to "21.000"
    size			    "3.000"  to "6.000"
    aspect			  "1.000"
    randomDistribution  1
    boundsExpansion	 0.000
    fadeIn			  0.150
    fadeOut			 1.000
    fadeIndex		   0.000
    color			   0.030 0.070 0.020 1.000
    fadeColor		   0.000 0.000 0.000 0.000
    offset			  0.000 0.000 0.000
    gravity			 world -0.5
   }
}

Edited by Tels

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to post
Share on other sites

There's nothing there that I can see that is significantly different than regular smoke. I recall we had to remove smoke from the torches guards carried specifically because the smoke followed the emitter and looked bad.

Link to post
Share on other sites

There's nothing there that I can see that is significantly different than regular smoke. I recall we had to remove smoke from the torches guards carried specifically because the smoke followed the emitter and looked bad.

 

Yeah, I had the same problem with the sparks, and also the "trails" on the arrows. I wonder how I solved that, or if I really solved it.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to post
Share on other sites

"There are two different particle systems in DOOM 3. One can be [used for] moving things around and affecting things dynamically like the smoke drifting out of guns.The other is more of a static effect type of thing like smoke and bubbles coming in the world. You 11 differentiate those two for performance reasons because the things that are just effects in the world"

 

 

 

Reference quote from Carmack.

 

Maybe we need the other kind of particles for moving candle smoke?

Link to post
Share on other sites

If you look at about 00:12 of this video, you can see the smoke from the chainsaw does move the way you would expect...I suppose this could be scripted, but I wonder if that's what Carmack is talking about in the above quote. I'll try to find other examples.

 

https://www.youtube.com/watch?v=QZJR_m3-IWg

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...