Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2   Go Down

Author Topic: Adding shrapnel splash for AAA airbursts  (Read 458 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 6033
Adding shrapnel splash for AAA airbursts
« on: August 22, 2023, 08:36:54 PM »

When a AAA burst occurs within a set distance of the surface, a random number (5 to 9 for the light AAA) of shrapnel spashes or dust clouds are generated immediately beneath, on water and land, respectively. For the 20mm/25mm Zenitka events, which make the small flak clouds, I have the distance threshold set at 10m. Should I change this value?

Here are two views of the small AAA action on water.

The larger 85mm/88mm Zenitka bursts have a minimum altitude ASL that's far too high for water splash, but over higher terrain there could be airbursts near the ground. I'll define an effect suitable for this larger calibre over ground and with a larger threshold distance above the surface. Any height threshold suggestion for this one? I'm thinking 20-25m...



Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

KingTiger503

  • Legendary History Luftwaffe Elite Ace ,,,
  • Supporter
  • member
  • Online Online
  • Posts: 1997
  • KT503 Elite
Re: Adding shrapnel splash for AAA airbursts
« Reply #1 on: August 22, 2023, 10:18:54 PM »

WOW, Cool, I love your Work.


Best Regards KT503
Logged
My Greatest and Best Regards KT503

RABIZO

  • member
  • Offline Offline
  • Posts: 511
Re: Adding shrapnel splash for AAA airbursts
« Reply #2 on: August 23, 2023, 12:55:35 AM »

thank you.

I'm so excited.
Logged

Frankiek

  • SAS Team
  • member
  • Offline Offline
  • Posts: 2913
Re: Adding shrapnel splash for AAA airbursts
« Reply #3 on: August 23, 2023, 01:19:43 AM »

impressive do you have an idea of the impact on FPS?
Logged

Dragunoff

  • member
  • Offline Offline
  • Posts: 147
Re: Adding shrapnel splash for AAA airbursts
« Reply #4 on: August 23, 2023, 01:36:27 AM »

Oooooooooo perfect !!!
Logged

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 6033
Re: Adding shrapnel splash for AAA airbursts
« Reply #5 on: August 23, 2023, 02:50:13 AM »

impressive do you have an idea of the impact on FPS?


By the time the action will have got to this point, the other effects going on, such as actual shell hits on the surface and the higher airbursts of flak, will be the dominating resource hog. Not to mention the whole panoply of calculations required for all the other game action. I could sense no material hit on frame rate resulting from this addition. Generally, at any one moment there might be splashes drawn for something like 1-2 dozen bursts; let's say 24. Each splash is 2 particles, and the average of 7 splashes for 24 events = 2 * 7 * 24 = 336 particles. A single damaged aircraft smoke trail comprises roughly this number.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 6033
Re: Adding shrapnel splash for AAA airbursts
« Reply #6 on: August 23, 2023, 04:05:34 AM »

For those who are curious to see how the sausage is made.

Here's the method which creates the flak bursts, updated with my variation on Storebror's flak illumination mod (including my addition of conf.ini entries to select whether or not to generate the illumination for each of the two size classes of flak). Toward the bottom is the new code to send the relevant parameters to the new methods that make the water and ground shrapnel hits.

Code: [Select]
public static void AirFlak(Point3d point3d, int i)
{
if (Config.isUSE_RENDER())
{
o.set(0.0F, 90.0F, 0.0F);
l.set(point3d, o);
String string = "Effects/Explodes/Air/Zenitka/";
boolean bBurnFade = false;
switch (i)
{
case 0:
string += "USSR_85mm/";
bBurnFade = true;
lightPointIntensity = 1.0F;
lightPointRange = 150F;
break;
case 1:
string += "Germ_88mm/";
bBurnFade = true;
lightPointIntensity = 1.0F;
lightPointRange = 150F;
break;
case 2:
string += "USSR_25mm/";
lightPointIntensity = 0.7F;
lightPointRange = 20.0F;
break;
default:
string += "Germ_20mm/";
lightPointIntensity = 0.7F;
lightPointRange = 20.0F;
}
SfxExplosion.zenitka(point3d, i);
Eff3DActor.New(l, 1.0F, string + "Sparks.eff", -1.0F);
Eff3DActor.New(l, 1.0F, string + "SmokeBoiling.eff", -1.0F);
if (bBurnFade)
Eff3DActor.New(l, 1.0F, string + "Fire.eff", -1.0F);
if (World.Sun().ToSun.z > 0.0F)
Eff3DActor.New(l, 1.0F, string + "Burn.eff", -1.0F);
else
{
float burnSize = MiscEffects.cvt(World.Sun().ToSun.z, -0.25F, 0.0F, 1.4F, 1.0F);
Eff3DActor.New(l, burnSize, string + "Burn_night.eff", -1.0F);
if ((Config.cur.ini.get("Mods", "LightFlakIllumination", 0) == 1 && i > 1) || (Config.cur.ini.get("Mods", "HeavyFlakIllumination", 0) == 1 && i < 2))
{
lightPointIntensity *= MiscEffects.cvt(World.Sun().ToSun.z, -0.25F, 0.0F, 1.0F, 0.25F);  //was scaled 1.0, 0.5; tried 2, 0.3
lightPointRange *= MiscEffects.cvt(World.Sun().ToSun.z, -0.25F, 0.0F, 1.0F, 0.3F);  //was scaled 1.0, 0.5; tried 1.5, 0.3
Eff3DActor eff3dactor = Eff3DActor.New(l, 1.0F, "Effects/Explodes/Cannon/Object/light.eff", 0.06F);
eff3dactor.postDestroy(Time.current() + 60L);  //night flash effect lasts 0.06s
LightPointActor lightpointactor = new LightPointActor(new LightPointWorld(), new Point3d());
lightpointactor.light.setColor(1.0F, 0.6F, 0.2F);
lightpointactor.light.setEmit(lightPointIntensity, lightPointRange);
eff3dactor.draw.lightMap().put("light", lightpointactor);
}
}
if (i > 1 && point3d.z - Engine.land().HQ_Air(point3d.x, point3d.y) < 10)  //small flak shrapnel splash/dust
{
if (Engine.land().isWater(point3d.x, point3d.y))
shrapnelSplashWater(point3d, 5, 9, 5F, 0.5F, 0F, 1F, 1F);
else
shrapnelSplashLand(point3d, 5, 9, 5F, 0.5F, 0F);
}
if (i < 2 && point3d.z - Engine.land().HQ_Air(point3d.x, point3d.y) < 20)  //large flak shrapnel splash/dust
{
if (Engine.land().isWater(point3d.x, point3d.y))
shrapnelSplashWater(point3d, 7, 12, 9F, 0.6F, 0F, 1F, 1F);
else
shrapnelSplashLand(point3d, 7, 12, 9F, 0.6F, 0F);
}
}
}


Here are the two new methods to create shrapnel splash/hits. They are used by other methods, such as bomb, rocket and larger shell bursts against objects.

Code: [Select]
public static void shrapnelSplashWater(Point3d point3d, int iLo, int iHi, float fRad, float fScale, float fProb, float fSize, float fTime)
// iLo = low # splashes, iHi = high # splashes, fRad = Gaussian radius, fScale = scaler for splash size, fProb = probability for larger splash/ring, fSize = ring finish size, fTime = ring live time
{
if (Config.isUSE_RENDER())
{
float shrapnelScale;
int i_1 = TrueRandom.nextInt(iLo, iHi);
for (int i_0 = 0; i_0 < i_1; i_0++)
{
Point3d point3d_1 = new Point3d(point3d);
float d = (float)World.Rnd().nextGaussian() * fRad;
point3d_1.x += d;
d = (float)World.Rnd().nextGaussian() * fRad;
point3d_1.y += d;
World.cur();
point3d_1.z = World.land().HQ(point3d_1.x, point3d_1.y);
shrapnelScale = fScale * TrueRandom.nextFloat(0.7F, 1.3F);
if (TrueRandom.nextFloat() < fProb)
{
shrapnelScale = fScale * 1.4F;
o.set(0.0F, 0.0F, 0.0F);
l.set(point3d_1, o);
new ActorSnapToLand("3do/Effects/Explosion/WaterRing.sim", true, l, 0.2F, 1F, fSize, 1.0F, 0.0F, fTime);
}
o.set(0.0F, 90.0F, 0.0F);
l.set(point3d_1, o);
Eff3DActor.New(l, shrapnelScale, "Effects/Explodes/Debris/FragSplash/FontainWater.eff", -1F);
Eff3DActor.New(l, shrapnelScale, "Effects/Explodes/Debris/FragSplash/FontainWater2.eff", -1F);
}
}
}

Code: [Select]
public static void shrapnelSplashLand(Point3d point3d, int iLo, int iHi, float fRad, float fScale, float fProb)
// iLo = low # dustcloud, iHi = high # dustcloud, fRad = Gaussian radius, fScale = scaler for dustcloud, fProb = probability for larger dustcloud
{
if (Config.isUSE_RENDER())
{
float shrapnelScale;
int i_1 = TrueRandom.nextInt(iLo, iHi);
for (int i_0 = 0; i_0 < i_1; i_0++)
{
Point3d point3d_1 = new Point3d(point3d);
float d = (float)World.Rnd().nextGaussian() * fRad;
point3d_1.x += d;
d = (float)World.Rnd().nextGaussian() * fRad;
point3d_1.y += d;
World.cur();
point3d_1.z = World.land().HQ(point3d_1.x, point3d_1.y);
shrapnelScale = fScale * TrueRandom.nextFloat(0.7F, 1.3F);
if (TrueRandom.nextFloat() < fProb)
shrapnelScale = fScale * 1.4F;
o.set(0.0F, 90.0F, 0.0F);
l.set(point3d_1, o);
Eff3DActor.New(l, shrapnelScale, "Effects/Explodes/Debris/FragSplash/FontainLand.eff", -1F);
Eff3DActor.New(l, shrapnelScale, "Effects/Explodes/Debris/FragSplash/FontainLand2.eff", -1F);
}
}
}
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

raf1659

  • member
  • Offline Offline
  • Posts: 362
Re: Adding shrapnel splash for AAA airbursts
« Reply #7 on: August 23, 2023, 04:17:32 AM »

For me, shrapnel splashes are only needed from 40mm up, otherwise I fear a drop in FPS  :-X
Logged

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 6033
Re: Adding shrapnel splash for AAA airbursts
« Reply #8 on: August 23, 2023, 06:21:44 AM »

I can assure you, the other stuff going on is VASTLY more impactful. This little effect is a non event in the larger scheme. I've flown a number of test flights to confirm this.

Consider a 6-gun volley of .50 cal, where each splash is, say, 8 particles, all of which live longer than a second. In 1 second, those guns together put out about 72 rounds. Multiplied by 8 particles per effect, and you have 576 particles. Now, recall all the water splashes, and smokes, and fires, and muzzle flashes, etc., going on in a halfway busy naval action. There can be tens of thousands of particles being generated each second.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 6033
Re: Adding shrapnel splash for AAA airbursts
« Reply #9 on: August 23, 2023, 06:43:29 AM »

Just to toss in here... I'm looking to add a new effect I'm developing, which needs to be refined and, more importantly, to be restricted to ONLY the largest guns. As seen in the screenie below all guns of weapon type "cannon" currently create the new surface shock effect. I want to have this apply only to the BIG guns, of at least 12" calibre. (I've posted a query for a hint on how to achieve this in the Super School.) This gives an idea of what I'm striving for. The blast creates a circular splotch of disturbed surface water directly under the muzzle, which fades away after 3 seconds.

Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

shardana

  • member
  • Offline Offline
  • Posts: 861
Re: Adding shrapnel splash for AAA airbursts
« Reply #10 on: August 23, 2023, 07:03:57 AM »

I'm really thinking that once your work is delivered to us this sim will be the best effect wise. I mean this is absolutely mind blowing!!
Logged

WxTech

  • Modder
  • member
  • Online Online
  • Posts: 6033
Re: Adding shrapnel splash for AAA airbursts
« Reply #11 on: August 23, 2023, 07:12:44 AM »

It was easier to restrict the surface shock to the desired guns than I had feared. I've incorporated a check for those weapons whose muzzle flash effect is located in folder, "Effects/BigShip/350mm/". Now only the biggest guns, which make the biggest muzzle fire/smoke, are acompanied by this new effect. Here, in spite of numerous smaller guns firing, only the big 'uns cause this surface disturbance.

Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1] 2   Go Up
 

Page created in 0.046 seconds with 26 queries.