Jump to content

[1.8.x-1.10.x] SmokeScreen 2.8.14 - Extended FX plugin (18 April 2020)


sarbian

Recommended Posts

No logs => No support

SmokeScreen is a plugin whereby artists can add improved engine effects. It is built on the effects of 0.23, and its ideas come mostly from Nothke.

Changelog

  • 2.8.14 with @Scialytic changes
  • 2.8.13 more fix
  • 2.8.12 Fixes
  • 2.8.9 Fix effects on root part
  • 2.8.7 KSP 1.8 build
  • 2.8.6 More emitOnUpdate fix and a potential fix for effect that runs while in high warp
  • 2.8.5 Adds saturationMult, brightnessMult and alphaMult curves
  • 2.8.4 Fix an other NRE
  • 2.8.3 Fix some NRE and add options in the UI to force 'decluster' and 'emitOnUpdate'
  • 2.8.2 Fix for first model transform being misaligned #32 and Added a 'decluster' and 'emitOnUpdate' options to 'MODEL_MULTI_SHURIKEN_PERSIST'  #33 #34
  • 2.8.1 Build for KSP 1.5
  • 2.8.0 KSP 1.4 support. MODEL_MULTI_PARTICLE_PERSIST is gone and  only MODEL_MULTI_SHURIKEN_PERSIST is there now. Support for single transform fx (RCS)
  • 2.7.6.1 Fix for the long overdue TweakScale support!!!
  • 2.7.6 Long overdue TweakScale support
  • 2.7.5 Rebuilt for KSP 1.3
  • 2.7.4 Fix an other performance problem
  • 2.7.2 Fix a performance problem with 2.7.1
  • 2.7.1 Fix 2 bugs related to the Shuriken system. Engine should now init properly and colors/alpha should be more consistent with the old system
  • 2.7.0 Add new effects type that wrap old particles system with the "new" Shuriken system. Post with details
  • 2.6.21 Fix jumping ships
  • 2.6.20 Fix the Layer problem (reentry fx on particles)
  • 2.6.19 Fix the ToolbarWrapper exception.
  • 2.6.18 Build for 1.2
  • 2.6.17 Fix an NRE spam
  • 2.6.16 Build for KSP 1.1.3
  • 2.6.15 Build for KSP 1.1
  • 2.6.13 Fix smoke running away from vehicle when Krakensbane activates by @ferram4
  • 2.6.12 Fix the NRE spam when adding a digit in the live editor
  • 2.6.11 Open the UI with Mod+P
  • 2.6.10 is a rebuild for 1.0.5 since some things were not working properly (???)
  • 2.6.9 Include Felger patch to add 3 parameters
    Global SmokeScreen Parameter:
    atmDensityExp - SmokeScreen.cfg variable, adjusts input atmospheric pressure by an exponent, to give similar plume scaling between RSS and Stock.
    ModelMultiParticlePersistFX Parameters:
    vRandPosOffset - Random positive position offset to spread fast particles out. Additive.
    vPosOffset - nonrandom positive ffset to adjust starting particle position. Additive.
  • 2.6.8 Improve performance
  • 2.6.7 an other bug fix
  • 2.6.6 bug fix
  • 2.6.5 add randConeEmit, xyForce and zForce curves
  • 2.6.4 New sizeClamp Curve that adds itself to the sizeClamp value
  • 2.6.3 Remove lengthScale & velocityScale curves (a Unity limitation made them not that usefull).
    Rescale effect when used with the ProceduralSRB of Procedural Parts
    new initalVelocityOffsetMaxRadius curve that adds its value to the randomInitalVelocityOffsetMaxRadius value.
  • 2.6.2 Add lengthScale & velocityScale curves. Some minor fix like using the game mach value (so mach will scale with the body atmo now)
  • 2.6.1 Fix the singleEmitTimer and add workaround for the stock effect init problem
  • 2.6.0 Quick fix for 1.0
  • 2.5.3 rebuild for 0.90
  • 2.5.2 renamed KM modules to avoid conflict with KM_lib. KM_PostLaunchEffect=>KM_PostLaunchEffect_SmkS and KM_PreLaunchEffect=>KM_PreLaunchEffect_SmkS
  • 2.5.1 includes module for ColdRockets
  • 2.5.0 is a recompile for KSP 0.25
  • 2.4.5 fix the disappearing ship bug that some user had.
  • 2.0 is out. Read this post for new features

 

Features

 

  • Enables resizing particle with distance and current angle between emitter and camera; e.g., a lens flare shown only when you look into the engine bell.
  • Enables changing the particle renderMode (http://docs.unity3d.com/Documentatio...enderMode.html)
  • Enables rescaling the emitter in the .cfg, permitting resizing of both model and effect.
  • Adds a "grow" variable whereby particles can grow with time
  • Adds a curve for emission, energy, speed, grow, size and emitters scale & offset with variation of atmo density and vessel Mach speed.
  • Particles collide with terrain.
  • Exhaust persists even when the engine is destroyed.
  • Compatible with the stock MODEL_MULTI_PARTICLE. Basic config uses the same args
  • Does not call the kraken when you change scene (stock does that on Flight => Spaceport on certain condition )
  • Limits number of active particle to twenty-thousand (soon configurable) and usually stays well-below

 

Future

 

  • Ship-centric emitters
  • Surface effects; e.g., dust, water.

 

I know the rules, not pict not click but you'll have to wait for Nothke to publish his engine config for the picts :)

Download :

License: BSD 2-Clause License

You are free to package the DLL with your mods as long as it uses the directory structure of my zip. And you would be kind to link to this thread so users can get a newer version when I release one.

Source : https://github.com/sarbian/SmokeScreen/

btn_donate_SM.gif

Edit : read eggrobin post for info on the last version feature

http://forum.kerbalspaceprogram.com/threads/71630-0-23-SmokeScreen-Extended-FX-plugin?p=1037130&viewfull=1#post1037130

So how does it works ? First you need to define an effect. Look into the "HotRockets!" thread for a working example with stock KSP.

You just have to change the MODEL_MULTI_PARTICLE into a MODEL_MULTI_PARTICLE_PERSIST

Here is a minimal config with only the required info

 

name = flamethrust

modelName = MP_Nazari/FX/flamestandard

transformName = thrustTransform

 

Here is the same config with all the default value shown :

modelName = MP_Nazari/FX/flamestandard
transformName = thrustTransform
shaderFileName =
renderMode = Billboard
collide = False
collideRatio = 0
localRotation = 0,0,0
localPosition = 0,0,0
offsetDirection = 0,0,1
fixedScale = 1
sizeClamp = 50
initialDensity = 0.6
physical = False
stickiness = 0.9
dragCoefficient = 0.1
timeModulo = 10
singleEmitTimer = 0
randomInitalVelocityOffsetMaxRadius = 0
angle = 1
distance = 1
emission
{
	power = 1
	density = 1
	mach = 1
	parttemp = 1
	externaltemp = 1
	time = 1
}
energy
{
	power = 1
	density = 1
	mach = 1
	parttemp = 1
	externaltemp = 1
	time = 1
}
speed
{
	power = 1
	density = 1
	mach = 1
	parttemp = 1
	externaltemp = 1
	time = 1
}
grow
{
	power = 0
	density = 0
	mach = 0
	parttemp = 0
	externaltemp = 0
	time = 0
}
scale
{
	power = 1
	density = 1
	mach = 1
	parttemp = 1
	externaltemp = 1
	time = 1
}
size
{
	power = 1
	density = 1
	mach = 1
	parttemp = 1
	externaltemp = 1
	time = 1
}
offset
{
	power = 0
	density = 0
	mach = 0
	parttemp = 0
	externaltemp = 0
	time = 0
}
force
{
	power = 0
	density = 0
	mach = 0
	parttemp = 0
	externaltemp = 0
	time = 0
}
logGrow
{
	power = 0
	density = 0
	mach = 0
	parttemp = 0
	externaltemp = 0
	time = 0
}
linGrow
{
	power = 0
	density = 0
	mach = 0
	parttemp = 0
	externaltemp = 0
	time = 0
}
logGrowScale
{
	power = 1
	density = 1
	mach = 1
	parttemp = 1
	externaltemp = 1
	time = 1
}
lengthScale
{
	power = 1
	density = 1
	mach = 1
	parttemp = 1
	externaltemp = 1
	time = 1
}
velocityScale
{
	power = 1
	density = 1
	mach = 1
	parttemp = 1
	externaltemp = 1
	time = 1
}

 

So now let's explain all those.

First we have 2 kind of config parameters :

- fixed parameter : all the xxx = yyy from modelName to angle

- curve : the entries with a subsection like emission or energy

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

The initial velocity of the particles will be offset by a random amount lying in a disk perpendicular to the mean initial velocity whose radius is randomOffsetMaxRadius. This is similar to Unity's 'Random Velocity' Setting, except it will sample the offset from a (normal) disk rather than from a cube. Units (SI): m/s.

The Simple Curves

angle and distance distance are curve with only 1 input. They are used to resize particle with the camera distance and angle with the transform. They were added for flares effects. Since they are curve you need to add the line more than once to set them up.

For exemple here is a config that show the particles if the angle of the camera with the transform is lower than 45° :

 

 
angle = 0.0 1.0 // at 0° do not resize
angle = 45.0 1.0  // at 45° stil don't resize
angle = 50.0 0.0 // from 45° to 50° and beyond resize to 0. ( with 47.5° being half size)

 

The Multiple Input Curves

Those change different parameter of the effect in relation to multiple input curve. Those inputs curves are :

- power : the power sent to the effect. 0 to 1. For engines it's related to the throttle (set or current, it change with the engine config)

- density : atmo density.

- mach : current speed in mach. For now mach speed is calculated for AIR.

- parttemp : the part temperature

- externaltemp : the external temperature

- time : time in second modulo "timeModulo". So you get a repeating sequence between 0 and timeModulo.

Curve are divided in additive en multiplicative curve. The additive add the result of the inputs and the multiplicative multiply them.

emission : multiplicative. Change the number of particle emited per second

 

emission // Modulate emission from mach and density curve. You can add other section for size, energy, speed, grow, offset and scale
{
	mach = 0.0 0.0
	mach = 0.8 0.0 // don't display until mach .8
	mach = 1.0 3.0

	density = 1.0 0.0
	density = 0.4 0.0 // don't display over .4 atmo
	density = 0.3 1.0
	density = 0.002 1.0
	density = 0.001 0.0 // and stop under .001
}

 

energy : multiplicative. Change the energy (life in s) of each particle

speed : multiplicative. Change the particle speed

grow : additive. Change how the particle grow with time with a exponential functions. 1 is 100% per second

 

SS_grow.png

 

scale : multiplicative. Rescale the emitter

size : multiplicative. Rescale the particles

offset : additive. Move the emitter away from the transform in "offsetDirection"

force : additive. Change the power of the force applied to the particles each frame

logGrow : additive. Change how the particle grow with time with a logarithmic functions

 

SS_log.png

 

linGrow : additive. Change how the particle grow with time linearly

 

SS_lin.png

 

logGrowScale : multiplicative. Change the log function base

lengthScale : multiplicative. How much are the particles stretched in their direction of motion.

velocityScale : multiplicative. How much are the particles strectched depending on "how fast they move". Use this to make particles get longer as their speed increases.

randConeEmit: additive default value 0 (no cone emission), similar to

randomInitalVelocityOffsetMaxRadius, but a little less random effect

appearance in-game. Forces a mirrored emission to ensure symmetric

plume appearance.

xyForce: multiplicative default value 1, multiplicatively damps or grows horizontal

(perpendicular to exhaust velocity) speed.

zForce: multiplicative default value 1 multiplicatively damps or grows vertical

(parallel to exhaust velocity) speed.

Edited by sarbian
Link to comment
Share on other sites

Two questions:

Can the color of a flame be altered via plugin, or would it have to be through texture/modeling? Ideally what I want to do is have a set of colors representing various substances and temperatures to interpolate between.

Second, can particles be made to spawn at an offset from the origin in order to create a cylindrical (or rectangular) sheet?

Link to comment
Share on other sites

Two questions:

Can the color of a flame be altered via plugin, or would it have to be through texture/modeling? Ideally what I want to do is have a set of colors representing various substances and temperatures to interpolate between.

Second, can particles be made to spawn at an offset from the origin in order to create a cylindrical (or rectangular) sheet?

1. Color, not yet.

2. You can create a spawn shape like a circle, ellipse, box, plane, point and a few more shapes from the particle exporter options. You can create offset in two ways, one is to create an offset by moving the system in Unity, then puting it under a parent gameobject, and another way is to add a "localOffset = 0,0,0" line, or "offset = 0.0 0.0" if you need to make it moveable, although it works in just one dimension (Y).

Link to comment
Share on other sites

Spawn shape is more what I'm after than offsetting the effect as a whole, in which case what I'd need would be a hoop I guess. (Equivalent to offsetting each individual particle a fixed distance at a random angle in the plane.)

Link to comment
Share on other sites

Nothke found a bug related to part unloading ( think SRB falling down ). I uploaded a new version that should fix that but their trail will vanish until I find a proper way to handle this case.

Link to comment
Share on other sites

Mother of God....does this mod add that to all engines or do I have to edit them myself?

SmokeScreen doesn't add anything visually. It's a plugin to help creation of new particle systems including a lot of fixes from the stock exporter. What's in the screens is a particle mod that I am developing right now.

Link to comment
Share on other sites

Man, this is locking gorgeous, but i will wait until it have an proper set of config to all rockets .

Great Job! ;)

Hey Nothke, will you post or set of config files for us?

Edited by Climberfx
Link to comment
Share on other sites

sarbian: Great plugin! One remark however:

I'm not sure whether it's too late to change the identifiers (there shouldn't be too many compatibility problems right now), but I think 'persistant' should be replaced by 'persistent' (unless you intended to name the classes in French). I'll report it as a bug on GitHub.

nothke: These screenshots look great!

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