SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
08-08-22, 03:59 PM | #106 |
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Happy to report some progress
I figured out the culprit behind constant crashing into water. Planes have the "Avoid Impact" strategy which should prevent them from crashing, but other strategies did not have a condition preventing them from being applied when plane is "avoiding impact", which caused planes to try to follow two different strategies at once. Adding and !Plane:StrafingTooClose() to bombing/strafing strategy solves the crashing problem - I ran my 6-plane test mission 10 times and only had two instances of plane crashing into water, when before I had on average 2 crashes per single test: Downside (there's always one) is that planes occasionally break off the attack without dropping bombs like in original IRAI script. This seems to be dependent on plane characteristics now, though: for example Swordfish never finishes the run, but Catalina almost always does drop bombs. So the next thing to do is figuring out how to tweak "reluctant" planes to be more agressive. Overall, for 10 attacks: - 2 out of 60 planes crashed - 7 out of 10 Uboats destroyed (most effective planes: Catalina, Sunderland, Martlet. B17 mostly misses, Swordfish and Liberator break off the attack) - 3 Uboats survived, 1 with heavy damage but able to limp back to base
__________________
An elemental spirit summoned up from the Sea of Lament itself and given one purpose, one skill, one desire... to sail! Or, to model hulls and adjust damage zones if no sailing jobs are open. My mods: Little Ships, Air Force Last edited by kapuhy; 08-08-22 at 04:10 PM. |
08-08-22, 04:05 PM | #107 |
Village Idiot
|
Good job Mate!!
Just as I stated before? TDW didn't have everything right. Now. Catalina is a Type=304 SwordFish is a Type=303 Try changing that Last edited by Jeff-Groves; 08-08-22 at 04:14 PM. |
08-08-22, 05:01 PM | #108 |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
I second that
My bet: minimum height, engine HP, aircraft mass, maximum speed. If flight physics were more accurate I would have mentioned drag coefficients as well, but I think those have little effect on SH aircraft. |
08-09-22, 04:50 AM | #109 |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Probably I am going to ask some silly questions but...
|
08-09-22, 05:01 AM | #110 | |||
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Quote:
Quote:
Quote:
In SH5, command syntax is: UnitType:Command(parameters) where unit type might be Plane, Sub or Ship (edit: and, possibly, CostalDefense - it's not used by any scripts but has its own AI commander so... possibly). Now, commands only work with certain types so if you try to write Plane:SetThrottleRatio, game will CTD or ignore command. But if you put Ship:SetThrottleRatio in a strategy used by the plane, game will happily accept it and apply to the plane. I don't know why it works like this, but it does. It was similar with submarine deck guns, which started working after putting "Ship" type condition in their script. EDIT: by the way,I attach the airplane script as it is now if you or someone else would like to take a look.
__________________
An elemental spirit summoned up from the Sea of Lament itself and given one purpose, one skill, one desire... to sail! Or, to model hulls and adjust damage zones if no sailing jobs are open. My mods: Little Ships, Air Force Last edited by kapuhy; 08-09-22 at 05:37 AM. |
|||
08-09-22, 06:52 AM | #111 | ||
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Ops, sorry, exclamation mark is what I meant
Quote:
All in all, I think that using Plane:HasBombs() and Plane:CanFireBombs() OR Plane:HasCannons() and Plane:CanFireCannons() as precondition of the parent strategy, might be preferable Quote:
I will Last edited by gap; 08-09-22 at 07:06 AM. |
||
08-09-22, 07:08 AM | #112 | |
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Quote:
The problem with SetCourseBombs is, as I see it, that despite its name it does not put the plane in position that is considers correct to drop bombs (unless target is motionless, which leads me to believe problem is connected to not leading the target). So the maneuver part of the script is executed over and over while shooting part waits for target to enter the crosshairs. Strafe behaviour works because it (by pure accident) repeatedly puts the plane in position where it thinks it has a chance to hit.
__________________
An elemental spirit summoned up from the Sea of Lament itself and given one purpose, one skill, one desire... to sail! Or, to model hulls and adjust damage zones if no sailing jobs are open. My mods: Little Ships, Air Force Last edited by kapuhy; 08-09-22 at 07:19 AM. |
|
08-09-22, 07:32 AM | #113 |
Village Idiot
|
|
08-09-22, 08:33 AM | #114 | |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Quote:
Plane:SetCourseBombs tells aircraft to follow a trajectory which in theory should be optimal either for level or dive bombing (depending on sim file setting), but apparently it is bugged and it won't work on moving targets. Plane:Strafe, on turn, should be more appropriate for cannon strafe runs, but due to the above limitations it happens to increase bombing accuracy over the previous command. My point is: seeing that Plane:Strafe is the most effective command against moving targets, no matter the weapon used, game AI should trigger the relative strategy if the attacking plane has either gun bullets OR bombs left. With your current script, aircraft won't strafe if they have no cannon / cannon bullets, no matter if they can still drop bombs. That would be correct if strafing was used in game as in real life, and it still is if you want to set up distinct gun strafing and bombing strategies against stationary targets, but it is not according to the new usage you are doing of the said command against fast-moving targets. I hope I made myself clearer this time. |
|
08-09-22, 12:22 PM | #115 |
Village Idiot
|
I'd think the structure is like this.........
AirPlane.aix is used by the Airplanes. So Plane:statement checks the Plane for bombs and such. In there is Ship:command or whatever..... That seems to be jumping to what I pointed out in the Sim settings. |
08-09-22, 01:24 PM | #116 | |
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Quote:
If AI is governed by AIcommander controllers (which would be logical, wouldn't it?) then Submarine or Plane AI contains ship AI but not vice versa. Kinda explains why I could get AI sub guns working but similar trick didn't work with torpedoes on surface ships... |
|
08-09-22, 01:35 PM | #117 |
Village Idiot
|
Maybe the torpedos on suface Ships are looking for the
wpn_SubTorpedoSys Controller? The AI Subs have that. I also wonder if we couldn't use the DIVE on AirPlanes and set it to say +5 meters above the water? Last edited by Jeff-Groves; 08-09-22 at 01:47 PM. |
08-09-22, 01:47 PM | #118 | |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Quote:
Changin of topic, while looking into Airplane.aix I have noticed that several commands accept numeric parameters. Some of them are pretty obvious, e.g. Ship:SetThrottle() where 1.0 means full throttle and 0.0 means engine off, or Ship:TurnToHeading() whose arguments are likely to be angles in degrees, but in most cases their meaning is not so clear. I am under the impression that the parameters accepted by some commands are chances that those commands will be run, but that should be tested. Any ideas? |
|
08-09-22, 01:52 PM | #119 |
Village Idiot
|
You mean the Random?
I'm thinking the Random numbers are start and final So if Random(15, 20) The numbers are drawn from 15 to 20 |
08-09-22, 02:17 PM | #120 | |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Quote:
Else, Plane:Strafe is another of those commands that accept a numeric parameter, but all the instances I found of it go from -20 to 100. Could that be an angle relative to current aircraft heading? |
|
|
|