Jump to content

How to adjust size of particle f/x for an engine?


Recommended Posts

Apologies if this is a silly question, but I've been rummaging around and haven't been able to turn up any discussion of this.

I'm tinkering with the config for a part.  It's an engine, and I've got, on the one hand, the size of the engine model; and, on the other hand, the size of the particle effects (i.e. fire plume) while the engine is running.

I understand how to adjust the size of the engine (by tinkering with the "scale" parameter of its MODEL block).  But how do I adjust the size of the plume?  i.e. suppose I think it's too big or too small, relative to the rocket-- how can I  adjust that?

The plume is defined in a MODEL_MULTI_PARTICLE block, which includes a "modelName" parameter that points it at the .mu file that defines the plume.  So what I need is a thing I can apply to this model, that works the same way as the "scale" parameter to the MODEL block.  How do I do this?

The only thing I've found that seems likely is the presence of a "localScale" variable.  But I've tried inserting this, and it doesn't seem to do anything-- i.e. the plume seems to get drawn at the default scale of the .mu, regardless of whether localScale is present in the definition or not, and regardless of what numbers I put in localScale.

How do I tweak this?

Link to comment
Share on other sites

12 hours ago, Snark said:

snip

The Fixed Parameters 
modelName : point to the model of your effect. it's the same as the stock FX so you'll have to find stock tutorial on how to build those in unity. 
transformName : part transform where your effect is attached 
shaderFileName : point to a compiled shader text file to replace the default shader of your model. Not testes all that much 
renderMode : set the particule renderMode, one of Billboard/HorizontalBillboard/SortedBillboard/Stretch/VerticalBillboard. See unity doc http://docs.unity3d.com/ScriptReference/ParticleRenderMode.html 
localRotation : rotation of the effect. For when you did not align correctly in unity or want to point an other way 
localPosition : move the effect away from the transform its attached to. 
offsetDirection : direction of movement when offset is used, see offset curve. 
fixedScale : fixed scale of the effect. For when you want to rescale to effect or the part 
sizeClamp : maximum size of the particle. 
collide : does the particle collide with stuff. False / True 
collideRatio : change how the particle collide. Test in game to see the effect. Set to a value between 0 and 1 
stickiness : how is the particle slowed on collision 
physical : simulate the buoyancy of the particle/gas 
initialDensity : density of the particle/gas at its starting size 
dragCoefficient : atmo drag on the particle/gas 
timeModulo : used with the time input (see bellow with the curve) 
singleEmitTimer : when different than 0 change the behaviour of single emit event ( like flameout ) and replace them with an emission of x seconds. 
randomInitalVelocityOffsetMaxRadius : let me copy Egg comment on the value 

Have you looked at smokescreen main page 

 

Link to comment
Share on other sites

Excellent, thanks @Mecripp!  No, I hadn't seen any of that info, it looks like just the sort of thing I need.  I'll go tinker with that and see if I can get where I need with it.  Thanks!  :)

[EDIT] hmmm, nope, doesn't seem to do anything-- or, highly likely, I'm doing it wrong, somehow.  I tried adding this to the MODEL_MULTI_PARTICLE section of the config,

fixedScale = 0.1 0.1 0.1

...and it does nothing, as far as I can tell.  No effect on the size of the rocket plume.

Just to be clear, here's what the overall MODEL_MULTI_PARTICLE section looks like (before I try to start tinkering with the scale):

MODEL_MULTI_PARTICLE
{
    modelName = path_to_model_file_for_particle
    transformName = thrustTransform
    emission = 0.0 0.0
    emission = 0.1 0.25
    emission = 1.0 1.0
    speed = 0.0 0.75
    speed = 0.25 1.0
    speed = 1.0 1.0
}

I've tried everything I can think of to try to alter the size of the rocket plume, nothing seems to make any difference.  What am I doing wrong?  Is there an example somewhere of some config that alters the scale of an engine plume (or similar particle effect)?

Link to comment
Share on other sites

19 minutes ago, Snark said:

snip

But here in stock it says broke ?? https://wiki.kerbalspaceprogram.com/wiki/CFG_File_Documentation#FX_definitions

Variable 
Value 
Definition 
prefabName 
fx_exhaustFlame_blue 
The name of the effect you want to use (See list above). 
transformName 
smokePoint 
The name of the point defined in the Unity editor where the effect will appear from. 
size 
Throttle Range (0.0), Scale (0.0) 
(Doesn't work!) Scales the size of the particle effect set in the Unity editor. This parameter is usually the same number as the size in meters for the part (1.25, 2.5, 3.75, etc.). You need one line with a declaration for every point on the throttle range you are editing (See example below). 
energy 
Throttle Range (0.0), Scale (0.0) 
Scales the energy of the particle effect set in the Unity editor. Energy is the time it takes for the effect to disappear. For smoke trails, you want a high value, but for water vapor you want a small value. You need one line with a declaration for every point on the throttle range you are editing (See example below). 
emission 
Throttle Range (0.0), Scale (0.0) 
Lets you edit the emission range and scale of the effect. It handles amount of particles in a set amount of time. You need one line with a declaration for every point on the throttle range you are editing (See example below). 
speed 
Throttle Range (0.0), Scale (0.0) 
Scales the velocity of the particle effect set in the Unity editor. You need one line with a declaration for every point on the throttle range you are editing (See example below). 
localOffset 
X, Y, Z 
Used in PREFAB_PARTICLE. Lets you change the offset of the effect in 3D space. To move the particle effect closer to the nozzle, edit the Z axis. 
localPosition 
X, Y, Z 
Used in MODEL_MULTI_PARTICLE. Lets you change the offset of the effect in 3D space. To move the particle effect closer to the nozzle, edit the Z axis. 

 

Link to comment
Share on other sites

5 minutes ago, Mecripp said:

Yep, it claims that there's a "size" parameter, but also is documented as "Doesn't work!".

So... does this mean that what I want (i.e. changing the size of a rocket plume) is simply an impossible thing?

Really?

That seems... odd, and not at all what I would have expected.  Surely, changing the size is a normal thing for people to want to do?  I keep thinking I must be missing something, surely I can't be the first person to want to do this.

The alternative, I suppose, would be to alter the model file itself, i.e. the .mu, to just give it a different intrinsic size.  However, in my case, I don't have any original source files to work from-- all I have is the .mu file itself.  So unless there's some way of cracking that open and altering the scale inside, I don't know what to do.

 

Link to comment
Share on other sites

21 minutes ago, Mecripp said:

Can you post part of the cfg you are working on ?

I'd be happy to, but which part would you like to see? I've quoted the MODEL_MULTI_PARTICLE section in its entirety above, and AFAIK that's the only part of the config that I'm having trouble with.

Link to comment
Share on other sites

@Snark Squad implemented localScale = 1, 1, 1 which goes inside of MODEL_MULTI_PARTICLE{} with, I think, KSP 1.4.5. However, it's half-baked and will break and misbehave:

  • At the fourth effect transform in any mod's multi-nozzle engine.
  • At the sixth effect transform in any multi-nozzle RCS block
  • At the second effect transform in any of Sqaud's multi-nozzle engines. Come on, Squad.....

Oh yes. The particular plume has to be made in a different way to support the localScale feature. Most of Squad's plumes may not support it. (In Unity, the same transform that carries the particle emitter module must also carry the PartTools module.)

@Mecripp RealPlume/SmokeScreen are not required for this feature. ;)

I've been up to quite a lot of mischief with it ever since... (example of Squad engine --> Twin-boar LFB)

TBbCpmS.jpg

Edited by JadeOfMaar
Link to comment
Share on other sites

7 minutes ago, JadeOfMaar said:

@Snark Squad implemented localScale = 1, 1, 1 which goes inside of MODEL_MULTI_PARTICLE{} with, I think, KSP 1.4.5. However, it's half-baked and will break and misbehave:

  • At the fourth effect transform in any mod's multi-nozzle engine.
  • At the sixth effect transform in any multi-nozzle RCS block
  • At the second effect transform in any of Sqaud's multi-nozzle engines. Come on, Squad.....

Oh yes. The particular plume has to be made in a different way to support the localScale feature. Most of Squad's plumes may not support it. (In Unity, the same transform that carries the particle emitter module must also carry the PartTools module.)

@Mecripp RealPlume/SmokeScreen are not required for this feature. ;)

I've been up to quite a lot of mischief with it ever since... (example of Squad engine --> Twin-boar LFB)

TBbCpmS.jpg

That was it that works 

			PREFAB_PARTICLE
			{
				prefabName = fx_exhaustFlame_yellow_tiny_Z
				transformName = thrustTransform
                                localScale = 2, 2, 2
                                emission = 0.0 0.0
				emission = 1.0 1.0
				speed = 0.0 0.8
				speed = 1.0 1.0
			}

but did see when scaling up looks like it might have to move down alittle has you scale :)

 

Link to comment
Share on other sites

22 minutes ago, JadeOfMaar said:

 

@Mecripp RealPlume/SmokeScreen are not required for this feature. ;)

I've been up to quite a lot of mischief with it ever since... (example of Squad engine --> Twin-boar LFB)

TBbCpmS.jpg

And was just posting smokescreen because the FX settings look the same on some of the new ones and looks like you need to fix your FX your smoke is going the wrong way :sticktongue:

Edited by Mecripp
Link to comment
Share on other sites

50 minutes ago, JadeOfMaar said:

However, it's half-baked and will break and misbehave:

  • At the fourth effect transform in any mod's multi-nozzle engine.

Ugh.  Well, that hoses me.  This is a 7-nozzle engine.

I'll add that I already tried localScale and haven't been able to detect that it has any effect whatsoever on _any_ of the nozzles.  The plume looks exactly the same, whether it's absent, or present as 1 1 1, or present as 10 10 10, or present as 0.1 0.1 0.1.  Bupkes.

50 minutes ago, JadeOfMaar said:

Oh yes. The particular plume has to be made in a different way to support the localScale feature.

Yeah, this also hoses me.  This is a legacy .mu from well before KSP 1.4, so I'm guessing it's a foregone conclusion that there's nothing I can do about the plume.  I'm stuck with it.

(Well, unless I can find some charitably-inclined modeler who's willing to undertake the work to implement a new plume from scratch.)

Or is there some other way out, here, that I'm not seeing?

(I'm still just flabbergasted that there's no simple, reliable way available since forever to just globally scale the whole shebang by a simple factor.  Seriously?)

Anyway, TYVM for the info!

Link to comment
Share on other sites

@Mecripp heh lol. That smoke is not my FX. That's Squad's own. It's when you take out the legacy code and reattach the prefab smoke through EFFECTS{} and ModuleEnginesFX{} that it does that. :rolleyes:

5 minutes ago, Snark said:

(Well, unless I can find some charitably-inclined modeler who's willing to undertake the work to implement a new plume from scratch.)

I got ya covered. :) Send me your engine files.

Link to comment
Share on other sites

28 minutes ago, JadeOfMaar said:

I got ya covered. :) Send me your engine files.

You, sir, are a gentleman and a scholar.  :)  As soon as I have a chance (am not on my KSP machine at the moment), I'll pass along the files.  I'll sync up with you in PM.

Link to comment
Share on other sites

From the patch notes.

Added localScale param and behaviour to EffectDefinitions: PREFAB_PARTICLE, PREFAB_MULTI_PARTICLE , MODEL_MULTI_PARTICLE and MODEL_PARTICLE.

Playing around with this I found the following:

ModuleEnginesFX

localScale Works on.

PREFAB_PARTICLE, MODEL_PARTICLE

localScale Doesn't work. Tried many different FX from other mods, hoping it was just the KSP FX's but no success yet.

PREFAB_MULTI_PARTICLE ,MODEL_MULTI_PARTICLE

 

ModuleRCSFX

localScale works on MODEL_MULTI_PARTICLE , but not on stock particle FX Monoprop_small, Monoprop_medium, Monoprop_large. I haven't tried the others, but I had no problem getting the NearFuture FX's I have tried to scale. (listed the ones I have tried below).

Spoiler

 NearFuturePropulsion/FX/rcs-gridded-plume-01

NearFuturePropulsion/FX/rcs-mpdt-li-plume-01

NearFutureLaunchVehicles/FX/rcs-lfo-plume-small

NearFuturePropulsion/FX/rcs-hall-plume-01

Have not tested PREFAB_PARTICLE, MODEL_PARTICLE, PREFAB_MULTI_PARTICLE.

The annoying part about PREFAB_PARTICLE and MODEL_PARTICLE is that each FX needs a unique name and transformName to work. So if your engine has seven FX's, you will need each FX to have a unique name. I copied one of my Effects configs(see spoiler below) for a mod on the Mammoth engine below.

Spoiler

// New transforms

//  thrustTransUL1,  thrustTransUL2, smokepointUL1

// thrustTransUR1,  thrustTransUR2, smokepointUR1

// thrustTransLL1, thrustTransLL2, smokepointLL1

// thrustTransLR1,  thrustTransLR2, smokepointLR1

 

 EFFECTS
    {
        running_closed
        {
            AUDIO
            {
                channel = Ship
                clip = sound_rocket_spurts
                volume = 0.0 0.0
                volume = 1.0 1.0
                pitch = 0.0 0.2
                pitch = 1.0 1.0
                loop = true
            }
            PREFAB_PARTICLE
            {
                name = ULthruster2a
                prefabName = fx_exhaustFlame_blue
                transformName = thrustTransUL1
                emission = 0.0 0.0
                emission = 0.1 0.3
                emission = 1.0 10.0
                speed = 0.0 0.8
                speed = 1.0 1.0
                localRotation = 1, 0, 0, 0
                localScale = 4.0, 4.0, 4.0
                localOffset = 0, 0, 0
            }
            PREFAB_PARTICLE
            {
                name = ULthruster2b
                prefabName = fx_exhaustFlame_blue
                transformName = thrustTransUL2
                emission = 0.0 0.0
                emission = 0.1 0.3
                emission = 1.0 1.0
                speed = 0.0 0.8
                speed = 1.0 1.0
                localRotation = 1, 0, 0, 0
                localScale = 2,2,2
                localOffset = 0, 0, 0
            }
            PREFAB_PARTICLE
            {
                name = ULthruster2c
                prefabName = fx_smokeTrail_veryLarge
                transformName = smokepointUL1
                emission = 0.0 0.0
                emission = 0.05 0.0
                emission = 0.075 0.25
                emission = 1.0 1.25
                speed = 0.0 0.25
                speed = 1.0 1.0
                localOffset = 0, 0, 1
                localScale = 4.0, 4.0, 4.0
            }
            PREFAB_PARTICLE
            {
                name = URthrust4a
                prefabName = fx_exhaustFlame_blue
                transformName = thrustTransUR1
                emission = 0.0 0.0
                emission = 0.1 0.3
                emission = 1.0 10.0
                speed = 0.0 0.8
                speed = 1.0 1.0
                localRotation = 1, 0, 0, 0
                localScale = 4.0, 4.0, 4.0
                localOffset = 0, 0, 0
            }
            PREFAB_PARTICLE
            {
                name = URthrust4b
                prefabName = fx_exhaustFlame_blue
                transformName = thrustTransUR2
                emission = 0.0 0.0
                emission = 0.1 0.3
                emission = 1.0 1.0
                speed = 0.0 0.8
                speed = 1.0 1.0
                localRotation = 1, 0, 0, 0
                localScale = 2,2,2
                localOffset = 0, 0, 0
            }
            PREFAB_PARTICLE
            {
                name = URthrust4c
                prefabName = fx_smokeTrail_veryLarge
                transformName = smokepointUR1
                emission = 0.0 0.0
                emission = 0.05 0.0
                emission = 0.075 0.25
                emission = 1.0 1.25
                speed = 0.0 0.25
                speed = 1.0 1.0
                localOffset = 0, 0, 1
                localScale = 4.0, 4.0, 4.0
            }
            PREFAB_PARTICLE
            {
                name = LLthrust1a
                prefabName = fx_exhaustFlame_blue
                transformName = thrustTransLL1
                emission = 0.0 0.0
                emission = 0.1 0.3
                emission = 1.0 10.0
                speed = 0.0 0.8
                speed = 1.0 1.0
                localRotation = 1, 0, 0, 0
                localScale = 4.0, 4.0, 4.0
                localOffset = 0, 0, 0
            }
            PREFAB_PARTICLE
            {
                name = LLthrust1b
                prefabName = fx_exhaustFlame_blue
                transformName = thrustTransLL2
                emission = 0.0 0.0
                emission = 0.1 0.3
                emission = 1.0 1.0
                speed = 0.0 0.8
                speed = 1.0 1.0
                localRotation = 1, 0, 0, 0
                localScale = 2,2,2
                localOffset = 0, 0, 0
            }
            PREFAB_PARTICLE
            {
                name = LLthrust1c
                prefabName = fx_smokeTrail_veryLarge
                transformName = smokepointLL1
                emission = 0.0 0.0
                emission = 0.05 0.0
                emission = 0.075 0.25
                emission = 1.0 1.25
                speed = 0.0 0.25
                speed = 1.0 1.0
                localOffset = 0, 0, 1
                localScale = 4.0, 4.0, 4.0
            }
            PREFAB_PARTICLE
            {
                name = LRthrust3a
                prefabName = fx_exhaustFlame_blue
                transformName = thrustTransLR1
                emission = 0.0 0.0
                emission = 0.1 0.3
                emission = 1.0 10.0
                speed = 0.0 0.8
                speed = 1.0 1.0
                localRotation = 1, 0, 0, 0
                localScale = 4.0, 4.0, 4.0
                localOffset = 0, 0, 0
            }
            PREFAB_PARTICLE
            {
                name = LRthrust3b
                prefabName = fx_exhaustFlame_blue
                transformName = thrustTransLR2
                emission = 0.0 0.0
                emission = 0.1 0.3
                emission = 1.0 1.0
                speed = 0.0 0.8
                speed = 1.0 1.0
                localRotation = 1, 0, 0, 0
                localScale = 2,2,2
                localOffset = 0, 0, 0
            }
            PREFAB_PARTICLE
            {
                name = LRthrust3c
                prefabName = fx_smokeTrail_veryLarge
                transformName = smokepointLR1
                emission = 0.0 0.0
                emission = 0.05 0.0
                emission = 0.075 0.25
                emission = 1.0 1.25
                speed = 0.0 0.25
                speed = 1.0 1.0
                localOffset = 0, 0, 1
                localScale = 4.0, 4.0, 4.0
            }            
        }
        engage
        {
            AUDIO
            {
                channel = Ship
                clip = sound_vent_soft
                volume = 1.0
                pitch = 2.0
                loop = false
            }
        }
        flameout
        {
            PREFAB_PARTICLE
            {
                prefabName = fx_exhaustSparks_flameout_2
                transformName = smokePoint
                oneShot = true
            }
            AUDIO
            {
                channel = Ship
                clip = sound_explosion_low
                volume = 1.0
                pitch = 2.0
                loop = false
            }
        }
    }
    MODULE
    {
        name = ModuleEnginesFX
        engineID = KS25
        runningEffectName = running_closed
        thrustVectorTransformName = thrustTransform
        exhaustDamage = True
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 8250
        heatProduction = 235
        fxOffset = 0, 0, 0.25
        EngineType = LiquidFuel
        exhaustDamageDistanceOffset = 1.9
        PROPELLANT
        {
            name = LiquidFuel
            ratio = 0.9
            DrawGauge = True
        }
        PROPELLANT
        {
            name = Oxidizer
            ratio = 1.1
        }
        atmosphereCurve
        {
            key = 0 315
            key = 1 295
            key = 12 0.001
        }
    }

I created a model with just transforms, labelled the new transforms and oriented them properly. It is nice though, since you can get creative with your FX. You can put multiple different flames, adjust them bases on throttle, and change the scale.

Not tested MultiModeEngine for localScale yet.

Hope this helps.

 

Link to comment
Share on other sites

8 hours ago, Barar said:

localScale Doesn't work.

^ this. Thanks for posting the info, but it doesn't help in my case because localScale doesn't actually work.

Part of the problem is that for it to work on MODEL_MULTI_PARTICLE, then the actual .mu file in question must be a recent one that was made after some particular Unity version.  So if you've got an older particle model... it won't support localScale no matter what you do.

And that was the whole reason I needed to rescale in the first place:  I had an older particle model that was wrongly-sized and wouldn't work with localScale.

8 hours ago, Barar said:

created a model

^ Yeah, that's the problem.  If I had the ability to create a model, then rescaling simply wouldn't have been a problem-- I'd create a model with the correct scale.  But I can't create models, I just had this one (old) model to work with, and the only hope of making it work was rescaling it.  Which turns out to be impossible.  So I can't use the model and I'm simply out of luck.

...except that @JadeOfMaar then very kindly stepped up and volunteered to create a model for me.  Which he did.  And it's awesome and my problem is now solved.  :)

 

Link to comment
Share on other sites

@Barar The problem with Squad's plumes and localScale is that for localScale to work, a plume needs to be made differently (and it's easy to assume Squad wouldn't be bothered to remake their plumes accordingly), therefore nearly all of Squad's plumes won't work with it.

Link to comment
Share on other sites

No worry, I just spent some time figuring this out. So much so that I ended up learning how to use blender and got way ahead of myself over the last couple months. So I didn't consider making a model such a hard No for you as you seem quite capable.

JadeOfMaar does nice work and I am glad he was able to help you.

This is what I was doing playing around with the stock FX, as you mentioned some do not rescale.

9ExfnKo.jpg

I did change around some of the FX's on the Mammoth when experimenting, not sure if better just different. I really need to look into make my own FX, not tried it yet.

0cD9zSk.jpg

 

This is what I ended up making if you were curious, like my fourth iteration. As you can see the stock RCS not scaling for me on the end. 

0UE21yQ.jpg

srPBjUJ.jpg

Still trying to differentiate the icons in VAB/MAB since they all look alike and can clutter up the tab. Only the head and pipe are different textures for different resources.

 

The missing history pack looks nice, I have a rather modded version of vens restock on mine, this may complement it nicely.

 

Link to comment
Share on other sites

10 hours ago, Barar said:

So I didn't consider making a model such a hard No for you as you seem quite capable.

Oh, I have no trouble using Blender.  I'm quite technically competent.  What I don't have a shred of is artistic talent.

Also, given that I'm fairly busy IRL, I don't have anywhere near enough time to put in the many, many hours it would take me to climb the learning curve of all the myriad tools one must master to do this stuff.  Unity, in particular, gives me the slithering creeps-- any time I have to do anything with it is a nightmare.  (So far, my only modeling experience has been producing this part for one of my mods, and that's a simple thing consisting of two cylinders requiring no artwork whatsoever and doesn't even have a texture, and just making that was a multi-hour excruciating exercise to figure out all the fiddly bits, and that was a couple of years ago now so I've forgotten everything and would have to start from scratch again.  Someday when I'm retired and have many hours of free time on my hands every day, then maybe I'll come up to speed on this stuff, but for now it's simply not practical for me.)

Fortunately for me, there are plenty of talented folks out there who are happy to help out.  :)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...