I got around making rain with physics using Debris, don't get excited though, it lags to all forget rather quickly so I won't be releasing it and will only be handing it out to some curious individuals. It lags too much for multiplayer games and will barely allow for single player games given too many of the debris are out at any given time.
The setupBrick underneath with events: onPlayerTouch -> namedBrick(A or B) -> spawnProjectile -> 0 0 -10 Weather Physics Rain 0 0 0 scale 1.0
Bricks overhead: 4 32x32 plates, All named A or B
There are other prop bricks present to see whether I got any hits on the sides (I did, although rarely, but still did). I only ever had 4 plates creating the debris-making projectiles at any given time. Any more then that lagged horrendously across the game no matter where you were. It was a fun little experiment to take my mind off of studies for a bit. You might also notice the splash explosions from the debris, then notice that they're above the ground by quite a distance. This is because the physics box radius of the debris is set to a minimum of 0.35, you can't go any smaller, so the debris are actually much bigger collision-wise then they appear. It's something I can't work around.
In conclusion, although the special effects are beautiful with this, the trade off is it lags way too much to be of any real use. So you won't be seeing physics weather for a good time unless some brain decides to rewrite a new debris-esq datablock that cuts down on everything needless in favor for a very simple and lag free debris. That's all a little over my head so count me out :P
Pics:
and Script for the curious and those looking for an easy reference to working physics-assisted debris:
datablock ParticleData(rainDebrisParticle)
{
dragCoefficient = 1.2;
gravityCoefficient = 0;
inheritedVelFactor = 1.0;
constantAcceleration = 0.0;
lifetimeMS = 100;
lifetimeVarianceMS = 0;
textureName = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0] = "0.1 0.2 0.8 0.4";
colors[1] = "0.1 0.1 0.6 0.2";
sizes[0] = 0.08;
sizes[1] = 0.05;
useInvAlpha = false;
};
datablock ParticleEmitterData(rainDebrisEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionVelocity = 0;
velocityVariance = 0;
ejectionOffset = 0;
thetaMin = 0;
thetaMax = 50;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "rainDebrisParticle";
};
datablock ParticleData(rainDebriloveplosion1Particle)
{
dragCoefficient = 0.0;
gravityCoefficient = 0.2;
inheritedVelFactor = 1.0;
constantAcceleration = 0.0;
lifetimeMS = 100;
lifetimeVarianceMS = 0;
textureName = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0] = "0.1 0.2 0.8 0.4";
colors[1] = "0.1 0.1 0.6 0.0";
sizes[0] = 0.15;
sizes[1] = 0.15;
useInvAlpha = false;
};
datablock ParticleEmitterData(rainDebriloveplosion1Emitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionVelocity = 0;
velocityVariance = 0;
ejectionOffset = 0;
thetaMin = 0;
thetaMax = 50;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "rainDebriloveplosion1Particle";
};
datablock ParticleData(rainDebriloveplosion2Particle)
{
dragCoefficient = 0.0;
gravityCoefficient = 0.2;
inheritedVelFactor = 1.0;
constantAcceleration = 0.0;
lifetimeMS = 100;
lifetimeVarianceMS = 0;
textureName = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0] = "0.1 0.2 0.8 0.4";
colors[1] = "0.1 0.1 0.6 0.2";
sizes[0] = 0.10;
sizes[1] = 0.05;
useInvAlpha = false;
};
datablock ParticleEmitterData(rainDebriloveplosion2Emitter)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 2;
velocityVariance = 0;
ejectionOffset = 0;
thetaMin = 95;
thetaMax = 100;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "rainDebriloveplosion2Particle";
};
datablock ExplosionData(rainDebriloveplosion)
{
explosionShape = "";
//soundProfile = "";
lifeTimeMS = 20;
particleEmitter = rainDebriloveplosion1Emitter;
particleDensity = 1;
particleRadius = 0.0;
emitter[0] = rainDebriloveplosion2Emitter;
faceViewer = true;
explosionScale = "1 1 1";
shakeCamera = false;
camShakeFreq = "10.0 11.0 10.0";
camShakeAmp = "3.0 10.0 3.0";
camShakeDuration = 0.5;
camShakeRadius = 20.0;
// Dynamic light
lightStartRadius = 0;
lightEndRadius = 0;
lightStartColor = "0 0 0 0";
lightEndColor = "0 0 0 0";
damageRadius = 0;
radiusDamage = 0;
impulseRadius = 0;
impulseForce = 0;
};
datablock DebrisData(rainMakerDebris)
{
emitters = "rainDebrisEmitter";
Explosion = "rainDebriloveplosion";
texture = "base/data/particles/cloud";
elasticity = 0.0;
friction = 0.2;
numBounces = 1;
bounceVariance = 0;
explodeOnMaxBounce = true;
staticOnMaxBounce = false;
snapOnMaxBounce = false;
minSpinSpeed = -500;
maxSpinSpeed = 500;
render2D = true;
lifetime = 10.0;
lifetimeVariance = 0.0;
velocity = 35;
velocityVariance = 5;
fade = false;
useRadiusMass = true;
baseRadius = 0.01;
gravModifier = 0.9;
terminalVelocity = 80;
ignoreWater = false;
};
datablock ExplosionData(rainMakerExplosion)
{
explosionShape = "";
//soundProfile = "";
lifeTimeMS = 150;
debris = rainMakerDebris;
debrisNum = 100; //Yeah, 100 loving debris per explosion would lag anyone to death. It's likely actually less then that, I reckon around 30 is the default max.
debrisNumVariance = 10;
debrisPhiMin = 0;
debrisPhiMax = 360;
debrisThetaMin = 0;
debrisThetaMax = 50;
debrisVelocity = 20;
debrisVelocityVariance = 15;
//particleEmitter = positionTestEmitter;
//particleDensity = 10;
//particleRadius = 0.2;
//emitter[0] = testEmitter;
faceViewer = true;
explosionScale = "1 1 1";
shakeCamera = false;
camShakeFreq = "10.0 11.0 10.0";
camShakeAmp = "3.0 10.0 3.0";
camShakeDuration = 0.5;
camShakeRadius = 20.0;
// Dynamic light
lightStartRadius = 0;
lightEndRadius = 0;
lightStartColor = "0 0 0 0";
lightEndColor = "0 0 0 0";
damageRadius = 0;
radiusDamage = 0;
impulseRadius = 0;
impulseForce = 0;
};
AddDamageType("TankShellDirect", '<bitmap:add-ons/Projectile_GravityRocket/rocket> %1', '%2 <bitmap:add-ons/Projectile_GravityRocket/rocket> %1',1,1);
AddDamageType("TankShellRadius", '<bitmap:add-ons/Projectile_GravityRocket/rocketRadius> %1', '%2 <bitmap:add-ons/Projectile_GravityRocket/rocketRadius> %1',1,0);
datablock ProjectileData(rainMakerProjectile)
{
projectileShapeName = "base/data/shapes/empty.dts";
directDamage = 0;
directDamageType = $DamageType::TankShellDirect;
radiusDamageType = $DamageType::TankShellRadius;
impactImpulse = 0;
verticalImpulse = 0;
explosion = rainMakerExplosion;
//particleEmitter = none;
brickExplosionRadius = 0;
brickExplosionImpact = false; //destroy a brick if we hit it directly?
brickExplosionForce = 0;
brickExplosionMaxVolume = 0; //max volume of bricks that we can destroy
brickExplosionMaxVolumeFloating = 0; //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)
//sound = none;
muzzleVelocity = 20;
velInheritFactor = 1.0;
armingDelay = 100;
lifetime = 100;
fadeDelay = 100;
bounceElasticity = 0.99;
bounceFriction = 0.0;
isBallistic = true;
gravityMod = 0.0;
hasLight = false;
lightRadius = 5.0;
lightColor = "1 0.5 0.0";
explodeOnDeath = 1;
uiName = "Weather Physics Rain"; //There will likely be many more physics-assisted weather effects, so I'll name it this way to keep it in order
};