Loading [MathJax]/extensions/Safe.js

Special Aircraft Service

Please login or register.

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

Author Topic: Effects remaining attached to 'invisible' hooks  (Read 713 times)

0 Members and 1 Guest are viewing this topic.

Whiskey_Sierra_972

  • Modder
  • member
  • Offline Offline
  • Posts: 6798
  • In memory of my beloved hero: Saburo SAKAI!
Re: Effects remaining attached to 'invisible' hooks
« Reply #12 on: April 12, 2025, 09:17:32 AM »

That's a very interesting aspect....I'm unable to undestand java....but I wish you to find the end of the problem!
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6252
Re: Effects remaining attached to 'invisible' hooks
« Reply #13 on: April 13, 2025, 11:14:04 PM »

I think I've found the problem.

In AircraftState we have:

Code: [Select]
    public static final int astateEffectsDispTanks = 0;
    public static final int astateEffectsDispEngines = 8;
    public static final int astateEffectsDispLights = 18;
    public static final int astateEffectsDispLandingLights = 24;
    public static final int astateEffectsDispOilfilters = 28;

In B.A.T. 4.0 Aircraft.class methods cut() and cut_Subtrees() these values are out of sync, which I noticed long ago but thought must be for some good reason I couldn't divine. Only now did it begin to dawn on me that this mustn't be right. For instance:

Code: [Select]
public boolean cut(String s)
{
FM.dryFriction = 1.0F;
debugprintln("" + s + " goes off..");
if(World.Rnd().nextFloat() < bailProbabilityOnCut(s))
{
debugprintln("BAILING OUT - " + s + " gone, can't keep on..");
hitDaSilk();
}
if(!isChunkAnyDamageVisible(s))
{
debugprintln("" + s + " is already cut off - operation rejected..");
return false;
}
int ai[] = hideSubTrees(s + "_D");
if(ai == null)
return false;
for(int i = 0; i < ai.length; i++)
{
Wreckage wreckage = new Wreckage(this, ai[i]);
for(int l = 0; l < 4; l++)
if(hierMesh().chunkName().startsWith(FM.AS.astateEffectChunks[l + 0]))
FM.AS.changeTankEffectBase(l, wreckage);

for(int i1 = 0; i1 < FM.EI.getNum(); i1++)
if(hierMesh().chunkName().startsWith(FM.AS.astateEffectChunks[i1 + 4]))  //should be + 8  <----------------------
{
FM.AS.changeEngineEffectBase(i1, wreckage);
FM.AS.changeSootEffectBase(i1, wreckage);
}

for(int j1 = 0; j1 < 6; j1++)
if(hierMesh().chunkName().startsWith(FM.AS.astateEffectChunks[j1 + 12]))  //should be + 18  <----------------------
FM.AS.changeNavLightEffectBase(j1, wreckage);

for(int k1 = 0; k1 < 4; k1++)
if(hierMesh().chunkName().startsWith(FM.AS.astateEffectChunks[k1 + 18]))  //should be + 24  <----------------------
FM.AS.changeLandingLightEffectBase(k1, wreckage);

for(int l1 = 0; l1 < FM.EI.getNum(); l1++)
if(hierMesh().chunkName().startsWith(FM.AS.astateEffectChunks[l1 + 22]))  //should be + 28  <----------------------
FM.AS.changeOilEffectBase(l1, wreckage);

if(hierMesh().chunkName().startsWith(s) && World.Rnd().nextInt(0, 99) < 50)
Eff3DActor.New(wreckage, null, null, 1.0F, Wreckage.SMOKE, 3F);
Vd.set(FM.Vwld);
wreckage.setSpeed(Vd);
}

ai = hierMesh().getSubTrees(s + "_D");
for(int j = 0; j < ai.length; j++)
detachGun(ai[j]);

String s1 = s + "_CAP";
if(hierMesh().chunkFindCheck(s1) >= 0)
hierMesh().chunkVisible(s1, true);
for(int k = 0; k < ai.length; k++)
{
for(int i2 = 3; i2 < FM.Gears.pnti.length; i2++)
try
{
if(FM.Gears.pnti[i2] != -1 && ai[k] == hierMesh().chunkByHookNamed(FM.Gears.pnti[i2]))
FM.Gears.pnti[i2] = -1;
}
catch(Exception exception)
{
System.out.println("FATAL ERROR: Gear pnti[] cut failed on tt[] = " + i2 + " - " + FM.Gears.pnti.length);
}

}

hierMesh().setCurChunk(ai[0]);
hierMesh().getChunkLocObj(tmpLoc1);
sfxCrash(tmpLoc1.getPoint());
return true;
}

With appropriately altered values in Aircraft.cut(), I get this agreeable result (the two big fires are from fuel tank hooks). Until now, the engine fire/smoke would still be attached to the places where the engines were mounted on the wing. Now the missing engines have no ghost hook effects, and that the oil/engine smoke/fire from the two are attached to the chunks separated and falling in the background. Strangely, the chunks shown are the rear part of the nacelles, and not the actual engine/cowl section forward. But this is a VAST improvement. I have yet to make the numerical fixes to cut_Subtrees().

This would explain why I would often get an inappropriate cut part, such as a vertical stabilizer/wire aerial segment, with the oil damage smoke attached! And it might whip around in a LARGE loop as it fell, and maintain that loop for a couple or few revolutions after hitting the ground.

I would ask anyone flying B.A.T. to check if they are getting this problem of engine smoke/fire effects remaining attached where engines used to be. If not, then I must wonder why the Aircraft.class file in the collection of B.A.T. 4 resolved classes I downloaded has this discrepancy...

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: 6252
Re: Effects remaining attached to 'invisible' hooks
« Reply #14 on: April 14, 2025, 12:54:23 AM »

I hate to think on how many hours I've spent in trying to track down this gremlin; it must be in the range of 30! And it turns out to be so bloody obvious. As I indicated, in the resolved classes I downloaded this bad error was present, and it had me fooled into thinking it must be so for some reason. If only I had tried that simple change way back then! I also have decompiled the Engine Mod classes, from those supplied in the supplied #WAW3/SAS_Engine_Mod/ folder if my memory doesn't fail me; the same issue is present.

I really need to know now if this is still afflicting B.A.T. Anyone care to look?

Anyway, it feels so good to finally have it licked.
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: 6798
  • In memory of my beloved hero: Saburo SAKAI!
Re: Effects remaining attached to 'invisible' hooks
« Reply #15 on: April 14, 2025, 06:12:36 AM »

I hate to think on how many hours I've spent in trying to track down this gremlin; it must be in the range of 30! And it turns out to be so bloody obvious. As I indicated, in the resolved classes I downloaded this bad error was present, and it had me fooled into thinking it must be so for some reason. If only I had tried that simple change way back then! I also have decompiled the Engine Mod classes, from those supplied in the supplied #WAW3/SAS_Engine_Mod/ folder if my memory doesn't fail me; the same issue is present.

I really need to know now if this is still afflicting B.A.T. Anyone care to look?

Anyway, it feels so good to finally have it licked.

If you like , and you specify me which , I can send you the BAT 4.3 file to check , but I'm unable to decompile....
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6252
Re: Effects remaining attached to 'invisible' hooks
« Reply #16 on: April 14, 2025, 09:30:19 AM »

Thanks for the inadvertent reminder, Walter. I was very tired last night, and went right to bed after verifying the matter.

I do have a couple other class dump archives, one shown as B.A.T. 4.1.3 and the other as B.A.T. 4.2.2. Both show the same issue, whereby in Aircraft.class the sequencing for astateEffectChunks[] is, 0, 4, 12, 18, 22 when it should be 0, 8, 18, 24, 28 (as set in AircraftState.class).

If you can grab the B.A.T. 4.3 classes, they would be

com/maddox/il2/fm/AircraftState.class
com/maddox/il2/objects/air/Aircraft.class


If you must troll through a pile of hashed classes, they would be for AircraftState.class:
  562CFC148AD509E2
  B27261D242F3990A

For Aircraft.class:
  4B598398AD1D180C
  4352BC2624ED0094
  08447B2E29097EB0
  C6A5F9E85251EA22
  C6EF065E28F3732E
  DE723D323178ED64

Thanks!
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: 6252
Re: Effects remaining attached to 'invisible' hooks
« Reply #17 on: April 14, 2025, 09:41:47 AM »

If the later B.A.T. versions do have this issue of wrongly sequenced astateEffectChunks[] in Aircraft.class, BUT IF NO VISIBLE EFFECT DISCREPANCY RESULTS, then I would confess complete mystification.

Does any B.A.T. user find that shot away engines are still showing smoke/fire remaining where the engines used to be?
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: 6252
Re: Effects remaining attached to 'invisible' hooks
« Reply #18 on: April 14, 2025, 12:44:05 PM »

Walter sent me the B.A.T. 4.3 Aircraft.class and AircraftState.class. I see that the incorrect sequencing of astateEffectChunks[] in Aircraft.cut() and Aircraft.cut_Subtrees() remains...
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.043 seconds with 22 queries.