When the developers created SH3, they intended that all aircraft would be spawned randomly from land bases placed in file campaign_RND.mis. Aircraft would be flown off at random intervals, based on the proximity of any air-base within range of the U-boat, but would not be permitted to fly in poor visibility. No aircraft were placed in the scripted layer (campaign_SCR.mis).

The Problem.
However, the randomly generated aircraft suffer from two defects:
1. Attacks are made far too frequently on a U-boat that is close to an air-base.
2. In real life, aircraft were sometimes given orders to patrol (fly up and down) specific areas of the sea and nowhere else. This was particularly the case for air patrols over the north-west of Spain from January 1943 to June 1944. The effect cannot be mimicked with aircraft from an air-base in campaign_RND.mis by any adjustment of the file airstrike.cfg.

It would seem, then, that scripted air patrols ought to solve both these problems. However, experience soon shows that scripted air patrols are not very successful. If they are placed in the campaign_RND.mis file, the aircraft behave like flying merchant-ships, often failing to see the U-boat at all, rarely dropping bombs, and never using radar. If the scripted air patrols are placed in campaign_SCR.mis, these difficulties are greatly reduced, but there remains one major difficulty. The aircraft continue to fly in ‘fog’ (bad visibility caused by storms), unlike the randomly generated aircraft from air-bases.

When one writes a scripted aircraft patrol, it is necessary to make the aircraft fly out from base, and then for very long patrols, usually involving a loop where the aircraft keeps going round in a scripted circle without ever returning to base (there is no limit to fuel for scripted aircraft). The alternative would be to write a scripted patrol for every day, for as many months as are needed - an enormous effort that would create a huge campaign_SCR.mis file. The air-bases of campaign_RND.mis need be written only once or twice, to accommodate changing numbers of aircraft and their types at each air-base. What if a scripted aircraft is shot down? Then there will be no replacement aircraft until the U-boat finishes its patrol and starts a new patrol.

A practical solution would be to allow seven-day scripted patrols, after which the next seven-day patrol followed, and so on for the total period required. Of course, if the aircraft was shot down on day one of its seven-day patrol, then there would be no patrol for the next six days, until the new patrol was due to begin. However, aircraft are rarely shot down, and this idea provides a less tiresome solution than writing daily scripts for months. Incidentally, tests of the code for SH3 during trials with scripted aircraft show clearly that a damaged aircraft is ‘repaired’ (and given a full bomb load) every time that it departs from the U-boat and is encountered at a later date.

The Solution.
The same idea also provides the solution to prevent scripted aircraft from flying in bad visibility. The weather is tested, and if the visibility is medium fog (or worse), the program itself can destroy the aircraft before the U-boat even encounters it (by identifying any scripted aircraft with exactly 288.75 hit-points at first contact). It will be replaced by a new scripted aircraft in up to a week’s time.

Aircraft don’t really use radar.
I believe from testing that actually no radar-fitted bomber uses its radar to locate the U-boat - the radar serves only to alert the U-boat in SH3. The scripted bomber flies unconcernedly on until it sees the U-boat visually - then it will attack. The land-based bomber however is generated just a short distance away from the U-boat, and is given the correct angle by the code to fly towards the U-boat. Only later does the aircraft see the U-boat lying across its path.

The package supplied:
A zip file called Scripted_Bombers.7z. It contains a folder that is ready for use with JSGME, with three campaign files - the campaign_RND.mis and campaign_LND.mis files contain nothing at all(! - except the single U-boat base of St Nazaire), while the campaign_SCR.mis file contains a single series of patrol files for a single Sunderland bomber ‘MKS’. These files are active during September 1943 ONLY. The package also contains TWO SH3_collisions.act files, one to replace the stock SH3Collisions.act, the other to replace H.sie's modified SH3Collisions.act

Feedback requested.
I’d be interested in feedback/suggestions from other users, especially those using stock SH3 or one of the super-mods that is not NYGM. You can add the MKS Sunderland with scripts to the bottom of your usual campaign_SCR.mis file, before the ordnance scripts.

Permanence.
You can leave your new SH3Collisions.act file in place *permanently* (even if you don’t want scripted aircraft), since the new code is only implemented when it encounters any aircraft with hit-points of exactly 288.75. Alternatively, you can modify some of your bombers to have HPs 288.75 and use them from air-bases in campaign_RND.mis AND in scripted missions in campaign_SCR.mis.

This is interesting but I am more interested in where in the hex or from what offset the heap for units generated within uboat line of sight are? For example, as you say the bomber will have full bomb load and not be injured when it returns to uboat. This means it is leaving and then reentering the stack, having the object being created again like new.

What is the offset and where is it located for ships, airplanes and land units that are near the uboat during patrol? This data would be very helpful.

The specific intercept that I use is in the code beginning at SH3Collisions.act+02e70. Register ebx points to the active unit.

This is particularly useful, in that:
a) only scripted units (including the player's unit) pass through this code. Randomly-generated units and land units have their own code. This saves a lot of computation.
b) The SH3Collisions.act code is mostly activated only when other units are sufficiently close to the U-boat that a collision (eg with a bomb or shell) might occur.

Thus scripted aircraft can only make my new code active when they are close to the U-boat, but before the U-boat is seen, and before a radar-warning given. Then, in poor visibility, the hit-points at float[ebx+00B8] are set to zero and [ebx+00D0] is also set to zero, which kills further movement of the aircraft.

But note how useful this is: if there are many scripted aircraft flying nearby, only those sufficiently close to the U-boat will be eliminated. The others will continue to fly their scripted routes even in bad weather, so they remain still a threat to the U-boat when visibility becomes better.

I have also revised my plan stated above to provide multiple scripts at 7-day intervals for periods of months in area north-west of Spain. As just stated, most of the scripted aircraft will survive poor visibility anyway, because the U-boat is not near. Moreover - I forgot earlier - most U-boat patrols will be of at least six weeks' duration. Therefore it is only necessary to provide scripts, not for every seven days, but for every six weeks - and at 2-3 month intervals when the air cover was present, but weaker, in the same area.

Here's an alternative for you: Make an invisible unarmed ship that is linked to an airbase (Aircraft carrier) that spaws the period appropiate aircraft. Then you have it patrol the Bay of Biscay or whatever area you want.

The specific intercept that I use is in the code beginning at SH3Collisions.act+02e70. Register ebx points to the active unit.

This is particularly useful, in that:
a) only scripted units (including the player's unit) pass through this code. Randomly-generated units and land units have their own code. This saves a lot of computation.
b) The SH3Collisions.act code is mostly activated only when other units are sufficiently close to the U-boat that a collision (eg with a bomb or shell) might occur.

Thus scripted aircraft can only make my new code active when they are close to the U-boat, but before the U-boat is seen, and before a radar-warning given. Then, in poor visibility, the hit-points at float[ebx+00B8] are set to zero and [ebx+00D0] is also set to zero, which kills further movement of the aircraft.

But note how useful this is: if there are many scripted aircraft flying nearby, only those sufficiently close to the U-boat will be eliminated. The others will continue to fly their scripted routes even in bad weather, so they remain still a threat to the U-boat when visibility becomes better.

I have also revised my plan stated above to provide multiple scripts at 7-day intervals for periods of months in area north-west of Spain. As just stated, most of the scripted aircraft will survive poor visibility anyway, because the U-boat is not near. Moreover - I forgot earlier - most U-boat patrols will be of at least six weeks' duration. Therefore it is only necessary to provide scripts, not for every seven days, but for every six weeks - and at 2-3 month intervals when the air cover was present, but weaker, in the same area.

Here's an alternative for you: Make an invisible unarmed ship that is linked to an airbase (Aircraft carrier) that spaws the period appropiate aircraft. Then you have it patrol the Bay of Biscay or whatever area you want.

Hi Hitman, nice to see you're still around and active.

If your intention is: place an airbase on the aircraft-carrier, then NYGM has already a very similar solution for the Bay of Biscay. Specifically, it has an air-base placed 800m in the air above the western Bay of Biscay (completely invisible!) stocked with bombers of deliberately short (500km) range. This creates frequent air attacks on a U-boat trying to get in or out of the Atlantic. It is very effective, and forces all U-boats to hug the north coast of Spain to get to/from the Atlantic. There are constant air attacks.

The big problem is that it is impossible to move through the middle of the Bay of Biscay without very, very frequent air attacks. If you are returning from a patrol off Iceland, you have to return to base in a wide loop, finally coming up the west coast of Spain from the south in order to crawl along the north coast back to base.

Likewise, schnorchel patrols close to Britain in 1944-5 are hindered by constant attacks by aircraft spawned from land bases. The central problem is that the closer you are to an air-base, the more frequently aircraft from it attack (probably an inverse square-rule by the devs).

Like you say, the problem with the fixed airbase is that you can't transit through the centre of the Biscay Bay without too frequent air attacks because the closer to it, the more air attacks. The solution of the moving airbase solves that by randomizing the location of the base itself, which moves over a zone.

Like you say, the problem with the fixed airbase is that you can't transit through the centre of the Biscay Bay without too frequent air attacks because the closer to it, the more air attacks. The solution of the moving airbase solves that by randomizing the location of the base itself, which moves over a zone.

Yes, that is an interesting idea. The airborne air-base could probably be made to move in a scripted circle with random path at 800m above the Bay of Biscay. Also use aircraft with very short radius.

At the moment, I'm trying to raise the alertness level of the scripted aircraft that I mentioned previously.

@Anvar1061:

Quote:

Will work this new SH3Collisions.act with my campaign_RND.mis, campaign_LND.mis & campaign_SCR.mis files?

I've now tested fully Hitman's idea of using a moving land-base for aircraft around the Bay of Biscay, using a moving special airbase floating at around 1200m in the air, and fitted with aircraft of limited range. The movement of the airbases can be seen clearly, if they are allowed to transmit their position every six hours.

This idea works very well, with a selection of two special aircraft. The aircraft require ranges of 300km, chosen by experiment, and the speed of the moving airbases is set at 50km/hr. The aircraft will not attack in medium or thick fog.

However, I have persevered with my original idea of using scripted bombers, as an addition to the moving airbases. The modified file SH3Collisions.act, mentioned earlier, prevents the scripted aircraft from appearing during fog.

Two observations are of interest:
1. When the stealth-meter turns red, it does not mean that the aircraft has detected you. You are detected when the time-compression drops to 8.
2. All the aircraft (scripted or spawned from a land-base) seem to be blind to the U-boat if it is not directly in their line of vision ahead as they fly close. As mentioned previously, the spawned aircraft are given a direct line of flight to the U-boat by the code before they are visible from the U-boat. This makes them deadly. The scripted aircraft can fly in a straight line past your U-boat without seeing it, even if it is close, unless the U-boat is by chance almost directly ahead of the flight of the aircraft.

I'm still trying to find out how to switch on the 'U-boat sighted' flag for scripted aircraft. But in the meantime the combination of moving airbase and scripted aircraft in the Bay of Biscay seems to give just the right level of air attack in late 1943.

If you download NYGM_2017 (by itself, if necessary, for purposes of examination, although this single mod will not function by itself), you can see what I have done by examining the campaign _LND and _SCR.mis files in SH3 Mission Editor. Also examine the Data\Air\ files in this small mod, to discover the changes made to the cfg and (some) zon files.