Special Aircraft Service

Please login or register.

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

Author Topic: P-39 Airacobra can strafe ships!  (Read 1350 times)

0 Members and 1 Guest are viewing this topic.

Dimlee

  • member
  • Offline Offline
  • Posts: 1254
Re: P-39 Airacobra can strafe ships!
« Reply #12 on: March 17, 2024, 02:06:10 PM »

What took you so long mate!

The first thing that sprung to mind was, I bet Russians flew this P-39.
I have to work out now how to transfer this code to other earlier versions.

I'm sure that many players will appreciate your efforts. And if this strafing sauce magic crystal code can be added to other models that historically were involved in the strafing of the ships... Beafighters, A-20G (in the Soviet VMF service definitely), PB4Y-2, Ar-196, etc.
Years ago, I saw a documentary where the navigator of the MBR-2 attacked something in the Black Sea with all the might of his PV-1 machine gun...
Logged

Knochenlutscher

  • Flying Ass Clown #10
  • Modder
  • member
  • Offline Offline
  • Posts: 4585
  • aka Segfej
Re: P-39 Airacobra can strafe ships!
« Reply #13 on: March 18, 2024, 12:31:53 PM »

Hi guys

Tonight I discovered that AI flying P-39N and Q models will strafe ships, from landing craft to destroyers.
Perhaps this is common knowledge but I have never seen this discussed before, does anyone know of other aircraft that can do the same?

Can the "Special Sauce" that makes them behave this way be added to other aircraft that actually stafed ships?
In particular Beaufighters and P-40s.

It can't work.
P_39N has the most simple Il-2 1946 code implement called Aircraft
what you encounter is an effective Gun code in a well prepped Mission.
It's the most basic code.
The simple trick is to put the P_39N into a good Mission,
sideeffect, in any bad Mission, the Effect can't be seen.

What happens when you implement only Aircraft as replacement for other
special habbits will be a complete disaster codewise.
You can turn a Game unplayable literally.

TypeAmphibious, TypeSeaPlane, TypeStormovik, TypeBomber, TypeFighter, etc. has it's own meaning.
No K-14 Gunsight, No Bombsight available for Player, nor the special abilities for AI that comes with certain code.

R/L examples of code you ever wondered why this happens in AI habbits:

Pe-3 is set to TypeFighter, contrary to an early Pe-2 set to TypeBomber, TypeDiveBomber.
Hence I would prepare for headon and turning muddafakkas Pe-3.
Fw190A Series has TypeFighter and TypeBnZFighter
Fw190F series TypeStormovik

TypeStormovik is AI yelling at "Aircraft code", you traitors, you pussies, then go straight in.
Often the cause for them not returning home, while Aircraft coded do return.



Hope this helps
Tobias
Logged
Wiseman : "Did you speak the exact words?" Ash : "Look, maybe I didn't say every single little tiny syllable, no. But basically I said them, yeah."

genXgamer

  • member
  • Offline Offline
  • Posts: 1358
Re: P-39 Airacobra can strafe ships!
« Reply #14 on: March 18, 2024, 03:11:51 PM »

Very interesting, thanks for taking the time to explain the above.

Is it possible to create a new Beaufighter for example, call it Beaufighter AI and give it the Aircraft code?
Early war especially in the Pacific, Beaufighters strafed their targets and on many occasions these were ships/landing craft.

As you can tell this is not a side of the game I've explored/dabbled with yet.
Logged
Go in quickly - Punch hard - Get out!

Knochenlutscher

  • Flying Ass Clown #10
  • Modder
  • member
  • Offline Offline
  • Posts: 4585
  • aka Segfej
Re: P-39 Airacobra can strafe ships!
« Reply #15 on: March 19, 2024, 02:25:06 PM »

This is Beaufighter Mk.X

Code: [Select]
// Referenced classes of package com.maddox.il2.objects.air:
//            BEAU, PaintSchemeBMPar02, TypeFighter, TypeStormovik,
//            NetAircraft, Aircraft

public class BEAU10 extends com.maddox.il2.objects.air.BEAU
    implements com.maddox.il2.objects.air.TypeFighter, com.maddox.il2.objects.air.TypeStormovik

Aircraft+TypeFighter+TypeStormovik
That is perfect, why do you want to change it?

Has nothing to do with Code, Java, your Problem is with the Missions.

Then make sure the Mission is coded to fit an aircraft type best. If you care.
If you do not care, chose another Mission until you get the result.

I can't tell anything else. Other that I have 16 Years basic FMB and advanced QMB Business on my back.
Learning this, will ease your game experience, as you understand
game mechanics, how Missions and AI work, what is possible and what not.

Best wishes
Tobias
Logged
Wiseman : "Did you speak the exact words?" Ash : "Look, maybe I didn't say every single little tiny syllable, no. But basically I said them, yeah."

genXgamer

  • member
  • Offline Offline
  • Posts: 1358
Re: P-39 Airacobra can strafe ships!
« Reply #16 on: March 20, 2024, 02:31:09 AM »

Did your reply get edited since this morning or did I simply read it the wrong way?
My response was going to have a slightly different tone to it.

Anyhow neither the Beaufighter MkX, MkX CC or MkX CR will strafe ships.
Here's a list of Allied aircraft that I've found thus far.

P-39N1
P-39N-1 VVS
P-39Q1
P-39Q10
P-39Q-30 VVS

B25G-1NA
B25H-1NA

Mosquito MkXVIII
Mosquito FBMkXVIII
Tse Tse XVIII
Logged
Go in quickly - Punch hard - Get out!

Knochenlutscher

  • Flying Ass Clown #10
  • Modder
  • member
  • Offline Offline
  • Posts: 4585
  • aka Segfej
Re: P-39 Airacobra can strafe ships!
« Reply #17 on: March 20, 2024, 09:55:32 AM »

You wouldn't post such list if you have read and understood my previous two Posts.

Please reread them.

BTW. it's my last, I hate ignorance and wrong accusations over the fact of trying to help.
I have better stuff to do.


Tobias

Logged
Wiseman : "Did you speak the exact words?" Ash : "Look, maybe I didn't say every single little tiny syllable, no. But basically I said them, yeah."

Dimlee

  • member
  • Offline Offline
  • Posts: 1254
Re: P-39 Airacobra can strafe ships!
« Reply #18 on: March 20, 2024, 03:49:29 PM »

Well, we all have our bad days... It happens.

I assume that Tobias wants to say that some AI aircraft will strafe the ships if you set the mission parameters right. Maybe so. I wonder what should be done. A combination of speeds and altitudes as with the torpedo runs, probably.
I hope to find time to experiment with other types not (yet) included in the list of genXgamer.
Logged

Knochenlutscher

  • Flying Ass Clown #10
  • Modder
  • member
  • Offline Offline
  • Posts: 4585
  • aka Segfej
Re: P-39 Airacobra can strafe ships!
« Reply #19 on: March 20, 2024, 07:11:00 PM »

Had a bad day, felt stepped on my toes. Over reacted, sorry GenX.

Dunno, can't tell for Mission specifics, despite my long experience.
For testing Mods, weapons, AI, I use QMB, tinkering with real Missions,
timed, orchestrated stuff I have no time for sadly. That were real FMB experts gain bonus.
Others can tell about that.

It's funny, but Torpedos I do test in a plain simple QMB Mission.


Code: [Select]
// Referenced classes of package com.maddox.il2.objects.air:
//            B_25, PaintSchemeBMPar03, TypeBomber, TypeStormovik,
//            TypeStormovikArmored, Aircraft, NetAircraft

public class B_25G1 extends com.maddox.il2.objects.air.B_25
    implements com.maddox.il2.objects.air.TypeBomber, com.maddox.il2.objects.air.TypeStormovik, com.maddox.il2.objects.air.TypeStormovikArmored

This one should be interessting
Logged
Wiseman : "Did you speak the exact words?" Ash : "Look, maybe I didn't say every single little tiny syllable, no. But basically I said them, yeah."

genXgamer

  • member
  • Offline Offline
  • Posts: 1358
Re: P-39 Airacobra can strafe ships!
« Reply #20 on: March 20, 2024, 09:37:02 PM »

I appreciate your reply Tobias.
The last thing I want is to have bad blood between us, all is forgiven.
If I offended you by making untrue accusations then I truly apologise.
Logged
Go in quickly - Punch hard - Get out!

vonofterdingen

  • Missioneer
  • member
  • Offline Offline
  • Posts: 1316
Re: P-39 Airacobra can strafe ships!
« Reply #21 on: March 20, 2024, 10:33:48 PM »

@GenX, given that an aircraft such as the Beaufighter will attack ships if armed with bombs, is there some bomb-like attribute that could be assigned to guns or cannon that would trigger AI to attack ships with those weapons?
Logged

Knochenlutscher

  • Flying Ass Clown #10
  • Modder
  • member
  • Offline Offline
  • Posts: 4585
  • aka Segfej
Re: P-39 Airacobra can strafe ships!
« Reply #22 on: March 21, 2024, 12:49:38 AM »

I don't want such things too, just continue discussions. I apologized,
no need for you. Good that some FMB experts joined, as my experience has an end at certain things.

But the thing I encountered when doing the P-40P for BAT, I gave her TypeStormovik, this triggeres certain manouevers in Aircaft implement.

Aircraft is a long list of AI behaviour, some need specific calls to work, like Stormovik.

You can try the P-40s, there are Aircraft only, and those Type Fighter/Type Stormovik ontop enabled.

Try both on the same Mission and the behavior, it's slightly different I think.

BAT ElAlamein/QMB RedAirbase 1500mm (stiff Air Defense)

4-8-16 Flights

P_40P (Bombs) Aircraft/TypeFighter/TypeStormovik

P_40M (Bombs) only Aircraft

16 Flights is best, as you can watch longer how AI reacts.
Best wishes
Logged
Wiseman : "Did you speak the exact words?" Ash : "Look, maybe I didn't say every single little tiny syllable, no. But basically I said them, yeah."

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23933
  • Taking a timeout
    • STFU
Re: P-39 Airacobra can strafe ships!
« Reply #23 on: March 21, 2024, 01:25:56 AM »

Allow me to elucidate this matter for you. Evidently, we have two parties involved here. On one side, we have the victim of the attack - in this instance, the ship.

Victims are required to implement the "Prey" Interface, which stipulates that they have a "HitbyMask()" method. This method returns an integer value indicating the types of weapons that can be used against the victim. The returned integer is a binary mask value from the "WeaponTypes" class:

Code: [Select]
public static final int BULLET_LIGHT = 1;
public static final int BULLET_HEAVY = 2;
public static final int SHELL = 4;
public static final int ROCKET = 8;
public static final int BOMB = 16;
public static final int NONE = 0;
public static final int ALL = -1;
public static final int ALL_EXCEPT_LIGHT = -2;

Ships typically return -2 (ALL_EXCEPT_LIGHT) in "HitbyMask()" (I am not aware of any exceptions to this rule). Tanks, Cars, Artillery, Searchlights, Beacons or any "generic" stationary object with a "Panzer" value set lower than 0.015 (in technics.ini) return "-1" (ALL), otherwise they return -2 (ALL_EXCEPT_LIGHT) as well.
This makes sense when you consider it. Armoured entities require "heavy" bullets, also known as Cannons, while others can be attacked with any gun.

So, what makes ships so special?

This is where the other party comes into play - the attacker. Attacking AI planes use a simplified flight model which inherits the "Pilot" class. This class dictates what an AI pilot does (and what it does not do). Herein, when the waypoint type is "GATTACK" (ground attack) and the target where the GATTACK waypoint is set to is still alive, we have a code block starting with...

Code: [Select]
if ((this.target_ground instanceof Prey) && (((Prey)this.target_ground).HitbyMask() & WeaponTypes.BULLET_LIGHT) == 0)
This can be interpreted as: If the target is of "Prey" type (i.e., it defines what you can hit it with) but you cannot hit it with "light" bullets (aka guns), then...

What follows next is a block of code which iterates through all remaining weapons on the attacking aircraft, calculating the heaviest "bullet" remaining. "Bullet" in this context can also be a rocket or bomb. The simple logic here is: If the heaviest "bullet" weight is less than 0.08kg, then don't perform the ground attack at all. The reasoning behind this is probably "don't strafe ground targets with peashooters" - sort of.

The next logic step is crucial: If the target is a ship, then raise the minimum "bullet" weight for performing an attack to 0.55kg. That's quite a lot. For comparison, the weight of an MK 108 bullet is 0.33kg, the one of an MK 101 / 103 is 0.355kg. Those guns, therefore, would not qualify for attacking a ship. So, which guns do? Well, for instance, German "BK" guns such as the BK 37 (Ju-87, Bf 110, Hs 129), the BK 5 (Me-410, Me-262) or the allied "M4" (P-39) do.

That's the crux of the matter. Further on, the code will check the type of weapon available for attacking the ship, naturally preferring Torpedos over Bombs over Rockets over Guns, and set the "Maneuver" task accordingly. If no Torpedo, Bomb or Rocket is available, but the gun is heavy enough to qualify for attacking the ship, AI will strafe it.

]cheers[
Mike
Logged
Don't split your mentality without thinking twice.
Pages: 1 [2] 3   Go Up
 

Page created in 0.03 seconds with 25 queries.