Special Aircraft Service

Please login or register.

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

Author Topic: Further refinement of Napalm behavior  (Read 320 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Further refinement of Napalm behavior
« on: March 24, 2024, 11:39:09 AM »

Many years ago CY6 introduced his NEW Napalm Mod, which has been incorporated into B.A.T., at least in part. Its outstanding feature was the stream of fire running along the ground, simulating the dispersal of the tank's contents along the flight path. But there were some less that great aspects as well:

1) There were 15 to 20 fire streams tied to a special bomblet weapon, all creating the fire running along the ground. This made for a lot of resource-demanding effect particles.

2) Each of these streams had its own terminal explosion; again, a lot of effects particles impacting precious resource capacity.

3) These terminal explosions invoked the same effects for such ordnance as rockets, which looks quite out of place.

4) The terminal explosions tended to be bunched toward the end of the fire stream cluster, somewhat removed from the initial ground impact.

5) There was an instantaneous explosion upon tank bursting that imparted damage to nearby objects.



I've been going over this business the past couple of days. My refinements, addressing the same points above:

1) The former 15-20 fire stream count has been reduced to just 1.

2) Only 3 other bomblets are used for the terminal explosions

3) These terminal explosions are napalm-like fireballs which turn to black smoke (requires my modded Explosions.class and relevant modded weapons classes.)

4) I use a simple algorithm to space the terminal explosions (fireballs) uniformly along the fire stream.

5) I have essentially no initial, instantaneous explosion, relying instead on the damage imparted later for each of the terminal explosions.



Moreover, I add a number of small ground fires over the affected area, with a chance of an associated smoke column that lasts for a minute or two. These particles and the fireballs do take away somewhat from the resource savings achieved by the reduced stream count and their associated explosion effects. But on balance a far more realistic behaviour is realized with no worse impact, and perhaps a bit better performance.

The result is a stream of fire running along the ground, with no imparted damgage at first. The eruption of the bigger fireballs a second or two later have their associated damage-inducing impact. In the aftermath, a number of ground fires, with perhaps a smoke column, remain in place for a little while.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Whiskey_Sierra_972

  • Modder
  • member
  • Offline Offline
  • Posts: 6508
  • In memory of my beloved hero: Saburo SAKAI!
Re: Further refinement of Napalm behavior
« Reply #1 on: March 24, 2024, 12:36:14 PM »

Stunning as always mate!
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Re: Further refinement of Napalm behavior
« Reply #2 on: March 24, 2024, 02:05:23 PM »

Additional tweaking. There is a range in the quantity of a tank's contents, from 55 gallons to 175. I've separated the eight classes into three groups, where the smallest tanks generate 2 of the big fireballs, the mid-sized ones create 3 fireballs, and the largest make 4 fireballs. Moreover, I apply a bit of a range in the velocity of advancement of the underlying fire stream so that the larger tanks have a longer path of fire along the ground, upon which the larger number of fireballs are strung. And so the bigger tanks have greater coverage for a given impact velocity, and hence more destructive potential.

It's proving tricky to constrain the damage nice and closely to the area covered by fire. The base class handling of the incendiary ordnance (phosphorous, Napalm and other incendiary devices) is crude and quite illogical. I have made a number of significant changes so as to better rationalize the handling of such weapons. But there remain certain limitations to the way the different weapons are differentiated, which I didn't want to depart to greatly from in order to not cause unintended consequences for a number of weapons I haven't specifically dealt with.

But I am getting the damage to NOT occur at overly far distances from the fire, which is a start. ;)
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Draken

  • member
  • Offline Offline
  • Posts: 1124
Re: Further refinement of Napalm behavior
« Reply #3 on: March 25, 2024, 07:42:00 AM »

How does real napalm explosion looks like ?
Is it like in the movie " Apocalypse now " ?
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Re: Further refinement of Napalm behavior
« Reply #4 on: March 25, 2024, 09:25:32 AM »

A sequence of the dropping of a pair of 175 gallon (largest) napalm tanks from a P-38.

The fireballs rise convectively as they expand somewhat in size, slowly rolling to suggest the internal differential convection. The dark smoke becomes more dominant as the fire fades, suggesting the formation of soot upon cooling. This big smoke cloud fades away several seconds after the fireballs have disappeared. There remain a number of scattered ground fires for a minute or two, disappearing after differing intervals (they don't all disappear at the same time.) There are randomly generated tendrils of fire, in this sequence almost none.

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

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Re: Further refinement of Napalm behavior
« Reply #5 on: March 25, 2024, 11:04:42 AM »

Here's the new method for generating the napalm effects that I've added to Explosions.class:

Code: [Select]
public static void generateNapalm(Actor actor, Point3d point3d)
{
if (Config.isUSE_RENDER())
{
Loc loc = new Loc(point3d);
o.set(0.0F, 90.0F, 0.0F);
loc.set(point3d, o);
Vector3d vector3d = new Vector3d();
float sizeScale = TrueRandom.nextFloat(0.75F, 1.0F);
Eff3DActor.New(loc, sizeScale, "3DO/Effects/Fireworks/Napalm_Burn.eff", -1F);
Eff3DActor.New(loc, sizeScale, "3DO/Effects/Fireworks/Napalm_Smoke.eff", -1F);
float tim = TrueRandom.nextFloat(45F, 120F);
if (World.Sun().ToSun.z < 0.0F)
{
float scaleLight = MiscEffects.cvt(World.Sun().ToSun.z, -0.25F, 0.0F, 1.0F, 0.5F);
Eff3DActor eff3dactor = Eff3DActor.New(loc, 1.0F, "Effects/Explodes/Cannon/Object/light.eff", 8F);
eff3dactor.postDestroy(Time.current() + 8000L);
LightPointActor lightpointactor = new LightPointActor(new LightPointWorld(), new Point3d());
lightpointactor.light.setColor(1.0F, 0.6F, 0.2F);
lightpointactor.light.setEmit(0.33F * scaleLight, 300F * scaleLight);
eff3dactor.draw.lightMap().put("light", lightpointactor);
}

if (TrueRandom.nextFloat() < 0.33F)
{
int i_1 = TrueRandom.nextInt(3, 6);
for (int i = 0; i < i_1; i++)
{
vector3d.set(TrueRandom.nextDouble(-22D, 22D), TrueRandom.nextDouble(-22D, 22D), TrueRandom.nextDouble(24D, 7D));
BallisticProjectile ballisticprojectile = new BallisticProjectile(point3d, vector3d, TrueRandom.nextFloat(3F, 5F));
Eff3DActor.New(ballisticprojectile, null, null, 1.0F, "3DO/Effects/Fireworks/Napalm.eff", -1F);
Eff3DActor.New(ballisticprojectile, null, null, 1.0F, "3DO/Effects/Fireworks/Napalm_Smokes.eff", -1F);
}
Eff3DActor.New(loc, 1.0F, "3DO/Effects/Fireworks/Napalm_Persistent_Smoke.eff", tim);
}
int i_3 = TrueRandom.nextInt(2, 5);
for (int i_2 = 0; i_2 < i_3; i_2++)
{
Point3d point3d_3 = new Point3d(point3d);
float d = (float)World.Rnd().nextGaussian() * 10F;
if (Math.abs(d) > 20F)
d /= 2F;
point3d_3.x += d;
d = (float)World.Rnd().nextGaussian() * 10F;
if (Math.abs(d) > 20F)
d /= 2F;
point3d_3.y += d;
World.cur();
point3d_3.z = World.land().HQ(point3d_3.x, point3d_3.y);
Loc loc_3 = new Loc(point3d_3);
o.set(0.0F, 90.0F, 0.0F);
loc_3.set(point3d_3, o);
Eff3DActor.New(loc_3, TrueRandom.nextFloat(0.5F, 0.9F), "Effects/Explodes/Objects/House/FuelSmall/Boiling2.eff", tim * TrueRandom.nextFloat(0.6F, 1.0F));
}
}
}


The foregoing new method is called by method generate() in the same Explosions.class. I've created the code below, inside existing method generate(), so as to differentiate reliably between the three basic types of NAPALM (incendiary, really) ordnance; napalm, phosphorous and other incendiaries. Note the total of six NEW methods (of which generateNapalm is one) created so as to generate properly unique effects for the ordnance. The initial check for "i == 2" denotes the weapons of type 'NAPALM' (incediaries). "f" is the power value in the weapon's class, and "f1" is the radius for the explosive effect. I've expanded upon the scheme already in use, which principally differentiates between the three incendiary types by the radius (f1) value. It's not particularly elegant, and there's limited room to get clever. But I've adhered to the basic framework and it works well enough now.

Code: [Select]
if (i == 2)
{
if (f == 0.0F && f1 == 0.0F)
{
generateIncendiaryBomblet(actor, point3d);
return;
}
if (f1 > 0.0F && f1 < 3.0F)
{
if (f < 1.0F)  //f = power
{
generateWPBurstSmall(actor, point3d);
f = 4.0F;
}
else  //if (f >= 1.0F)
{
generateWPBurstLarge(actor, point3d);
f = 15.0F;
}
}
if (f1 >= 3.0F && f1 < 50F)
{
if (f < 4.0F)
{
generateIncendiarySmall(actor, point3d);
f = 0.5F;
}
else  //if (f >= 4.0F)
{
generateIncendiaryLarge(actor, point3d);
f = 4.0F;
}
}
if  (f1 >= 50.0F)
{
generateNapalm(actor, point3d);
return;
}
}

For comparison, here's the stock treatment of the preceding. It is much simpler, using one basic "Termit1" effect (randomly selected from two variations), and if the radius value is >= 3 some 36 ballistic particles are created and which emit the "PhosfourousFire" effect. Extremely limited.

Code: [Select]
if(i == 2)
{
if(f1 < 3F)
{
switch(World.rnd().nextInt(1, 2))
{
case 1: // '\001'
Eff3DActor.New(actor, null, rel, 1.0F, "3DO/Effects/Fireworks/Termit1W.eff", 10F);
break;

case 2: // '\002'
Eff3DActor.New(actor, null, rel, 1.0F, "3DO/Effects/Fireworks/Termit1SM.eff", -1F);
break;
}
} else
{
Vector3d vector3d = new Vector3d();
for(int j = 0; j < 36; j++)
{
vector3d.set(World.rnd().nextDouble(-20D, 20D), World.rnd().nextDouble(-20D, 20D), World.rnd().nextDouble(3D, 20D));
float f2 = World.rnd().nextFloat(3F, 15F);
BallisticProjectile ballisticprojectile = new BallisticProjectile(point3d, vector3d, f2);
Eff3DActor.New(ballisticprojectile, null, null, 1.0F, "3DO/Effects/Fireworks/PhosfourousFire.eff", f2);
}

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

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Re: Further refinement of Napalm behavior
« Reply #6 on: March 25, 2024, 11:54:26 AM »

House.class handles objects in static.ini. Originally, all objects given the Body type of "Rock" (RockMiddle, RockBig and RockHuge) could not be damaged or destroyed by the "NAPALM" (incendiary) type of ordnance. The idea being that rock, brick, earth, etc., is not flammable. The problem with this is that a LOT of objects such as houses and other burnable things are assigned the Rock Body type.

I'm about to try a small change in this class where the smaller of the three Rock Body types (RockMiddle) is destructible. This would leave the other two, larger Rock types as invulnerable to incendiaries. The notion here is that smaller structures will include such things as houses, sheds and so on. The big stuff would be fortifications, castles, big buildings, etc.

The operative part in the code change is the consideration of the property, EXPL_TYPE, in addition to MAT_TYPE, the former of which is assigned in another method in House.class, and based on the Body type specified in static.ini. For the Rock types, in order of increasing size EXPL_TYPE is 2, 3 and 4. I now allow EXPL_TYPE = 2 to be destructible by incendiary ordnance (provided the panzer value is small enough).

Ideally, care should be given to the assignment of Body type (Wood, Rock, Fuel, Flesh, Vehicle) to an object when added to static.ini. I've seen many head-scratching oddities among newly added mod objects over the years, suggesting a lack of awareness of the role played by the code in House.class. ;)

In House.class, the portion under consideration here is at the bottom:
Code: [Select]
public void msgExplosion(Explosion explosion)
{
return;
if(explosion.power <= 0.0F)
return;

/*        if(prop.MAT_TYPE == 3)  //if FLESH, easy destruction by bombs, for all powerType (0, 1 or 2)
{
if(Explosion.killable(this, explosion.receivedTNT_1meter(this), 0.005F, 0.1F, 0.0F))  //MIN_TNT, MAX_TNT, PROBAB_DEATH_WHEN_EXPLOSION
die(explosion.initiator, true);
return;
}  */

Explosion _tmp = explosion;
if(explosion.powerType == 1)  //splinters
{
float af[] = new float[6];
mesh().getBoundBox(af);
pos.getAbs(p);
p.x = (p.x - (double)af[0]) + (double)(af[3] - af[0]);
p.y = (p.y - (double)af[1]) + (double)(af[4] - af[1]);
p.z = (p.z - (double)af[2]) + (double)(af[5] - af[2]);
float af1[] = new float[2];
explosion.computeSplintersHit(p, mesh().collisionR(), 0.7F, af1);
Explosion _tmp1 = explosion;
float f = 0.015F * af1[1] * af1[1] * 0.5F;
float f1 = ComputeProbabOfPenetrateKill(f, (int)(af1[0] + 0.5F));
if(RndB(f1))
die(explosion.initiator, true);
return;
}

Explosion _tmp2 = explosion;
if(explosion.powerType == 0)  //blast pressure
{
if(Explosion.killable(this, explosion.receivedPower(this), prop.MIN_TNT, prop.MAX_TNT, prop.PROBAB_DEATH_WHEN_EXPLOSION))
die(explosion.initiator, true);
return;
}

//if powerType other than 1 or 0; e.g., 2=NAPALM (includes incendiaries and phosphorous)
if(prop.MAT_TYPE == 1 && (prop.EXPL_TYPE == 3 || prop.EXPL_TYPE == 4))  //if BRICK (RockMiddle(2), RockBig(3), RockHuge(4)), napalm/incendiaries/phosphorous won't destroy; now RockMiddle(2) can be destroyed
{
return;
} else  //if MAT_TYPE = 0 (WOOD) or 2 (STEEL) [or 3 (FLESH) if disabled above]; napalm/incendiaries/phosphorous will destroy
{
die(explosion.initiator, true);
return;
}
}
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 25 queries.